MCPcopy Index your code
hub / github.com/WinVector/Logistic / testMax

Method testMax

test/com/winvector/opt/imp/TestOpt.java:78–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 public void testMax() {
79 final QuadFun f = new QuadFun(new double[] {0.2, -.62, 110.1, 11.1},-1.0);
80 final VectorOptimizer[] opts = { new Newton(), new ConjugateGradientOptimizer(), new GradientDescent() };
81 for(final VectorOptimizer opt: opts) {
82 final VEval r = opt.maximize(f, new double[f.x0.length], 10);
83 System.out.println(r);
84 for(int i=0;i<f.x0.length;++i) {
85 assertTrue(Math.abs(r.x[i]-f.x0[i])<0.1);
86 }
87 }
88 }
89
90}

Callers

nothing calls this directly

Calls 1

maximizeMethod · 0.65

Tested by

no test coverage detected