-- 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 &lt; 5) polynomials, and
--   solving tridiagonal and cyclic tridiagonal linear systems.
@package diagrams-solve
@version 0.1


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

-- | <tt>solveTriDiagonal as bs cs ds</tt> solves a system of the form
--   <tt>A*X = ds</tt> where <tt>A</tt> is an <tt>n</tt> by <tt>n</tt>
--   matrix with <tt>bs</tt> as the main diagonal and <tt>as</tt> the
--   diagonal below and <tt>cs</tt> the diagonal above. See:
--   <a>http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm</a>
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
--   (<a>http://en.wikipedia.org/wiki/Sherman-Morrison_formula</a>). This
--   code is based on <i>Numerical Recpies in C</i>'s <tt>cyclic</tt>
--   function in section 2.7.
solveCyclicTriDiagonal :: Fractional a => [a] -> [a] -> [a] -> [a] -> a -> a -> [a]


-- | Exact solving of low-degree (n &lt;= 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]
