singular-factory-0.1: Multivariate polynomial factorization via bindings to Singular-factory

Safe HaskellSafe
LanguageHaskell2010

Math.Singular.Factory.Expr

Contents

Description

Polynomial expressions (used for parsing)

Synopsis

Types

data Sign Source #

Constructors

Plus 
Minus 
Instances
Eq Sign Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

(==) :: Sign -> Sign -> Bool #

(/=) :: Sign -> Sign -> Bool #

Ord Sign Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

compare :: Sign -> Sign -> Ordering #

(<) :: Sign -> Sign -> Bool #

(<=) :: Sign -> Sign -> Bool #

(>) :: Sign -> Sign -> Bool #

(>=) :: Sign -> Sign -> Bool #

max :: Sign -> Sign -> Sign #

min :: Sign -> Sign -> Sign #

Show Sign Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

showsPrec :: Int -> Sign -> ShowS #

show :: Sign -> String #

showList :: [Sign] -> ShowS #

negateIfMinus :: Num a => Sign -> a -> a Source #

newtype Monom var Source #

Monomials

Constructors

Monom [(var, Int)] 
Instances
Functor Monom Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

fmap :: (a -> b) -> Monom a -> Monom b #

(<$) :: a -> Monom b -> Monom a #

Foldable Monom Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

fold :: Monoid m => Monom m -> m #

foldMap :: Monoid m => (a -> m) -> Monom a -> m #

foldr :: (a -> b -> b) -> b -> Monom a -> b #

foldr' :: (a -> b -> b) -> b -> Monom a -> b #

foldl :: (b -> a -> b) -> b -> Monom a -> b #

foldl' :: (b -> a -> b) -> b -> Monom a -> b #

foldr1 :: (a -> a -> a) -> Monom a -> a #

foldl1 :: (a -> a -> a) -> Monom a -> a #

toList :: Monom a -> [a] #

null :: Monom a -> Bool #

length :: Monom a -> Int #

elem :: Eq a => a -> Monom a -> Bool #

maximum :: Ord a => Monom a -> a #

minimum :: Ord a => Monom a -> a #

sum :: Num a => Monom a -> a #

product :: Num a => Monom a -> a #

Traversable Monom Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

traverse :: Applicative f => (a -> f b) -> Monom a -> f (Monom b) #

sequenceA :: Applicative f => Monom (f a) -> f (Monom a) #

mapM :: Monad m => (a -> m b) -> Monom a -> m (Monom b) #

sequence :: Monad m => Monom (m a) -> m (Monom a) #

