Package gov.nih.mipav.model.algorithms
Class NMSimplex
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.NMSimplex
-
public abstract class NMSimplex extends java.lang.ObjectExample public class Objfunc implements Objfun { public double evalObjfun(double x[]){ return (100*(x[1]-x[0]*x[0])*(x[1]-x[0]*x[0])+(1.0-x[0])*(1.0-x[0])); } } public class Constraint implements Constraints { double round2(double num, int precision) { double rnum; int tnum; rnum = num*Math.pow(10,precision); tnum = (int)(rnum < 0 ? rnum-0.5 : rnum + 0.5); rnum = tnum/Math.pow(10,precision); return rnum; } public void getConstrainedValues(double x[], int n) { // round to 2 decimal places int i; for (i=0; i-
-
Field Summary
Fields Modifier and Type Field Description (package private) static doubleALPHA(package private) static doubleBETAprivate booleandisplayprivate doubleEPSILON(package private) static doubleGAMMA(package private) static intMAX_ITprivate intnprivate doublescaleprivate double[]start
-
Constructor Summary
Constructors Constructor Description NMSimplex(double[] start, int n, double EPSILON, double scale, boolean display)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddriver()abstract doubleevalObjfun(double[] x)abstract voidgetConstrainedValues(double[] x, int n)
-
-
-
Field Detail
-
MAX_IT
static final int MAX_IT
- See Also:
- Constant Field Values
-
ALPHA
static final double ALPHA
- See Also:
- Constant Field Values
-
BETA
static final double BETA
- See Also:
- Constant Field Values
-
GAMMA
static final double GAMMA
- See Also:
- Constant Field Values
-
start
private double[] start
-
n
private int n
-
EPSILON
private double EPSILON
-
scale
private double scale
-
display
private boolean display
-
-
-