ForSyDe.Shallow.PolyArith
 Portability portable Stability experimental Maintainer forsyde-dev@ict.kth.se
 Contents Polynomial data type Addition, DmMultiplication, division and power operations Some helper functions
Description
This is the polynomial arithematic library. The arithematic operations include addition, multiplication, division and power. However, the computation time is not optimized for multiplication and is O(n2), which could be considered to be optimized by FFT algorithms later on.
Synopsis
data Num a => Poly a
 = Poly [a] | PolyPair (Poly a, Poly a)
addPoly :: Num a => Poly a -> Poly a -> Poly a
mulPoly :: Num a => Poly a -> Poly a -> Poly a
divPoly :: Num a => Poly a -> Poly a -> Poly a
powerPoly :: Num a => Poly a -> Int -> Poly a
getCoef :: Num a => Poly a -> ([a], [a])
scalePoly :: Num a => a -> Poly a -> Poly a
addPolyCoef :: Num a => [a] -> [a] -> [a]
subPolyCoef :: RealFloat a => [a] -> [a] -> [a]
scalePolyCoef :: Num a => a -> [a] -> [a]
Polynomial data type
 data Num a => Poly a Source
Polynomial data type.
Constructors
 Poly [a] PolyPair (Poly a, Poly a)
Instances
 Num a => Eq (Poly a)
Addition, DmMultiplication, division and power operations
 addPoly :: Num a => Poly a -> Poly a -> Poly a Source
 mulPoly :: Num a => Poly a -> Poly a -> Poly a Source
Multiplication operation of polynomials.
 divPoly :: Num a => Poly a -> Poly a -> Poly a Source
Division operation of polynomials.
 powerPoly :: Num a => Poly a -> Int -> Poly a Source
Power operation of polynomials.
Some helper functions
 getCoef :: Num a => Poly a -> ([a], [a]) Source

Some helper functions below.

To get the coefficients of the polynomial.

 scalePoly :: Num a => a -> Poly a -> Poly a Source
 addPolyCoef :: Num a => [a] -> [a] -> [a] Source
 subPolyCoef :: RealFloat a => [a] -> [a] -> [a] Source
 scalePolyCoef :: Num a => a -> [a] -> [a] Source