Safe Haskell | None |
---|---|
Language | Haskell2010 |
High-level bindings to singular-factory
Synopsis
- newtype Polynomial varset domain = Poly {}
- polyIsZero :: Polynomial vars domain -> Bool
- polyIsOne :: Polynomial vars domain -> Bool
- inBaseDomain :: Polynomial vars domain -> Bool
- mbConstant :: BaseDomain domain => Polynomial vars domain -> Maybe domain
- konst :: BaseDomain domain => domain -> Polynomial vars domain
- var :: VarIdx -> Polynomial vars domain
- varPow :: VarIdx -> Int -> Polynomial vars domain
- mapIntoDomain :: forall domain1 domain2 vars. (BaseDomain domain1, BaseDomain domain2) => Polynomial vars domain1 -> Polynomial vars domain2
- pow :: BaseDomain domain => Polynomial vars domain -> Int -> Polynomial vars domain
- polyGCD :: BaseDomain domain => Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain
- polyReduce :: BaseDomain domain => Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain
- factorize :: BaseDomain domain => Polynomial vars domain -> [(Polynomial vars domain, Int)]
- substitute1 :: BaseDomain domain => VarIdx -> Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain
- evaluate :: BaseDomain domain => (VarIdx -> domain) -> Polynomial vars domain -> domain
- parsePolynomial :: forall vars. VariableSet vars => Text -> Maybe (Polynomial vars Integer)
- parsePolyExpr :: forall vars. VariableSet vars => Text -> Maybe (Polynomial vars Integer)
- parsePolynomialStr :: forall vars. VariableSet vars => String -> Maybe (Polynomial vars Integer)
- parsePolyExprStr :: forall vars. VariableSet vars => String -> Maybe (Polynomial vars Integer)
Polynomials
newtype Polynomial varset domain Source #
A multivariate polynomial over a base domain.
Typically, you want to fix your variable set (see the module Math.Singular.Factory.Variables), make a type synonym, and use that; for example:
type Poly domain = Polynomial (VarN "x") domain
Instances
Eq (Polynomial vars domain) Source # | |
Defined in Math.Singular.Factory.Polynomial (==) :: Polynomial vars domain -> Polynomial vars domain -> Bool # (/=) :: Polynomial vars domain -> Polynomial vars domain -> Bool # | |
BaseDomain domain => Num (Polynomial vars domain) Source # | |
Defined in Math.Singular.Factory.Polynomial (+) :: Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain # (-) :: Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain # (*) :: Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain # negate :: Polynomial vars domain -> Polynomial vars domain # abs :: Polynomial vars domain -> Polynomial vars domain # signum :: Polynomial vars domain -> Polynomial vars domain # fromInteger :: Integer -> Polynomial vars domain # | |
VariableSet vars => Show (Polynomial vars domain) Source # | |
Defined in Math.Singular.Factory.Polynomial showsPrec :: Int -> Polynomial vars domain -> ShowS # show :: Polynomial vars domain -> String # showList :: [Polynomial vars domain] -> ShowS # |
polyIsZero :: Polynomial vars domain -> Bool Source #
polyIsOne :: Polynomial vars domain -> Bool Source #
inBaseDomain :: Polynomial vars domain -> Bool Source #
Returns true if the polynomial is a constant
mbConstant :: BaseDomain domain => Polynomial vars domain -> Maybe domain Source #
If it is a constant, returns the value
konst :: BaseDomain domain => domain -> Polynomial vars domain Source #
A constant polynomial
var :: VarIdx -> Polynomial vars domain Source #
A variable as a polynomial
Operations on polynomials
mapIntoDomain :: forall domain1 domain2 vars. (BaseDomain domain1, BaseDomain domain2) => Polynomial vars domain1 -> Polynomial vars domain2 Source #
pow :: BaseDomain domain => Polynomial vars domain -> Int -> Polynomial vars domain Source #
polyGCD :: BaseDomain domain => Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain Source #
Polynomial GCD
polyReduce :: BaseDomain domain => Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain Source #
Polynomial reduction
factorize :: BaseDomain domain => Polynomial vars domain -> [(Polynomial vars domain, Int)] Source #
Polynomial factorization
substitute1 :: BaseDomain domain => VarIdx -> Polynomial vars domain -> Polynomial vars domain -> Polynomial vars domain Source #
Substitution
evaluate :: BaseDomain domain => (VarIdx -> domain) -> Polynomial vars domain -> domain Source #
Evaluate a polynomial at the given point
Parsing
parsePolynomial :: forall vars. VariableSet vars => Text -> Maybe (Polynomial vars Integer) Source #
Parse a polynomial in expanded form
parsePolyExpr :: forall vars. VariableSet vars => Text -> Maybe (Polynomial vars Integer) Source #
Parse a polynomial expression (for example the product of two polynomials)
parsePolynomialStr :: forall vars. VariableSet vars => String -> Maybe (Polynomial vars Integer) Source #
parsePolyExprStr :: forall vars. VariableSet vars => String -> Maybe (Polynomial vars Integer) Source #