Portability | portable |
---|---|
Stability | experimental |
Maintainer | mik@konecny.aow.cz |
Internal module for Data.Number.ER.RnToRm.UnitDom.ChebyshevBase.Polynom.
Definition of the polynomial datatype and simple related functions.
- data ERChebPoly box b = ERChebPoly {
- chplCoeffs :: Map (TermKey box) b
- type TermKey box = box
- chplConstTermKey :: DomainBox box varid d => box
- chplIsConstTermKey :: DomainBox box varid d => box -> Bool
- chplTermOrder :: (DomainBox box varid d, Num d) => box -> d
- chplTermArity :: DomainBox box varid d => box -> Int
- chplGetDegree :: (ERRealBase b, DomainBox box varid d, Num d, Ord d) => ERChebPoly box b -> d
- chplConst :: (ERRealBase b, DomainBox box varid Int, Ord box) => b -> ERChebPoly box b
- chplVar :: (ERRealBase b, DomainBox box varid Int, Ord box) => varid -> ERChebPoly box b
- chplNormaliseUp :: (ERRealBase b, DomainBox box varid Int, Ord box) => ERChebPoly box b -> ERChebPoly box b
- chplNormaliseDown :: (ERRealBase b, DomainBox box varid Int, Ord box) => ERChebPoly box b -> ERChebPoly box b
- chplNormalise :: (ERRealBase b, DomainBox box varid Int, Ord box) => ERChebPoly box b -> (ERChebPoly box b, ERChebPoly box b)
- chplShow :: (ERRealBase b, DomainBox box varid Int, Ord box) => Bool -> ERChebPoly box b -> String
- chebToXBasis :: (ERRealBase b, DomainBox box varid Int, Ord box) => Map (TermKey box) b -> Map (TermKey box) b
- termXterms :: (DomainBox box varid Int, Ord box) => TermKey box -> Map (TermKey box) Integer
- chebyXCoeffsLists :: (Num d1, Enum d1, Num d2, Enum d2) => [[(d1, d2)]]
- chebyXCoeffs :: (Num d, Enum d) => [[d]]
Documentation
data ERChebPoly box b Source
A polynomial represented by its coefficients it the Chebyshev basis.
The polynomials are never to be used outside the domain [-1,1]^n
.
All operations are rounded in such a way that the resulting polynomial is a point-wise upper or lower bound of the exact result.
ERChebPoly | |
|
Typeable2 ERChebPoly | |
(ERRealBase rb, RealFrac rb, DomainBox box varid Int, Ord box, DomainBoxMappable boxb boxbb varid rb [(rb, rb)], DomainBoxMappable boxra boxras varid (ERInterval rb) [ERInterval rb], DomainIntBox boxra varid (ERInterval rb)) => ERUnitFnBase boxb boxra varid rb (ERInterval rb) (ERChebPoly box rb) | |
(Eq box, Eq b) => Eq (ERChebPoly box b) | |
(ERRealBase b, DomainBox box varid Int, Ord box) => Fractional (ERChebPoly box b) | |
(Data box, Data b, Ord box) => Data (ERChebPoly box b) | |
(ERRealBase b, DomainBox box varid Int, Ord box) => Num (ERChebPoly box b) | |
(ERRealBase b, DomainBox box varid Int, Ord box) => Ord (ERChebPoly box b) | |
(ERRealBase b, DomainBox box varid Int, Ord box) => Show (ERChebPoly box b) | |
(Ord a, Binary a, Binary b) => Binary (ERChebPoly a b) |
chplConstTermKey :: DomainBox box varid d => boxSource
chplIsConstTermKey :: DomainBox box varid d => box -> BoolSource
chplTermOrder :: (DomainBox box varid d, Num d) => box -> dSource
chplTermArity :: DomainBox box varid d => box -> IntSource
chplGetDegree :: (ERRealBase b, DomainBox box varid d, Num d, Ord d) => ERChebPoly box b -> dSource
Inspect all terms of the polynomial and return the degree of the highest degree term.
chplConst :: (ERRealBase b, DomainBox box varid Int, Ord box) => b -> ERChebPoly box bSource
chplVar :: (ERRealBase b, DomainBox box varid Int, Ord box) => varid -> ERChebPoly box bSource
make a basic x polynomial for a given variable number
chplNormaliseUp :: (ERRealBase b, DomainBox box varid Int, Ord box) => ERChebPoly box b -> ERChebPoly box bSource
chplNormaliseDown :: (ERRealBase b, DomainBox box varid Int, Ord box) => ERChebPoly box b -> ERChebPoly box bSource
chplNormalise :: (ERRealBase b, DomainBox box varid Int, Ord box) => ERChebPoly box b -> (ERChebPoly box b, ERChebPoly box b)Source
:: (ERRealBase b, DomainBox box varid Int, Ord box) | |
=> Bool | show the polynomial also in its native Chebyshev basis |
-> ERChebPoly box b | |
-> String |
Convert a polynomial to a string representation, using the ordinary x^n basis.
:: (ERRealBase b, DomainBox box varid Int, Ord box) | |
=> Map (TermKey box) b | polynomial in Chebyshev basis |
-> Map (TermKey box) b | approxition of the equivalent polynomial in X^n basis |
conversion of polynomials from Chebyshev basis to the X^n basis
(not exact - suffering from rounding in the coefficient conversions)
:: (DomainBox box varid Int, Ord box) | |
=> TermKey box | a Chebyshev term represented by the Chebyshev degrees for each variable in the term |
-> Map (TermKey box) Integer | the polynomial equivalent to the given Chebyshev term (using integer coefficients) |
conversion of one Chebyshev term to the X^n basis
chebyXCoeffsLists :: (Num d1, Enum d1, Num d2, Enum d2) => [[(d1, d2)]]Source
Chebyshev polynomials expressed as associative lists power -> coeff
chebyXCoeffs :: (Num d, Enum d) => [[d]]Source
Chebyshev polynomials expressed as lists of integer coefficients for powers 0,1,2...