-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Pure Haskell solver routines used by diagrams
--   
--   Pure Haskell solver routines used by the diagrams project. Currently
--   includes finding real roots of low-degree (n < 5) polynomials, and
--   solving tridiagonal and cyclic tridiagonal linear systems.
@package diagrams-solve
@version 0.1.3.1

-- | Exact solving of low-degree (n <= 4) polynomials.
module Diagrams.Solve.Polynomial

-- | The quadratic formula.
quadForm :: (Floating d, Ord d) => d -> d -> d -> [d]

-- | Solve the cubic equation ax^3 + bx^2 + cx + d = 0, returning a list of
--   all real roots within 1e-10 tolerance (although currently it's closer
--   to 1e-5)
cubForm :: (Floating d, Ord d) => d -> d -> d -> d -> [d]

-- | Solve the quartic equation c4 x^4 + c3 x^3 + c2 x^2 + c1 x + c0 = 0,
--   returning a list of all real roots within 1e-10 tolerance (although
--   currently it's closer to 1e-5)
quartForm :: (Floating d, Ord d) => d -> d -> d -> d -> d -> [d]

-- | Solve the cubic equation ax^3 + bx^2 + cx + d = 0, returning a list of
--   all real roots. First argument is tolerance.
cubForm' :: (Floating d, Ord d) => d -> d -> d -> d -> d -> [d]

-- | Solve the quartic equation c4 x^4 + c3 x^3 + c2 x^2 + c1 x + c0 = 0,
--   returning a list of all real roots. First argument is tolerance.
quartForm' :: (Floating d, Ord d) => d -> d -> d -> d -> d -> d -> [d]

-- | Solving of tridiagonal and cyclic tridiagonal linear systems.
module Diagrams.Solve.Tridiagonal

-- | solveTriDiagonal as bs cs ds solves a system of the form
--   A*X = ds where A is an n by n
--   matrix with bs as the main diagonal and as the
--   diagonal below and cs the diagonal above. See:
--   http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
solveTriDiagonal :: Fractional a => [a] -> [a] -> [a] -> [a] -> [a]

-- | Solves a system similar to the tri-diagonal system using a special
--   case of the Sherman-Morrison formula
--   (http://en.wikipedia.org/wiki/Sherman-Morrison_formula). This
--   code is based on Numerical Recpies in C's cyclic
--   function in section 2.7.
solveCyclicTriDiagonal :: Fractional a => [a] -> [a] -> [a] -> [a] -> a -> a -> [a]
