Package gov.nih.mipav.model.algorithms
Class NelderMead
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.NelderMead
-
public abstract class NelderMead extends java.lang.Object
Nelder-Mead original code copyright 2017 by Matteo Maggioni under the MIT Licence. Ported from C to Java by William Gandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
NelderMead.param_t
class
NelderMead.point_t
private class
NelderMead.pointComparator
private class
NelderMead.simplex_t
-
Field Summary
Fields Modifier and Type Field Description private int
ackleyNum
private double
CHI
private int
costNum
private double
GAMMA
private int
max_eval
private int
max_iter
private int
n
private NelderMead.param_t
params
private double
RHO
private boolean
self_test
private double
SIGMA
private NelderMead.point_t
solution
private double
tolf
private double
tolx
private boolean
verbose
private double[]
x
-
Constructor Summary
Constructors Constructor Description NelderMead(int n, double[] x, double tolx, double tolf, int max_iter, int max_eval, boolean verbose)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private boolean
continue_minimization(NelderMead.simplex_t simplex, int eval_count, int iter_count)
private void
copy_point(int n, NelderMead.point_t src, NelderMead.point_t dst)
private void
cost_fun(int n, NelderMead.point_t point, NelderMead.param_t params)
abstract void
cost_function(int n, NelderMead.point_t point)
void
driver()
private void
get_centroid(NelderMead.simplex_t simplex, NelderMead.point_t centroid)
double
getSolValue()
double[]
getSolX()
private void
nelder_mead(NelderMead.point_t start, NelderMead.point_t solution)
private void
simplex_sort(NelderMead.simplex_t simplex)
private double
SQUARE(double x)
private void
swap_points(int n, NelderMead.point_t p1, NelderMead.point_t p2)
private void
update_point(NelderMead.simplex_t simplex, NelderMead.point_t centroid, double lambda, NelderMead.point_t point)
-
-
-
Field Detail
-
RHO
private double RHO
-
CHI
private double CHI
-
GAMMA
private double GAMMA
-
SIGMA
private double SIGMA
-
n
private int n
-
x
private double[] x
-
tolx
private double tolx
-
tolf
private double tolf
-
max_iter
private int max_iter
-
max_eval
private int max_eval
-
verbose
private boolean verbose
-
self_test
private boolean self_test
-
ackleyNum
private final int ackleyNum
- See Also:
- Constant Field Values
-
costNum
private int costNum
-
params
private NelderMead.param_t params
-
solution
private NelderMead.point_t solution
-
-
Method Detail
-
driver
public void driver()
-
getSolX
public double[] getSolX()
-
getSolValue
public double getSolValue()
-
nelder_mead
private void nelder_mead(NelderMead.point_t start, NelderMead.point_t solution)
-
simplex_sort
private void simplex_sort(NelderMead.simplex_t simplex)
-
get_centroid
private void get_centroid(NelderMead.simplex_t simplex, NelderMead.point_t centroid)
-
continue_minimization
private boolean continue_minimization(NelderMead.simplex_t simplex, int eval_count, int iter_count)
-
update_point
private void update_point(NelderMead.simplex_t simplex, NelderMead.point_t centroid, double lambda, NelderMead.point_t point)
-
copy_point
private void copy_point(int n, NelderMead.point_t src, NelderMead.point_t dst)
-
swap_points
private void swap_points(int n, NelderMead.point_t p1, NelderMead.point_t p2)
-
SQUARE
private double SQUARE(double x)
-
cost_fun
private void cost_fun(int n, NelderMead.point_t point, NelderMead.param_t params)
-
cost_function
public abstract void cost_function(int n, NelderMead.point_t point)
-
-