InverseJacobianDirectionFunction implements NewtonRootFinderDirectionFunction { @Override public DoubleMatrix1D getDirection(final DoubleMatrix2D estimate, final DoubleMatrix1D y) { Validate.notNull(estimate); Validate.notNull(y); return (DoubleMatrix1D) _algebra.multiply(estimate, y); } InverseJacobianDirectionFunction(final MatrixAlgebra algebra); @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), X0, eps); assertEquals(direction.getEntry(1), X1, eps); assertEquals(direction.getEntry(2), X2, eps); }