CMAESOptimizer extends BaseAbstractMultivariateSimpleBoundsOptimizer<MultivariateFunction> implements MultivariateOptimizer { private static RealMatrix sqrt(final RealMatrix m) { final double[][] d = new double[m.getRowDimension()][m.getColumnDimension()]; for (int r = 0; r < m.getRowDimension(); r++) { for (int c = 0; c < m.getColumnDimension(); c++) { d[r][c] = FastMath.sqrt(m.getEntry(r, c)); } } return new Array2DRowRealMatrix(d, false); } @Deprecated  CMAESOptimizer(); @Deprecated  CMAESOptimizer(int lambda); @Deprecated  CMAESOptimizer(int lambda, double[] inputSigma); @Deprecated  CMAESOptimizer(int lambda, double[] inputSigma,
                          int maxIterations, double stopFitness,
                          boolean isActiveCMA, int diagonalOnly, int checkFeasableCount,
                          RandomGenerator random, boolean generateStatistics); @Deprecated  CMAESOptimizer(int lambda, double[] inputSigma,
                          int maxIterations, double stopFitness,
                          boolean isActiveCMA, int diagonalOnly, int checkFeasableCount,
                          RandomGenerator random, boolean generateStatistics,
                          ConvergenceChecker<PointValuePair> checker);  CMAESOptimizer(int maxIterations,
                          double stopFitness,
                          boolean isActiveCMA,
                          int diagonalOnly,
                          int checkFeasableCount,
                          RandomGenerator random,
                          boolean generateStatistics,
                          ConvergenceChecker<PointValuePair> checker); List<Double> getStatisticsSigmaHistory(); List<RealMatrix> getStatisticsMeanHistory(); List<Double> getStatisticsFitnessHistory(); List<RealMatrix> getStatisticsDHistory(); static final int DEFAULT_CHECKFEASABLECOUNT; static final double DEFAULT_STOPFITNESS; static final boolean DEFAULT_ISACTIVECMA; static final int DEFAULT_MAXITERATIONS; static final int DEFAULT_DIAGONALONLY; static final RandomGenerator DEFAULT_RANDOMGENERATOR; }
@Test public void testRastrigin() { double[] startPoint = point(DIM,0.1); double[] insigma = point(DIM,0.1); double[][] boundaries = null; PointValuePair expected = new PointValuePair(point(DIM,0.0),0.0); doTest(new Rastrigin(), startPoint, insigma, boundaries, GoalType.MINIMIZE, (int)(200*FastMath.sqrt(DIM)), true, 0, 1e-13, 1e-13, 1e-6, 200000, expected); doTest(new Rastrigin(), startPoint, insigma, boundaries, GoalType.MINIMIZE, (int)(200*FastMath.sqrt(DIM)), false, 0, 1e-13, 1e-13, 1e-6, 200000, expected); }