public class NewtonRootFinder extends RootFinder
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.util.List<Term>> |
jacobian
The jacobian of the function.
|
static int |
MAX_FIX_ITERATIONS
The maximum number of fixing iterations.
|
static double |
PRECISION
The precision of the approximation.
|
Constructor and Description |
---|
NewtonRootFinder(java.util.List<Term> functions,
java.util.Map<Variable,Term> startingPoint)
Creates a new Newton root finder for the given starting point and the given
(multi-dimensional) function
|
NewtonRootFinder(Term function,
java.util.Map<Variable,Term> startingPoint)
Creates a new Newton root finder for the given starting point and the given function
|
Modifier and Type | Method and Description |
---|---|
private java.util.List<java.lang.Double> |
approximate(java.util.List<java.util.List<java.lang.Double>> currentJacobianValue,
java.util.List<java.lang.Double> currentVector,
java.util.List<java.lang.Double> currentValue)
Solves the linear equation currentJacobianValue * (X-currentVector) = - currentValue.
|
private java.util.List<java.util.List<java.lang.Double>> |
evaluateMatrix(java.util.List<java.util.List<Term>> functions,
java.util.Map<Variable,? extends Term> mapping)
Evaluates each function in the given matrix with
the given values for variables.
|
private java.util.Map<Variable,Term> |
midpoint(java.util.Map<Variable,Term> m1,
java.util.Map<Variable,Term> m2)
Computes the midpoint of the two maps
|
java.util.Map<Variable,Term> |
randomRoot()
Determines the values for the variables appearing in the function such
the function evaluates to zero.
|
getFunctions, getStartingPoint, setStartingPoint
private java.util.List<java.util.List<Term>> jacobian
public static final double PRECISION
public static final int MAX_FIX_ITERATIONS
public NewtonRootFinder(Term function, java.util.Map<Variable,Term> startingPoint)
startingPoint
- public java.util.Map<Variable,Term> randomRoot() throws GeneralMathException
RootFinder
randomRoot
in class RootFinder
GeneralMathException
- if something went wrong.private java.util.Map<Variable,Term> midpoint(java.util.Map<Variable,Term> m1, java.util.Map<Variable,Term> m2)
m1
- m2
- private java.util.List<java.lang.Double> approximate(java.util.List<java.util.List<java.lang.Double>> currentJacobianValue, java.util.List<java.lang.Double> currentVector, java.util.List<java.lang.Double> currentValue) throws GeneralMathException
GeneralMathException