constructive-algebra-0.1.4: A library of constructive algebra.

Algebra.UPoly

Description

Univariate polynomials parametrised by the variable name.

Synopsis

Documentation

newtype CommutativeRing r => UPoly r x Source

Polynomials over a commutative ring, indexed by a phantom type x that denote the name of the variable that the polynomial is over. For example UPoly Q X_ is Q[x] and UPoly Q T_ is Q[t].

Constructors

UP [r] 

Instances

Eq r => Eq (UPoly r x) 
(Show r, Field r, Num r, Show x) => Num (UPoly r x) 
Ord r => Ord (UPoly r x) 
(CommutativeRing r, Eq r, Show r, Show x) => Show (UPoly r x) 
(CommutativeRing r, Eq r, Arbitrary r) => Arbitrary (UPoly r x) 
(CommutativeRing r, Eq r) => Ring (UPoly r x) 
(CommutativeRing r, Eq r) => CommutativeRing (UPoly r x) 
(CommutativeRing r, Eq r) => IntegralDomain (UPoly r x) 
(Field k, Eq k) => EuclideanDomain (UPoly k x) 

deg :: CommutativeRing r => UPoly r x -> IntegerSource

The degree of the polynomial.

type Qx = UPoly Q X_Source

Useful shorthand for Q[x].

x :: QxSource

The variable x in Q[x].

toUPoly :: (CommutativeRing r, Eq r) => [r] -> UPoly r xSource

Take a list and construct a polynomial by removing all zeroes in the end.

monomial :: CommutativeRing r => r -> Integer -> UPoly r xSource

Take an element of the ring and the degree of the desired monomial, for example: monomial 3 7 = 3x^7

lt :: CommutativeRing r => UPoly r x -> rSource

Compute the leading term of a polynomial.

deriv :: CommutativeRing r => UPoly r x -> UPoly r xSource

Formal derivative of polynomials in k[x].

sqfr :: (Num k, Field k) => UPoly k x -> UPoly k xSource

Square free decomposition of a polynomial.

sqfrDec :: (Num k, Field k) => UPoly k x -> [UPoly k x]Source

Distinct power factorization, aka square free decomposition