np-extras-0.3.1.2: NumericPrelude extras

Safe HaskellNone
LanguageHaskell2010

MathObj.MultiVarPolynomial

Contents

Description

Polynomials in a countably infinite set of variables x1, x2, x3, ...

Synopsis

Type

newtype T a Source #

A polynomial is just a list of monomials, construed as their sum. We maintain the invariant that polynomials are always sorted by the ordering on monomials defined in MathObj.Monomial: first by partition degree, then by largest variable index (decreasing), then by exponent of the highest-index variable (decreasing). This works out nicely for operations on cycle index series.

Instances are provided for Additive, Ring, Differential (partial differentiation with respect to x1), and Show.

Constructors

Cons [T a] 
Instances
(C a, C a, Ord a, Show a) => Show (T a) Source # 
Instance details

Defined in MathObj.MultiVarPolynomial

Methods

showsPrec :: Int -> T a -> ShowS #

show :: T a -> String #

showList :: [T a] -> ShowS #

(C a, C a) => C (T a) Source # 
Instance details

Defined in MathObj.MultiVarPolynomial

Methods

differentiate :: T a -> T a #

(C a, C a) => C (T a) Source # 
Instance details

Defined in MathObj.MultiVarPolynomial

Methods

(*) :: T a -> T a -> T a #

one :: T a #

fromInteger :: Integer -> T a #

(^) :: T a -> Integer -> T a #

(C a, C a) => C (T a) Source # 
Instance details

Defined in MathObj.MultiVarPolynomial

Methods

zero :: T a #

(+) :: T a -> T a -> T a #

(-) :: T a -> T a -> T a #

negate :: T a -> T a #

Constructing polynomials

fromMonomials :: [T a] -> T a Source #

lift0 :: [T a] -> T a Source #

lift1 :: ([T a] -> [T a]) -> T a -> T a Source #

lift2 :: ([T a] -> [T a] -> [T a]) -> T a -> T a -> T a Source #

x :: C a => Integer -> T a Source #

Create the polynomial xn for a given n.

constant :: a -> T a Source #

Create a constant polynomial.

Operations

compose :: (C a, C a) => T a -> T a -> T a Source #

Plethyistic substitution: F o G = F(G(x1,x2,x3...), G(x2,x4,x6...), G(x3,x6,x9...), ...) See Bergeron, Labelle, and Leroux, "Combinatorial Species and Tree-Like Structures", p. 43.

merge :: Ord a => Bool -> (a -> a -> a) -> [a] -> [a] -> [a] Source #

Merge two sorted lists, with a flag specifying whether to keep singletons, and a combining function for elements that are equal.