species-0.3.4.2: Computational combinatorial species

Copyright(c) Brent Yorgey 2010
LicenseBSD-style (see LICENSE)
Maintainerbyorgey@cis.upenn.edu
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Math.Combinatorics.Species.NewtonRaphson

Description

The Newton-Raphson iterative method for computing with recursive species. Any species T which can be written in the form T = X*R(T) (the species of "R-enriched rooted trees") may be computed by a quadratically converging iterative process. In fact we may also compute species of the form T = N + X*R(T) for any integer species N, by iteratively computing T' = X*R(T' + N) and then adding N.

Synopsis

Documentation

newtonRaphsonIter :: Species s => s -> Integer -> s -> s Source

A single iteration of the Newton-Raphson method. newtonRaphsonIter r k a assumes that a is a species having contact of order k with species t = x * (r ``o`` t) (that is, a and t agree on all label sets of size up to and including k), and returns a new species with contact of order 2k+2 with t.

See BLL section 3.3.

newtonRaphson :: Species s => s -> Integer -> s Source

Given a species r and a desired accuracy k, newtonRaphson r k computes a species which has contact at least k with the species t = x * (r ``o`` t).

newtonRaphsonRec :: (ASTFunctor f, Species s) => f -> Integer -> Maybe s Source

newtonRaphsonRec f k tries to compute the recursive species represented by the code f up to order at least k, using Newton-Raphson iteration. Returns Nothing if f cannot be written in the form f = X*R(f) for some species R.

solveForR :: (ASTFunctor f, Species s) => f -> Maybe (s, s) Source

Given a code f representing a recursive species, try to find an integer species N and species R such that f = N + X*R(f). If such species can be found, return Just (N,R); otherwise return Nothing.