@Override public UnconstrainedMinimization createAlgorithm() { return createAlg(); }
@Test public void wolfeCondition() { UnconMinTrustRegionBFGS_F64 alg = createAlg(); alg.fx = 1; alg.f_prev = 1.1; DMatrixRMaj s = new DMatrixRMaj(new double[][]{{1},{2}}); DMatrixRMaj y = new DMatrixRMaj(new double[][]{{2},{4}}); DMatrixRMaj g = new DMatrixRMaj(new double[][]{{0.1},{0.4}}); assertTrue(alg.wolfeCondition(s,y,g)); // if the change in state is perpendicular to change in gradient it should fail s = new DMatrixRMaj(new double[][]{{1},{2}}); y = new DMatrixRMaj(new double[][]{{2},{-4}}); assertFalse(alg.wolfeCondition(s,y,g)); }