Safe Haskell | None |
---|---|
Language | Haskell2010 |
Multivariate compact monomials where the variable set
looks like {x_1, x_2, ... , x_N}
.
This is very similar to the "Indexed" version, but should have much more compact in-memory representation (which is useful in case of large or many polynomials, and should be in theory also faster, because of cache friendlyness)
Synopsis
- newtype Compact (var :: Symbol) (n :: Nat) = Compact WordVec
- compactVar :: KnownSymbol var => Compact var n -> String
- nOfCompact :: KnownNat n => Compact var n -> Int
- compactFromList :: KnownNat n => [(Index, Int)] -> Compact v n
- compactToList :: Compact v n -> [(Index, Int)]
- compactFromWordExpoList :: KnownNat n => [Word] -> Compact var n
- compactToWordExpoList :: Compact var n -> [Word]
- compactFromExponents :: KnownNat n => [Int] -> Compact v n
- compactToExponents :: KnownNat n => Compact v n -> [Int]
- compactFromXS :: KnownNat n => XS v n -> Compact v n
- compactToXS :: KnownNat n => Compact v n -> XS v n
- emptyCompact :: KnownNat n => Compact v n
- isEmptyCompact :: Compact v n -> Bool
- isNormalCompact :: KnownNat n => Compact v n -> Bool
- variableCompact :: KnownNat n => Index -> Compact v n
- singletonCompact :: KnownNat n => Index -> Int -> Compact v n
- mulCompact :: KnownNat n => Compact v n -> Compact v n -> Compact v n
- productCompact :: (KnownNat n, Foldable f) => f (Compact v n) -> Compact v n
- powCompact :: KnownNat n => Compact v n -> Int -> Compact v n
- divCompact :: KnownNat n => Compact v n -> Compact v n -> Maybe (Compact v n)
- maxDegCompact :: Compact v n -> Int
- totalDegCompact :: Compact v n -> Int
- diffCompact :: Num c => Index -> Int -> Compact v n -> Maybe (Compact v n, c)
Monomials
newtype Compact (var :: Symbol) (n :: Nat) Source #
Monomials of the variables x1,x2,...,xn
. The internal representation is a
compact vector of the exponents.
The type is indexed by the name of the variables, and then the number of variables.
Note that we assume here that the internal vector has length n
.
Instances
compactVar :: KnownSymbol var => Compact var n -> String Source #
Name of the variables
Conversion
compactFromList :: KnownNat n => [(Index, Int)] -> Compact v n Source #
from (variable,exponent)
pairs
compactToWordExpoList :: Compact var n -> [Word] Source #
to Word
exponent list
empty (all zero exponents)
emptyCompact :: KnownNat n => Compact v n Source #
isEmptyCompact :: Compact v n -> Bool Source #
normalization
creation
products
degree
maxDegCompact :: Compact v n -> Int Source #
totalDegCompact :: Compact v n -> Int Source #