Package gov.nih.mipav.model.algorithms
Class NESolve
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.NESolve
-
- Direct Known Subclasses:
SchwarzChristoffelMapping2.stpfun3
public abstract class NESolve extends java.lang.Object
This is a port of nesolve.m and supporting files coded in MATLAB by Richard T. Behrens in 1988 with portions replaced to be closer to original pseudocode in appendix A of Numerical Methods for Unconstrained Optimization and Nonlinear Equations. NESolve produces the solution to a system of nonlinear equations For example, find the x, y, and z that solve the simultaneous equations: sin(x) + y^2 + log(z) - 7 = 0 3*x + 2^y - z^3 + 1 = 0; x + y + z - 5 = 0 nesolve.m coded in MATLAB by Ricaard T. Behrens, April 1988. Revised 11/278/88 JNL Hookstep option added 8/21/90 RTB. Hello William, Thank you for contacting MathWorks Technical Support. My name is Stephen and I am writing in reference to your Technical Support Case #02445410 regarding 'Permission to port nesolve.m'. Thank you for contacting us about this. It appears that "nesolve" is a File Exchange function that is not part of the MATLAB code base. The author included parts of a MATLAB function help header, but none of its source code. Therefore, we neither grant nor deny permission to copy the contents of that file as it does not pertain to the MATLAB code base. If you have any more related questions, let me know and I would be happy to help. Sincerely, Stephen Jue MathWorks Technical Support Department In a document with the title NONLINPK NESOLVE and UMSOLVE Release 1.1, August 31, 1990 by Richard T. Behrens He states: The UMSOLVE files are distributed as Shareware (but NESOLVE is public domain). nesolve.m is based on Algorithm D6.1.3: Part of the modular software system from the appendix of the book "Numerical Methods for Unconstrained Optimization and Nonlinear Equations" by Dennis & Schnabel, 1983. Refer to that book for more detailed information about the algorithms.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
analyticJacobian
private int
BROWN_ALMOST_LINEAR
protected double[]
btrack
private int
CHEBYQUAD
protected double
chiSquared
protected double[]
details
private double
eps
protected double[]
fparam
private int
FREUDENSTEIN_AND_ROTH
protected double[]
fvc
private int
HELICAL_VALLEY
private int
HOCK1
protected boolean
initialJacobianIdentity
protected int
itncount
private int
LEVMAR_ROSENBROCK
int
LINE_SEARCH
int
NO_SCALING
protected int[]
nofun
private int
nPts
private int
param
protected java.util.Vector<java.lang.Double>
path
private int
POWELL_2_PARAMETER
private int
POWELL_SINGULAR
private int
ROSENBROCK
protected double[][]
scale
int
SCALING_WITH_SCALE
int
SCALING_WITHOUT_SCALE
protected int[]
termcode
private int
testCase
private boolean
testMode
private double
tol
private int
TRIGONOMETRIC
int
TRUST_REGION
protected double[]
x0
protected double[]
xf
-
Constructor Summary
Constructors Constructor Description NESolve()
NESolve(boolean initialJacobianIdentity, double[] x0, double[] fparam, boolean analyticJacobian, double[][] scale, java.util.Vector<java.lang.Double> path, double[] btrack, int trace, int method, int maxIterations, double fvectol, double steptol, double maxStepSize, double details11, int scaling)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
driver()
private void
driverCalls()
void
dumpTestResults()
private void
fitTestModel()
abstract void
fitToFunction(double[] fvplus, double[] xplus, double[] fparam)
abstract void
fitToJacobian(double[][] jc, int[] addfun, double[] x0, double[] fparam)
void
fitToTestFunction(double[] fvplus, double[] xplus, double[] fparam)
void
fitToTestJacobian(double[][] jc, int[] addfun, double[] x0, double[] fparam)
int
getExitStatus()
double[]
getParameters()
private void
nebroyuf(double[][] A, double[] xc, double[] xp, double[] fc, double[] fp, double[] sx, double eta)
private void
nechdcmp(double[][] L, double[] maxadd, double[][] H, double maxoffl)
private double
neconest(double[][] M, double[] M2)
private void
nefdjac(double[][] J, int[] nofun, double[] fc, double[] xc, double[] sx, double[] details, double[] fparam)
private void
nefn(double[] fplus, double[] fvplus, int[] nofun, double[] xplus, double[] sf, double[] fparam)
private void
nehook(int[] retcode, double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, double[] details, double[] trustvars, int[] nofun, double[] xc, double[] fc, double[] g, double[][] L, double[][] H, double[] sn, double[] sx, double[] sf, int itn, double[] fparam)
private void
neinck(double[] dout, double[] sx, double[] sf, int[] termcode, double[] x0, double[] f0, double[] din, double[][] scale)
private void
nelnsrch(int[] retcode, double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, int[] nofun, double[] btrack, double[] xc, double fc, double[] g, double[] p, double[] sx, double[] sf, double[] details, double[] fparam)
private void
nemodel(double[][] m, double[][] h, double[] sn, double[] fc, double[][] J, double[] g, double[] sf, double[] sx, double globmeth)
private void
neqrdcmp(double[][] M, double[] M1, double[] M2, int[] sing)
private void
neqrsolv(double[] b, double[][] M, double[] M1, double[] M2)
private void
nersolv(double[] b, double[][] M, double[] M2)
private void
nestop(int[] consecmax, int[] termcode, double[] xc, double[] xp, double[] F, double[] Fnorm, double[] g, double[] sx, double[] sf, int retcode, double[] details, int itncount, boolean maxtaken)
private void
netrust(double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, int[] retcode, double[] xpprev, double[] fpprev, double[] Fpprev, double[] details, int[] nofun, double[] xc, double[] fc, double[] g, double[][] L, double[] s, double[] sx, double[] sf, boolean newttaken, int steptype, double[][] H, boolean umflag, double[] fparam)
void
printExitStatus(int exitStatus)
private double
shiftedChebyshev(double x, int n)
private double
shiftedChebyshevDerivative(double x, int n)
private double
sign(double x)
-
-
-
Field Detail
-
NO_SCALING
public int NO_SCALING
-
SCALING_WITHOUT_SCALE
public int SCALING_WITHOUT_SCALE
-
SCALING_WITH_SCALE
public int SCALING_WITH_SCALE
-
LINE_SEARCH
public int LINE_SEARCH
-
TRUST_REGION
public int TRUST_REGION
-
x0
protected double[] x0
-
details
protected double[] details
-
initialJacobianIdentity
protected boolean initialJacobianIdentity
-
fparam
protected double[] fparam
-
analyticJacobian
protected boolean analyticJacobian
-
scale
protected double[][] scale
-
xf
protected double[] xf
-
fvc
protected double[] fvc
-
chiSquared
protected double chiSquared
-
termcode
protected int[] termcode
-
path
protected java.util.Vector<java.lang.Double> path
-
btrack
protected double[] btrack
-
nofun
protected int[] nofun
-
itncount
protected int itncount
-
eps
private double eps
-
testMode
private boolean testMode
-
testCase
private int testCase
-
ROSENBROCK
private final int ROSENBROCK
- See Also:
- Constant Field Values
-
FREUDENSTEIN_AND_ROTH
private final int FREUDENSTEIN_AND_ROTH
- See Also:
- Constant Field Values
-
HELICAL_VALLEY
private final int HELICAL_VALLEY
- See Also:
- Constant Field Values
-
POWELL_SINGULAR
private final int POWELL_SINGULAR
- See Also:
- Constant Field Values
-
BROWN_ALMOST_LINEAR
private final int BROWN_ALMOST_LINEAR
- See Also:
- Constant Field Values
-
CHEBYQUAD
private final int CHEBYQUAD
- See Also:
- Constant Field Values
-
LEVMAR_ROSENBROCK
private final int LEVMAR_ROSENBROCK
- See Also:
- Constant Field Values
-
POWELL_2_PARAMETER
private final int POWELL_2_PARAMETER
- See Also:
- Constant Field Values
-
HOCK1
private final int HOCK1
- See Also:
- Constant Field Values
-
TRIGONOMETRIC
private final int TRIGONOMETRIC
- See Also:
- Constant Field Values
-
tol
private double tol
-
param
private int param
-
nPts
private int nPts
-
-
Constructor Detail
-
NESolve
public NESolve()
-
NESolve
public NESolve(boolean initialJacobianIdentity, double[] x0, double[] fparam, boolean analyticJacobian, double[][] scale, java.util.Vector<java.lang.Double> path, double[] btrack, int trace, int method, int maxIterations, double fvectol, double steptol, double maxStepSize, double details11, int scaling)
-
-
Method Detail
-
fitTestModel
private void fitTestModel()
-
driverCalls
private void driverCalls()
-
dumpTestResults
public void dumpTestResults()
-
getParameters
public double[] getParameters()
-
getExitStatus
public int getExitStatus()
-
printExitStatus
public void printExitStatus(int exitStatus)
-
fitToFunction
public abstract void fitToFunction(double[] fvplus, double[] xplus, double[] fparam)
-
fitToTestFunction
public void fitToTestFunction(double[] fvplus, double[] xplus, double[] fparam)
-
fitToJacobian
public abstract void fitToJacobian(double[][] jc, int[] addfun, double[] x0, double[] fparam)
-
fitToTestJacobian
public void fitToTestJacobian(double[][] jc, int[] addfun, double[] x0, double[] fparam)
-
shiftedChebyshev
private double shiftedChebyshev(double x, int n)
-
shiftedChebyshevDerivative
private double shiftedChebyshevDerivative(double x, int n)
-
driver
public void driver()
-
nefn
private void nefn(double[] fplus, double[] fvplus, int[] nofun, double[] xplus, double[] sf, double[] fparam)
-
neinck
private void neinck(double[] dout, double[] sx, double[] sf, int[] termcode, double[] x0, double[] f0, double[] din, double[][] scale)
-
nefdjac
private void nefdjac(double[][] J, int[] nofun, double[] fc, double[] xc, double[] sx, double[] details, double[] fparam)
-
sign
private double sign(double x)
-
nemodel
private void nemodel(double[][] m, double[][] h, double[] sn, double[] fc, double[][] J, double[] g, double[] sf, double[] sx, double globmeth)
-
neqrdcmp
private void neqrdcmp(double[][] M, double[] M1, double[] M2, int[] sing)
-
neconest
private double neconest(double[][] M, double[] M2)
-
nersolv
private void nersolv(double[] b, double[][] M, double[] M2)
-
nechdcmp
private void nechdcmp(double[][] L, double[] maxadd, double[][] H, double maxoffl)
-
neqrsolv
private void neqrsolv(double[] b, double[][] M, double[] M1, double[] M2)
-
nelnsrch
private void nelnsrch(int[] retcode, double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, int[] nofun, double[] btrack, double[] xc, double fc, double[] g, double[] p, double[] sx, double[] sf, double[] details, double[] fparam)
-
nehook
private void nehook(int[] retcode, double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, double[] details, double[] trustvars, int[] nofun, double[] xc, double[] fc, double[] g, double[][] L, double[][] H, double[] sn, double[] sx, double[] sf, int itn, double[] fparam)
-
netrust
private void netrust(double[] xp, double[] fp, double[] Fp, boolean[] maxtaken, int[] retcode, double[] xpprev, double[] fpprev, double[] Fpprev, double[] details, int[] nofun, double[] xc, double[] fc, double[] g, double[][] L, double[] s, double[] sx, double[] sf, boolean newttaken, int steptype, double[][] H, boolean umflag, double[] fparam)
-
nebroyuf
private void nebroyuf(double[][] A, double[] xc, double[] xp, double[] fc, double[] fp, double[] sx, double eta)
-
nestop
private void nestop(int[] consecmax, int[] termcode, double[] xc, double[] xp, double[] F, double[] Fnorm, double[] g, double[] sx, double[] sf, int retcode, double[] details, int itncount, boolean maxtaken)
-
-