Safe Haskell | None |
---|---|
Language | Haskell2010 |
Multivariate monomials where the variable set
looks like {x_1, x_2, ... , x_N}
Synopsis
- newtype XS (var :: Symbol) (n :: Nat) = XS (UArray Int Int)
- xsVar :: KnownSymbol var => XS var n -> String
- nOfXS :: KnownNat n => XS var n -> Int
- emptyXS :: KnownNat n => XS v n
- isEmptyXS :: XS v n -> Bool
- isNormalXS :: KnownNat n => XS v n -> Bool
- xsFromList :: KnownNat n => [(Index, Int)] -> XS v n
- xsToList :: XS v n -> [(Index, Int)]
- xsFromExponents :: KnownNat n => [Int] -> XS v n
- xsToExponents :: KnownNat n => XS v n -> [Int]
- variableXS :: KnownNat n => Index -> XS v n
- singletonXS :: KnownNat n => Index -> Int -> XS v n
- mulXS :: KnownNat n => XS v n -> XS v n -> XS v n
- productXS :: (KnownNat n, Foldable f) => f (XS v n) -> XS v n
- powXS :: XS v n -> Int -> XS v n
- divXS :: KnownNat n => XS v n -> XS v n -> Maybe (XS v n)
- maxDegXS :: XS v n -> Int
- totalDegXS :: XS v n -> Int
- evalXS :: Num c => (Index -> c) -> XS v n -> c
- varSubsXS :: KnownNat n => (Index -> Index) -> XS v n -> XS v n
- termSubsXS :: (KnownNat n, Num c) => (Index -> Maybe c) -> (XS v n, c) -> (XS v n, c)
- diffXS :: Num c => Index -> Int -> XS v n -> Maybe (XS v n, c)
- embedXS :: (KnownNat n, KnownNat m) => XS v n -> XS v m
Monomials
newtype XS (var :: Symbol) (n :: Nat) Source #
Monomials of the variables x1,x2,...,xn
. The internal representation is the
dense array of exponents: x1^e1*x2^e2*...*xn^en
is represented by [e1,e2,...,en]
.
The type is indexed by the name of the variables, and then the number of variables.
Note that we require here that the array has bounds (1,n)
Instances
emptyness
normalization
conversion
creation
multiplication
degree
totalDegXS :: XS v n -> Int Source #
evaluation and substituion
differentiation
changing the number of variables
embedXS :: (KnownNat n, KnownNat m) => XS v n -> XS v m Source #
You can always increase the number of variables; you can also decrease, if don't use the last few ones.
This will throw an error if you try to eliminate variables which are in fact used. To do that, you can instead substitute 1 into them.