Eq var => Eq (Monom var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

(==) :: Monom var -> Monom var -> Bool #

(/=) :: Monom var -> Monom var -> Bool #

Ord var => Ord (Monom var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

compare :: Monom var -> Monom var -> Ordering #

(<) :: Monom var -> Monom var -> Bool #

(<=) :: Monom var -> Monom var -> Bool #

(>) :: Monom var -> Monom var -> Bool #

(>=) :: Monom var -> Monom var -> Bool #

max :: Monom var -> Monom var -> Monom var #

min :: Monom var -> Monom var -> Monom var #

Show var => Show (Monom var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

showsPrec :: Int -> Monom var -> ShowS #

show :: Monom var -> String #

showList :: [Monom var] -> ShowS #

data Term coeff var Source #

A monomial multiplied by a constant

Constructors

Term !coeff !(Monom var) 
Instances
Functor (Term coeff) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

fmap :: (a -> b) -> Term coeff a -> Term coeff b #

(<$) :: a -> Term coeff b -> Term coeff a #

Foldable (Term coeff) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

fold :: Monoid m => Term coeff m -> m #

foldMap :: Monoid m => (a -> m) -> Term coeff a -> m #

foldr :: (a -> b -> b) -> b -> Term coeff a -> b #

foldr' :: (a -> b -> b) -> b -> Term coeff a -> b #

foldl :: (b -> a -> b) -> b -> Term coeff a -> b #

foldl' :: (b -> a -> b) -> b -> Term coeff a -> b #

foldr1 :: (a -> a -> a) -> Term coeff a -> a #

foldl1 :: (a -> a -> a) -> Term coeff a -> a #

toList :: Term coeff a -> [a] #

null :: Term coeff a -> Bool #

length :: Term coeff a -> Int #

elem :: Eq a => a -> Term coeff a -> Bool #

maximum :: Ord a => Term coeff a -> a #

minimum :: Ord a => Term coeff a -> a #

sum :: Num a => Term coeff a -> a #

product :: Num a => Term coeff a -> a #

Traversable (Term coeff) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

traverse :: Applicative f => (a -> f b) -> Term coeff a -> f (Term coeff b) #

sequenceA :: Applicative f => Term coeff (f a) -> f (Term coeff a) #

mapM :: Monad m => (a -> m b) -> Term coeff a -> m (Term coeff b) #

sequence :: Monad m => Term coeff (m a) -> m (Term coeff a) #

(Eq coeff, Eq var) => Eq (Term coeff var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

(==) :: Term coeff var -> Term coeff var -> Bool #

(/=) :: Term coeff var -> Term coeff var -> Bool #

(Ord coeff, Ord var) => Ord (Term coeff var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

compare :: Term coeff var -> Term coeff var -> Ordering #

(<) :: Term coeff var -> Term coeff var -> Bool #

(<=) :: Term coeff var -> Term coeff var -> Bool #

(>) :: Term coeff var -> Term coeff var -> Bool #

(>=) :: Term coeff var -> Term coeff var -> Bool #

max :: Term coeff var -> Term coeff var -> Term coeff var #

min :: Term coeff var -> Term coeff var -> Term coeff var #

(Show coeff, Show var) => Show (Term coeff var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

showsPrec :: Int -> Term coeff var -> ShowS #

show :: Term coeff var -> String #

showList :: [Term coeff var] -> ShowS #

newtype GenPoly coeff var Source #

Polynomials as linear combination of monomials

Constructors

GenPoly [Term coeff var] 
Instances
Functor (GenPoly coeff) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

fmap :: (a -> b) -> GenPoly coeff a -> GenPoly coeff b #

(<$) :: a -> GenPoly coeff b -> GenPoly coeff a #

Foldable (GenPoly coeff) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

fold :: Monoid m => GenPoly coeff m -> m #

foldMap :: Monoid m => (a -> m) -> GenPoly coeff a -> m #

foldr :: (a -> b -> b) -> b -> GenPoly coeff a -> b #

foldr' :: (a -> b -> b) -> b -> GenPoly coeff a -> b #

foldl :: (b -> a -> b) -> b -> GenPoly coeff a -> b #

foldl' :: (b -> a -> b) -> b -> GenPoly coeff a -> b #

foldr1 :: (a -> a -> a) -> GenPoly coeff a -> a #

foldl1 :: (a -> a -> a) -> GenPoly coeff a -> a #

toList :: GenPoly coeff a -> [a] #

null :: GenPoly coeff a -> Bool #

length :: GenPoly coeff a -> Int #

elem :: Eq a => a -> GenPoly coeff a -> Bool #

maximum :: Ord a => GenPoly coeff a -> a #

minimum :: Ord a => GenPoly coeff a -> a #

sum :: Num a => GenPoly coeff a -> a #

product :: Num a => GenPoly coeff a -> a #

Traversable (GenPoly coeff) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

traverse :: Applicative f => (a -> f b) -> GenPoly coeff a -> f (GenPoly coeff b) #

sequenceA :: Applicative f => GenPoly coeff (f a) -> f (GenPoly coeff a) #

mapM :: Monad m => (a -> m b) -> GenPoly coeff a -> m (GenPoly coeff b) #

sequence :: Monad m => GenPoly coeff (m a) -> m (GenPoly coeff a) #

(Eq coeff, Eq var) => Eq (GenPoly coeff var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

(==) :: GenPoly coeff var -> GenPoly coeff var -> Bool #

(/=) :: GenPoly coeff var -> GenPoly coeff var -> Bool #

(Ord coeff, Ord var) => Ord (GenPoly coeff var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

compare :: GenPoly coeff var -> GenPoly coeff var -> Ordering #

(<) :: GenPoly coeff var -> GenPoly coeff var -> Bool #

(<=) :: GenPoly coeff var -> GenPoly coeff var -> Bool #

(>) :: GenPoly coeff var -> GenPoly coeff var -> Bool #

(>=) :: GenPoly coeff var -> GenPoly coeff var -> Bool #

max :: GenPoly coeff var -> GenPoly coeff var -> GenPoly coeff var #

min :: GenPoly coeff var -> GenPoly coeff var -> GenPoly coeff var #

(Show coeff, Show var) => Show (GenPoly coeff var) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

showsPrec :: Int -> GenPoly coeff var -> ShowS #

show :: GenPoly coeff var -> String #

showList :: [GenPoly coeff var] -> ShowS #

data Expr v Source #

Polynomial expressions

Constructors

VarE !v 
KstE !Integer 
NegE (Expr v) 
LinE [(Sign, Expr v)] 
MulE [Expr v] 
PowE (Expr v) !Int 
Instances
Functor Expr Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

fmap :: (a -> b) -> Expr a -> Expr b #

(<$) :: a -> Expr b -> Expr a #

Foldable Expr Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

fold :: Monoid m => Expr m -> m #

foldMap :: Monoid m => (a -> m) -> Expr a -> m #

foldr :: (a -> b -> b) -> b -> Expr a -> b #

foldr' :: (a -> b -> b) -> b -> Expr a -> b #

foldl :: (b -> a -> b) -> b -> Expr a -> b #

foldl' :: (b -> a -> b) -> b -> Expr a -> b #

foldr1 :: (a -> a -> a) -> Expr a -> a #

foldl1 :: (a -> a -> a) -> Expr a -> a #

toList :: Expr a -> [a] #

null :: Expr a -> Bool #

length :: Expr a -> Int #

elem :: Eq a => a -> Expr a -> Bool #

maximum :: Ord a => Expr a -> a #

minimum :: Ord a => Expr a -> a #

sum :: Num a => Expr a -> a #

product :: Num a => Expr a -> a #

Traversable Expr Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

traverse :: Applicative f => (a -> f b) -> Expr a -> f (Expr b) #

sequenceA :: Applicative f => Expr (f a) -> f (Expr a) #

mapM :: Monad m => (a -> m b) -> Expr a -> m (Expr b) #

sequence :: Monad m => Expr (m a) -> m (Expr a) #

Eq v => Eq (Expr v) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

(==) :: Expr v -> Expr v -> Bool #

(/=) :: Expr v -> Expr v -> Bool #

Ord v => Ord (Expr v) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

compare :: Expr v -> Expr v -> Ordering #

(<) :: Expr v -> Expr v -> Bool #

(<=) :: Expr v -> Expr v -> Bool #

(>) :: Expr v -> Expr v -> Bool #

(>=) :: Expr v -> Expr v -> Bool #

max :: Expr v -> Expr v -> Expr v #

min :: Expr v -> Expr v -> Expr v #

Show v => Show (Expr v) Source # 
Instance details

Defined in Math.Singular.Factory.Expr

Methods

showsPrec :: Int -> Expr v -> ShowS #

show :: Expr v -> String #

showList :: [Expr v] -> ShowS #

Evaluation to Num

evalSign :: Num c => Sign -> c -> c Source #

evalMonom :: Num c => (var -> c) -> Monom var -> c Source #

evalTerm :: Num c => (coeff -> c) -> (var -> c) -> Term coeff var -> c Source #

evalGenPoly :: Num c => (coeff -> c) -> (var -> c) -> GenPoly coeff var -> c Source #

evalExpr :: Num c => (var -> c) -> Expr var -> c Source #