halg-polynomials-0.6.0.0: Polynomial rings and basic Gröbner basis computation, part of halg computational algebra suite.
Safe HaskellNone
LanguageHaskell2010

Algebra.Ring.Polynomial

Synopsis

Documentation

changeOrder :: forall k n o o'. (CoeffRing k, Eq (Monomial n), IsMonomialOrder n o, IsMonomialOrder n o', KnownNat n) => o' -> OrderedPolynomial k o n -> OrderedPolynomial k o' n Source #

newtype OrderedPolynomial r order n Source #

n-ary polynomial ring over some noetherian ring R.

Constructors

Polynomial 

Fields

Instances

Instances details
(IsMonomialOrder n order, CoeffRing r, KnownNat n) => RightModule Integer (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(*.) :: OrderedPolynomial r order n -> Integer -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => RightModule Natural (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(*.) :: OrderedPolynomial r order n -> Natural -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => LeftModule Integer (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(.*) :: Integer -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => LeftModule Natural (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(.*) :: Natural -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => RightModule (Scalar r) (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(*.) :: OrderedPolynomial r order n -> Scalar r -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => LeftModule (Scalar r) (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(.*) :: Scalar r -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

Eq r => Eq (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(==) :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> Bool #

(/=) :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> Bool #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Num (OrderedPolynomial r order n) Source #

We provide Num instance to use trivial injection R into R[X]. Do not use signum or abs.

Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(+) :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

(-) :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

(*) :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

negate :: OrderedPolynomial r order n -> OrderedPolynomial r order n #

abs :: OrderedPolynomial r order n -> OrderedPolynomial r order n #

signum :: OrderedPolynomial r order n -> OrderedPolynomial r order n #

fromInteger :: Integer -> OrderedPolynomial r order n #

(CoeffRing r, IsOrder n ord, Ord r) => Ord (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

compare :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> Ordering #

(<) :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> Bool #

(<=) :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> Bool #

(>) :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> Bool #

(>=) :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> Bool #

max :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

min :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

(KnownNat n, CoeffRing r, IsMonomialOrder n order, PrettyCoeff r) => Show (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

showsPrec :: Int -> OrderedPolynomial r order n -> ShowS #

show :: OrderedPolynomial r order n -> String #

showList :: [OrderedPolynomial r order n] -> ShowS #

(Eq r, DecidableUnits r, DecidableZero r, Field r, IsMonomialOrder 1 ord, ZeroProductSemiring r) => UFD (OrderedPolynomial r ord 1) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

(KnownNat n, Eq r, DecidableUnits r, DecidableZero r, Field r, IsMonomialOrder n ord, ZeroProductSemiring r) => UFD (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial

(Eq r, DecidableUnits r, DecidableZero r, Field r, IsMonomialOrder 1 ord, ZeroProductSemiring r) => PID (OrderedPolynomial r ord 1) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

egcd :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> (OrderedPolynomial r ord 1, OrderedPolynomial r ord 1, OrderedPolynomial r ord 1) #

(Eq r, DecidableUnits r, DecidableZero r, Field r, IsMonomialOrder 1 ord, ZeroProductSemiring r) => GCDDomain (OrderedPolynomial r ord 1) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

gcd :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 #

reduceFraction :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> (OrderedPolynomial r ord 1, OrderedPolynomial r ord 1) #

lcm :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 #

(KnownNat n, Eq r, DecidableUnits r, DecidableZero r, Field r, IsMonomialOrder n ord, ZeroProductSemiring r) => GCDDomain (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial

Methods

gcd :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

reduceFraction :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> (OrderedPolynomial r ord n, OrderedPolynomial r ord n) #

lcm :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

(Eq r, DecidableUnits r, DecidableZero r, KnownNat n, Field r, IsMonomialOrder n ord, ZeroProductSemiring r) => IntegralDomain (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

divides :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> Bool #

maybeQuot :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> Maybe (OrderedPolynomial r ord n) #

(Eq r, DecidableUnits r, DecidableZero r, Field r, IsMonomialOrder 1 ord, ZeroProductSemiring r) => IntegralDomain (OrderedPolynomial r ord 1) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

divides :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> Bool #

maybeQuot :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> Maybe (OrderedPolynomial r ord 1) #

(Eq r, DecidableUnits r, DecidableZero r, Field r, IsMonomialOrder 1 ord, ZeroProductSemiring r) => Euclidean (OrderedPolynomial r ord 1) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

degree :: OrderedPolynomial r ord 1 -> Maybe Natural #

divide :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> (OrderedPolynomial r ord 1, OrderedPolynomial r ord 1) #

quot :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 #

rem :: OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 -> OrderedPolynomial r ord 1 #

(Eq r, DecidableUnits r, DecidableZero r, KnownNat n, Field r, IsMonomialOrder n ord, ZeroProductSemiring r) => ZeroProductSemiring (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

(Eq r, Euclidean r, KnownNat n, IsMonomialOrder n ord) => UnitNormalForm (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

splitUnit :: OrderedPolynomial r ord n -> (OrderedPolynomial r ord n, OrderedPolynomial r ord n) #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Ring (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

fromInteger :: Integer -> OrderedPolynomial r order n

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Rig (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

fromNatural :: Natural -> OrderedPolynomial r order n #

(IsMonomialOrder n ord, Characteristic r, KnownNat n, CoeffRing r) => Characteristic (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

char :: proxy (OrderedPolynomial r ord n) -> Natural #

(CoeffRing r, KnownNat n, IsMonomialOrder n ord) => DecidableZero (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

isZero :: OrderedPolynomial r ord n -> Bool #

(CoeffRing r, IsMonomialOrder n ord, DecidableUnits r, KnownNat n) => DecidableUnits (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

recipUnit :: OrderedPolynomial r ord n -> Maybe (OrderedPolynomial r ord n) #

isUnit :: OrderedPolynomial r ord n -> Bool #

(^?) :: Integral n0 => OrderedPolynomial r ord n -> n0 -> Maybe (OrderedPolynomial r ord n) #

(Eq r, KnownNat n, Euclidean r, IsMonomialOrder n ord) => DecidableAssociates (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

isAssociate :: OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> Bool #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Unital (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

one :: OrderedPolynomial r order n #

pow :: OrderedPolynomial r order n -> Natural -> OrderedPolynomial r order n #

productWith :: Foldable f => (a -> OrderedPolynomial r order n) -> f a -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Commutative (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Semiring (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Multiplicative (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(*) :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

pow1p :: OrderedPolynomial r order n -> Natural -> OrderedPolynomial r order n #

productWith1 :: Foldable1 f => (a -> OrderedPolynomial r order n) -> f a -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Monoidal (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

zero :: OrderedPolynomial r order n #

sinnum :: Natural -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

sumWith :: Foldable f => (a -> OrderedPolynomial r order n) -> f a -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Group (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(-) :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

negate :: OrderedPolynomial r order n -> OrderedPolynomial r order n #

subtract :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

times :: Integral n0 => n0 -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Additive (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(+) :: OrderedPolynomial r order n -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

sinnum1p :: Natural -> OrderedPolynomial r order n -> OrderedPolynomial r order n #

sumWith1 :: Foldable1 f => (a -> OrderedPolynomial r order n) -> f a -> OrderedPolynomial r order n #

(IsMonomialOrder n order, CoeffRing r, KnownNat n) => Abelian (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Hashable r => Hashable (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

hashWithSalt :: Int -> OrderedPolynomial r ord n -> Int #

hash :: OrderedPolynomial r ord n -> Int #

NFData r => NFData (OrderedPolynomial r order n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

rnf :: OrderedPolynomial r order n -> () #

(KnownNat n, IsMonomialOrder n ord, CoeffRing r) => IsPolynomial (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Associated Types

type Coefficient (OrderedPolynomial r ord n) #

type Arity (OrderedPolynomial r ord n) :: Nat #

Methods

liftMap :: (Module (Scalar (Coefficient (OrderedPolynomial r ord n))) alg, Ring alg, Commutative alg) => (Ordinal (Arity (OrderedPolynomial r ord n)) -> alg) -> OrderedPolynomial r ord n -> alg #

subst :: (Ring alg, Commutative alg, Module (Scalar (Coefficient (OrderedPolynomial r ord n))) alg) => Sized (Arity (OrderedPolynomial r ord n)) alg -> OrderedPolynomial r ord n -> alg #

substWith :: Ring m => (Coefficient (OrderedPolynomial r ord n) -> m -> m) -> Sized (Arity (OrderedPolynomial r ord n)) m -> OrderedPolynomial r ord n -> m #

sArity' :: OrderedPolynomial r ord n -> SNat (Arity (OrderedPolynomial r ord n)) #

sArity :: proxy (OrderedPolynomial r ord n) -> SNat (Arity (OrderedPolynomial r ord n)) #

arity :: proxy (OrderedPolynomial r ord n) -> Integer #

injectCoeff :: Coefficient (OrderedPolynomial r ord n) -> OrderedPolynomial r ord n #

injectCoeff' :: proxy (OrderedPolynomial r ord n) -> Coefficient (OrderedPolynomial r ord n) -> OrderedPolynomial r ord n #

monomials :: OrderedPolynomial r ord n -> HashSet (Monomial (Arity (OrderedPolynomial r ord n))) #

terms' :: OrderedPolynomial r ord n -> Map (Monomial (Arity (OrderedPolynomial r ord n))) (Coefficient (OrderedPolynomial r ord n)) #

coeff' :: Monomial (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n -> Coefficient (OrderedPolynomial r ord n) #

constantTerm :: OrderedPolynomial r ord n -> Coefficient (OrderedPolynomial r ord n) #

fromMonomial :: Monomial (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n #

toPolynomial' :: (Coefficient (OrderedPolynomial r ord n), Monomial (Arity (OrderedPolynomial r ord n))) -> OrderedPolynomial r ord n #

polynomial' :: Map (Monomial (Arity (OrderedPolynomial r ord n))) (Coefficient (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n #

totalDegree' :: OrderedPolynomial r ord n -> Int #

var :: Ordinal (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n #

mapCoeff' :: (Coefficient (OrderedPolynomial r ord n) -> Coefficient (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

(>|*) :: Monomial (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

(*|<) :: OrderedPolynomial r ord n -> Monomial (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n #

(!*) :: Coefficient (OrderedPolynomial r ord n) -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

_Terms' :: Iso' (OrderedPolynomial r ord n) (Map (Monomial (Arity (OrderedPolynomial r ord n))) (Coefficient (OrderedPolynomial r ord n))) #

mapMonomial :: (Monomial (Arity (OrderedPolynomial r ord n)) -> Monomial (Arity (OrderedPolynomial r ord n))) -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

(KnownNat n, CoeffRing r, IsMonomialOrder n ord) => IsOrderedPolynomial (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Associated Types

type MOrder (OrderedPolynomial r ord n) #

Methods

coeff :: OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n -> Coefficient (OrderedPolynomial r ord n) #

terms :: OrderedPolynomial r ord n -> Map (OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n))) (Coefficient (OrderedPolynomial r ord n)) #

leadingTerm :: OrderedPolynomial r ord n -> (Coefficient (OrderedPolynomial r ord n), OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n))) #

leadingMonomial :: OrderedPolynomial r ord n -> OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n)) #

leadingCoeff :: OrderedPolynomial r ord n -> Coefficient (OrderedPolynomial r ord n) #

splitLeadingTerm :: OrderedPolynomial r ord n -> (Term (OrderedPolynomial r ord n), OrderedPolynomial r ord n) #

orderedMonomials :: OrderedPolynomial r ord n -> Set (OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n))) #

fromOrderedMonomial :: OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n #

toPolynomial :: (Coefficient (OrderedPolynomial r ord n), OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n))) -> OrderedPolynomial r ord n #

polynomial :: Map (OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n))) (Coefficient (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n #

(>*) :: OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

(*<) :: OrderedPolynomial r ord n -> OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n #

_Terms :: Iso' (OrderedPolynomial r ord n) (Map (OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n))) (Coefficient (OrderedPolynomial r ord n))) #

diff :: Ordinal (Arity (OrderedPolynomial r ord n)) -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

mapMonomialMonotonic :: (OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n)) -> OrderedMonomial (MOrder (OrderedPolynomial r ord n)) (Arity (OrderedPolynomial r ord n))) -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n #

type Arity (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

type Arity (OrderedPolynomial r ord n) = n
type Coefficient (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

type Coefficient (OrderedPolynomial r ord n) = r
type MOrder (OrderedPolynomial r ord n) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

type MOrder (OrderedPolynomial r ord n) = ord

allVars :: forall k ord n. (IsMonomialOrder n ord, CoeffRing k, KnownNat n) => Sized n (OrderedPolynomial k ord n) Source #

substVar :: (CoeffRing r, KnownNat n, IsMonomialOrder n ord, 1 <= n) => Ordinal n -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n -> OrderedPolynomial r ord n Source #

substVar n f substitutes n-th variable with polynomial f, without changing arity.

homogenize :: forall k ord n. (CoeffRing k, KnownNat n, IsMonomialOrder (n + 1) ord, IsMonomialOrder n ord) => OrderedPolynomial k ord n -> OrderedPolynomial k ord (n + 1) Source #

Calculate the homogenized polynomial of given one, with additional variable is the last variable.

unhomogenize :: forall k ord n. (CoeffRing k, KnownNat n, IsMonomialOrder n ord, IsMonomialOrder (n + 1) ord) => OrderedPolynomial k ord (n + 1) -> OrderedPolynomial k ord n Source #

varX :: forall r n order. (CoeffRing r, KnownNat n, IsMonomialOrder n order, 0 < n) => OrderedPolynomial r order n Source #

getTerms :: OrderedPolynomial k order n -> [(k, OrderedMonomial order n)] Source #

shiftR :: forall k r n ord. (CoeffRing r, KnownNat n, IsMonomialOrder n ord, IsMonomialOrder (k + n) ord) => SNat k -> OrderedPolynomial r ord n -> OrderedPolynomial r ord (k + n) Source #

mapCoeff :: (KnownNat n, CoeffRing b, IsMonomialOrder n ord) => (a -> b) -> OrderedPolynomial a ord n -> OrderedPolynomial b ord n Source #

eval :: (CoeffRing r, IsMonomialOrder n order, KnownNat n) => Sized n r -> OrderedPolynomial r order n -> r Source #

Evaluate polynomial at some point.

evalUnivariate :: (CoeffRing b, IsMonomialOrder 1 order) => b -> OrderedPolynomial b order 1 -> b Source #

substUnivariate :: (Module (Scalar r) b, Unital b, CoeffRing r, IsMonomialOrder 1 order) => b -> OrderedPolynomial r order 1 -> b Source #

Substitute univariate polynomial using Horner's rule

class IsOrder (n :: Nat) ordering where #

Class to lookup ordering from its (type-level) name.

Methods

cmpMonomial :: Proxy ordering -> MonomialOrder n #

Instances

Instances details
KnownNat n => IsOrder n Revlex 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Lex 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Grlex 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

KnownNat n => IsOrder n Grevlex 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

IsOrder n ord => IsOrder n (Graded ord) 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

cmpMonomial :: Proxy (Graded ord) -> MonomialOrder n #

(KnownNat n, IsOrder n ord, SingI ws) => IsOrder n (WeightOrder ws ord) 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

cmpMonomial :: Proxy (WeightOrder ws ord) -> MonomialOrder n #

(IsOrder n ord, IsOrder m ord', KnownNat m, KnownNat n, k ~ (n + m)) => IsOrder k (ProductOrder n m ord ord') 
Instance details

Defined in Algebra.Ring.Polynomial.Monomial

Methods

cmpMonomial :: Proxy (ProductOrder n m ord ord') -> MonomialOrder k #

newtype PadPolyL n ord poly Source #

Constructors

PadPolyL 

Fields

Instances

Instances details
(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => RightModule Integer (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(*.) :: PadPolyL n ord poly -> Integer -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => RightModule Natural (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(*.) :: PadPolyL n ord poly -> Natural -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => LeftModule Integer (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(.*) :: Integer -> PadPolyL n ord poly -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => LeftModule Natural (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(.*) :: Natural -> PadPolyL n ord poly -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly, RightModule (Scalar r) poly) => RightModule (Scalar r) (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(*.) :: PadPolyL n ord poly -> Scalar r -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly, LeftModule (Scalar r) poly) => LeftModule (Scalar r) (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(.*) :: Scalar r -> PadPolyL n ord poly -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Eq (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(==) :: PadPolyL n ord poly -> PadPolyL n ord poly -> Bool #

(/=) :: PadPolyL n ord poly -> PadPolyL n ord poly -> Bool #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Num (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(+) :: PadPolyL n ord poly -> PadPolyL n ord poly -> PadPolyL n ord poly #

(-) :: PadPolyL n ord poly -> PadPolyL n ord poly -> PadPolyL n ord poly #

(*) :: PadPolyL n ord poly -> PadPolyL n ord poly -> PadPolyL n ord poly #

negate :: PadPolyL n ord poly -> PadPolyL n ord poly #

abs :: PadPolyL n ord poly -> PadPolyL n ord poly #

signum :: PadPolyL n ord poly -> PadPolyL n ord poly #

fromInteger :: Integer -> PadPolyL n ord poly #

(r ~ Coefficient poly, IsOrderedPolynomial poly, SingI (Replicate n 1), KnownNat n, CoeffRing r, IsMonomialOrder n order, PrettyCoeff r) => Show (PadPolyL n order poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

showsPrec :: Int -> PadPolyL n order poly -> ShowS #

show :: PadPolyL n order poly -> String #

showList :: [PadPolyL n order poly] -> ShowS #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Ring (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

fromInteger :: Integer -> PadPolyL n ord poly

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Rig (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

fromNatural :: Natural -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => DecidableZero (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

isZero :: PadPolyL n ord poly -> Bool #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Unital (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

one :: PadPolyL n ord poly #

pow :: PadPolyL n ord poly -> Natural -> PadPolyL n ord poly #

productWith :: Foldable f => (a -> PadPolyL n ord poly) -> f a -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Commutative (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Semiring (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Multiplicative (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(*) :: PadPolyL n ord poly -> PadPolyL n ord poly -> PadPolyL n ord poly #

pow1p :: PadPolyL n ord poly -> Natural -> PadPolyL n ord poly #

productWith1 :: Foldable1 f => (a -> PadPolyL n ord poly) -> f a -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Monoidal (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

zero :: PadPolyL n ord poly #

sinnum :: Natural -> PadPolyL n ord poly -> PadPolyL n ord poly #

sumWith :: Foldable f => (a -> PadPolyL n ord poly) -> f a -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Group (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(-) :: PadPolyL n ord poly -> PadPolyL n ord poly -> PadPolyL n ord poly #

negate :: PadPolyL n ord poly -> PadPolyL n ord poly #

subtract :: PadPolyL n ord poly -> PadPolyL n ord poly -> PadPolyL n ord poly #

times :: Integral n0 => n0 -> PadPolyL n ord poly -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Additive (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Methods

(+) :: PadPolyL n ord poly -> PadPolyL n ord poly -> PadPolyL n ord poly #

sinnum1p :: Natural -> PadPolyL n ord poly -> PadPolyL n ord poly #

sumWith1 :: Foldable1 f => (a -> PadPolyL n ord poly) -> f a -> PadPolyL n ord poly #

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => Abelian (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

(KnownNat n, IsMonomialOrder n ord, IsPolynomial poly) => IsPolynomial (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Associated Types

type Coefficient (PadPolyL n ord poly) #

type Arity (PadPolyL n ord poly) :: Nat #

Methods

liftMap :: (Module (Scalar (Coefficient (PadPolyL n ord poly))) alg, Ring alg, Commutative alg) => (Ordinal (Arity (PadPolyL n ord poly)) -> alg) -> PadPolyL n ord poly -> alg #

subst :: (Ring alg, Commutative alg, Module (Scalar (Coefficient (PadPolyL n ord poly))) alg) => Sized (Arity (PadPolyL n ord poly)) alg -> PadPolyL n ord poly -> alg #

substWith :: Ring m => (Coefficient (PadPolyL n ord poly) -> m -> m) -> Sized (Arity (PadPolyL n ord poly)) m -> PadPolyL n ord poly -> m #

sArity' :: PadPolyL n ord poly -> SNat (Arity (PadPolyL n ord poly)) #

sArity :: proxy (PadPolyL n ord poly) -> SNat (Arity (PadPolyL n ord poly)) #

arity :: proxy (PadPolyL n ord poly) -> Integer #

injectCoeff :: Coefficient (PadPolyL n ord poly) -> PadPolyL n ord poly #

injectCoeff' :: proxy (PadPolyL n ord poly) -> Coefficient (PadPolyL n ord poly) -> PadPolyL n ord poly #

monomials :: PadPolyL n ord poly -> HashSet (Monomial (Arity (PadPolyL n ord poly))) #

terms' :: PadPolyL n ord poly -> Map (Monomial (Arity (PadPolyL n ord poly))) (Coefficient (PadPolyL n ord poly)) #

coeff' :: Monomial (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly -> Coefficient (PadPolyL n ord poly) #

constantTerm :: PadPolyL n ord poly -> Coefficient (PadPolyL n ord poly) #

fromMonomial :: Monomial (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly #

toPolynomial' :: (Coefficient (PadPolyL n ord poly), Monomial (Arity (PadPolyL n ord poly))) -> PadPolyL n ord poly #

polynomial' :: Map (Monomial (Arity (PadPolyL n ord poly))) (Coefficient (PadPolyL n ord poly)) -> PadPolyL n ord poly #

totalDegree' :: PadPolyL n ord poly -> Int #

var :: Ordinal (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly #

mapCoeff' :: (Coefficient (PadPolyL n ord poly) -> Coefficient (PadPolyL n ord poly)) -> PadPolyL n ord poly -> PadPolyL n ord poly #

(>|*) :: Monomial (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly -> PadPolyL n ord poly #

(*|<) :: PadPolyL n ord poly -> Monomial (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly #

(!*) :: Coefficient (PadPolyL n ord poly) -> PadPolyL n ord poly -> PadPolyL n ord poly #

_Terms' :: Iso' (PadPolyL n ord poly) (Map (Monomial (Arity (PadPolyL n ord poly))) (Coefficient (PadPolyL n ord poly))) #

mapMonomial :: (Monomial (Arity (PadPolyL n ord poly)) -> Monomial (Arity (PadPolyL n ord poly))) -> PadPolyL n ord poly -> PadPolyL n ord poly #

(SingI (Replicate n 1), KnownNat n, IsMonomialOrder n ord, IsOrderedPolynomial poly) => IsOrderedPolynomial (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

Associated Types

type MOrder (PadPolyL n ord poly) #

Methods

coeff :: OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly -> Coefficient (PadPolyL n ord poly) #

terms :: PadPolyL n ord poly -> Map (OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly))) (Coefficient (PadPolyL n ord poly)) #

leadingTerm :: PadPolyL n ord poly -> (Coefficient (PadPolyL n ord poly), OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly))) #

leadingMonomial :: PadPolyL n ord poly -> OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly)) #

leadingCoeff :: PadPolyL n ord poly -> Coefficient (PadPolyL n ord poly) #

splitLeadingTerm :: PadPolyL n ord poly -> (Term (PadPolyL n ord poly), PadPolyL n ord poly) #

orderedMonomials :: PadPolyL n ord poly -> Set (OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly))) #

fromOrderedMonomial :: OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly #

toPolynomial :: (Coefficient (PadPolyL n ord poly), OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly))) -> PadPolyL n ord poly #

polynomial :: Map (OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly))) (Coefficient (PadPolyL n ord poly)) -> PadPolyL n ord poly #

(>*) :: OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly -> PadPolyL n ord poly #

(*<) :: PadPolyL n ord poly -> OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly #

_Terms :: Iso' (PadPolyL n ord poly) (Map (OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly))) (Coefficient (PadPolyL n ord poly))) #

diff :: Ordinal (Arity (PadPolyL n ord poly)) -> PadPolyL n ord poly -> PadPolyL n ord poly #

mapMonomialMonotonic :: (OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly)) -> OrderedMonomial (MOrder (PadPolyL n ord poly)) (Arity (PadPolyL n ord poly))) -> PadPolyL n ord poly -> PadPolyL n ord poly #

type Arity (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

type Arity (PadPolyL n ord poly) = n + Arity poly
type Coefficient (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

type Coefficient (PadPolyL n ord poly) = Coefficient poly
type MOrder (PadPolyL n ord poly) Source # 
Instance details

Defined in Algebra.Ring.Polynomial.Internal

type MOrder (PadPolyL n ord poly) = ProductOrder n (Arity poly) (Graded ord) (MOrder poly)

padLeftPoly :: (IsMonomialOrder n ord, IsPolynomial poly) => SNat n -> ord -> poly -> PadPolyL n ord poly Source #

Orphan instances