polynomial-algebra-0.1.0.1: Multivariate polynomial rings

Safe HaskellNone
LanguageHaskell2010

Math.Algebra.Polynomial.Univariate

Contents

Description

Univariate polynomials

Synopsis

Univariate polynomials

newtype Univariate (coeff :: *) (var :: Symbol) Source #

A univariate polynomial with the given coefficient ring. Note: this is also indexed by the name of the variable.

Constructors

Uni (FreeMod coeff (U var)) 
Instances
Eq coeff => Eq (Univariate coeff var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

Methods

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

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

(Ring c, KnownSymbol v) => Num (Univariate c v) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

Methods

(+) :: Univariate c v -> Univariate c v -> Univariate c v #

(-) :: Univariate c v -> Univariate c v -> Univariate c v #

(*) :: Univariate c v -> Univariate c v -> Univariate c v #

negate :: Univariate c v -> Univariate c v #

abs :: Univariate c v -> Univariate c v #

signum :: Univariate c v -> Univariate c v #

fromInteger :: Integer -> Univariate c v #

Ord coeff => Ord (Univariate coeff var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

Methods

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

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

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

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

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

max :: Univariate coeff var -> Univariate coeff var -> Univariate coeff var #

min :: Univariate coeff var -> Univariate coeff var -> Univariate coeff var #

Show coeff => Show (Univariate coeff var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

Methods

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

show :: Univariate coeff var -> String #

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

FreeModule (Univariate c v) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

Associated Types

type BaseF (Univariate c v) :: Type Source #

type CoeffF (Univariate c v) :: Type Source #

IsSigned (Univariate c v) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

Methods

signOf :: Univariate c v -> Maybe Sign Source #

(Ring c, KnownSymbol v) => Pretty (Univariate c v) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

(Ring coeff, KnownSymbol var) => Polynomial (Univariate coeff var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

Methods

evalP :: Num d => (CoeffP (Univariate coeff var) -> d) -> (VarP (Univariate coeff var) -> d) -> Univariate coeff var -> d Source #

varSubsP :: (VarP (Univariate coeff var) -> VarP (Univariate coeff var)) -> Univariate coeff var -> Univariate coeff var Source #

coeffSubsP :: (VarP (Univariate coeff var) -> Maybe (CoeffP (Univariate coeff var))) -> Univariate coeff var -> Univariate coeff var Source #

subsP :: (VarP (Univariate coeff var) -> Univariate coeff var) -> Univariate coeff var -> Univariate coeff var Source #

(Ring coeff, KnownSymbol var) => AlmostPolynomial (Univariate coeff var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

Associated Types

type CoeffP (Univariate coeff var) :: Type Source #

type MonomP (Univariate coeff var) :: Type Source #

type VarP (Univariate coeff var) :: Type Source #

Methods

fromListP :: [(MonomP (Univariate coeff var), CoeffP (Univariate coeff var))] -> Univariate coeff var Source #

toListP :: Univariate coeff var -> [(MonomP (Univariate coeff var), CoeffP (Univariate coeff var))] Source #

zeroP :: Univariate coeff var Source #

isZeroP :: Univariate coeff var -> Bool Source #

oneP :: Univariate coeff var Source #

variableP :: VarP (Univariate coeff var) -> Univariate coeff var Source #

singletonP :: VarP (Univariate coeff var) -> Int -> Univariate coeff var Source #

monomP :: MonomP (Univariate coeff var) -> Univariate coeff var Source #

monomP' :: MonomP (Univariate coeff var) -> CoeffP (Univariate coeff var) -> Univariate coeff var Source #

scalarP :: CoeffP (Univariate coeff var) -> Univariate coeff var Source #

addP :: Univariate coeff var -> Univariate coeff var -> Univariate coeff var Source #

subP :: Univariate coeff var -> Univariate coeff var -> Univariate coeff var Source #

negP :: Univariate coeff var -> Univariate coeff var Source #

sumP :: [Univariate coeff var] -> Univariate coeff var Source #

mulP :: Univariate coeff var -> Univariate coeff var -> Univariate coeff var Source #

productP :: [Univariate coeff var] -> Univariate coeff var Source #

coeffOfP :: MonomP (Univariate coeff var) -> Univariate coeff var -> CoeffP (Univariate coeff var) Source #

mulByMonomP :: MonomP (Univariate coeff var) -> Univariate coeff var -> Univariate coeff var Source #

scaleP :: CoeffP (Univariate coeff var) -> Univariate coeff var -> Univariate coeff var Source #

(Ring c, KnownSymbol v) => Ring (Univariate c v) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

type BaseF (Univariate c v) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

type BaseF (Univariate c v) = U v
type CoeffF (Univariate c v) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

type CoeffF (Univariate c v) = c
type CoeffP (Univariate coeff var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

type CoeffP (Univariate coeff var) = coeff
type MonomP (Univariate coeff var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

type MonomP (Univariate coeff var) = U var
type VarP (Univariate coeff var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Univariate

type VarP (Univariate coeff var) = ()

newtype U (var :: Symbol) Source #

A monomial in a univariate polynomial, indexed by its name, eg U "x"

Constructors

U Int 
Instances
Eq (U var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Monomial.Univariate

Methods

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

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

Ord (U var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Monomial.Univariate

Methods

compare :: U var -> U var -> Ordering #

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

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

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

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

max :: U var -> U var -> U var #

min :: U var -> U var -> U var #

Show (U var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Monomial.Univariate

Methods

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

show :: U var -> String #

showList :: [U var] -> ShowS #

Semigroup (U var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Monomial.Univariate

Methods

(<>) :: U var -> U var -> U var #

sconcat :: NonEmpty (U var) -> U var #

stimes :: Integral b => b -> U var -> U var #

Monoid (U var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Monomial.Univariate

Methods

mempty :: U var #

mappend :: U var -> U var -> U var #

mconcat :: [U var] -> U var #

KnownSymbol var => Pretty (U var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Monomial.Univariate

Methods

pretty :: U var -> String Source #

prettyInParens :: U var -> String Source #

KnownSymbol var => Monomial (U var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Monomial.Univariate

Associated Types

type VarM (U var) :: Type Source #

Methods

normalizeM :: U var -> U var Source #

isNormalM :: U var -> Bool Source #

fromListM :: [(VarM (U var), Int)] -> U var Source #

toListM :: U var -> [(VarM (U var), Int)] Source #

emptyM :: U var Source #

isEmptyM :: U var -> Bool Source #

variableM :: VarM (U var) -> U var Source #

singletonM :: VarM (U var) -> Int -> U var Source #

mulM :: U var -> U var -> U var Source #

productM :: [U var] -> U var Source #

powM :: U var -> Int -> U var Source #

divM :: U var -> U var -> Maybe (U var) Source #

diffM :: Num c => VarM (U var) -> Int -> U var -> Maybe (U var, c) Source #

maxDegM :: U var -> Int Source #

totalDegM :: U var -> Int Source #

evalM :: Num c => (VarM (U var) -> c) -> U var -> c Source #

varSubsM :: (VarM (U var) -> VarM (U var)) -> U var -> U var Source #

termSubsM :: Num c => (VarM (U var) -> Maybe c) -> (U var, c) -> (U var, c) Source #

type VarM (U var) Source # 
Instance details

Defined in Math.Algebra.Polynomial.Monomial.Univariate

type VarM (U var) = ()

unUni :: Univariate c v -> FreeMod c (U v) Source #

uniVar :: KnownSymbol var => Univariate c var -> String Source #

Name of the variable

renameUniVar :: Univariate c var1 -> Univariate c var2 Source #

Rename the variable (zero cost)

type ZUni var = Univariate Integer var Source #

An univariate polynomial integer coefficients

type QUni var = Univariate Rational var Source #

An univariate polynomial with rational coefficients

fromZUni :: (Ring c, KnownSymbol v) => Univariate Integer v -> Univariate c v Source #

Change the coefficient ring

fromQUni :: (Field c, KnownSymbol v) => Univariate Rational v -> Univariate c v Source #

Change the coefficient ring

differentiateUni :: (Ring c, KnownSymbol var) => Univariate c var -> Univariate c var Source #

Differentiation

integrateUni :: (Field c, KnownSymbol var) => Univariate c var -> Univariate c var Source #

Integration

integrateUni' :: (Field c, KnownSymbol var) => c -> Univariate c var -> Univariate c var Source #