species-0.3.1: Computational combinatorial species

Stability experimental byorgey@cis.upenn.edu

Math.Combinatorics.Species.Types

Description

Some common types used by the species library, along with some utility functions.

Synopsis

Miscellaneous

type CycleType = [(Integer, Integer)]Source

A representation of the cycle type of a permutation. If ```c :: CycleType``` and `(k,n) `elem` c`, then the permutation has `n` cycles of size `k`.

Series types

newtype EGF Source

Exponential generating functions, for counting labelled species.

Constructors

 EGF FieldsunEGF :: T Rational

Instances

 Show EGF C EGF C EGF C EGF Species EGF

newtype GF Source

Ordinary generating functions, for counting unlabelled species.

Constructors

 GF (T Integer)

Instances

 Show GF C GF C GF C GF Species GF

liftGF2 :: (T Integer -> T Integer -> T Integer) -> GF -> GF -> GFSource

newtype CycleIndex Source

Cycle index series.

Constructors

 CI (T Rational)

Instances

 Show CycleIndex C CycleIndex C CycleIndex C CycleIndex Species CycleIndex An interpretation of species expressions as cycle index series. For the definition of the `CycleIndex` type, see Math.Combinatorics.Species.Types.

Series utility functions

filterCoeffs :: C a => (Integer -> Bool) -> [a] -> [a]Source

Filter the coefficients of a series according to a predicate.

selectIndex :: (C a, Eq a) => Integer -> [a] -> [a]Source

Set every coefficient of a series to 0 except the selected index. Truncate any trailing zeroes.