SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.function.polynomial.root
Interface Solver

All Known Implementing Classes:
Cubic, JenkinsTraubReal, Linear, Polyroot, Quadratic, Quartic

public interface Solver

All analytical root finding formulae for polynomials implement this interface.

This interface facilitates the implementation of strategy pattern, hence switching implementations dynamically.


Nested Class Summary
static class Solver.RootFindingException
          RuntimeException thrown when it fails to find a root for a polynomial.
static class Solver.Type
          the type of polynomials the solver can solve
 
Method Summary
 NumberList solve(Polynomial polynomial)
          Compute the roots for a polynomial.
 Solver.Type type()
          Get the type of the solver.
 

Method Detail

type

Solver.Type type()
Get the type of the solver.

Returns:
the solver type

solve

NumberList solve(Polynomial polynomial)
Compute the roots for a polynomial.

Parameters:
polynomial - the polynomial to be solved
Returns:
a list of all roots in Number

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.