JacobianDirectionFunction implements NewtonRootFinderDirectionFunction { @Override public DoubleMatrix1D getDirection(final DoubleMatrix2D estimate, final DoubleMatrix1D y) { Validate.notNull(estimate); Validate.notNull(y); final DecompositionResult result = _decomposition.evaluate(estimate); return result.solve(y); } JacobianDirectionFunction(final Decomposition<?> decomposition); @Override DoubleMatrix1D getDirection(final DoubleMatrix2D estimate, final DoubleMatrix1D y);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullEstimate() { F.getDirection(null, Y); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullY() { F.getDirection(M, null); }
@Test public void test() { double eps = 1e-9; DoubleMatrix1D direction = F.getDirection(M, Y); assertEquals(direction.getEntry(0), 1. / X0, eps); assertEquals(direction.getEntry(1), 1. / X1, eps); assertEquals(direction.getEntry(2), 1. / X2, eps); }