@Test public void testExceedsVector() throws Exception { Assert.assertTrue(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{0, 3}, false)); Assert.assertTrue(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{2, 0}, false)); Assert.assertTrue(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{0, 2}, true)); Assert.assertTrue(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{1, 0}, true)); Assert.assertFalse(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{0, 1}, false)); Assert.assertFalse(VectorAlgebra.exceedsVector(new double[]{1, 2}, new double[]{1, 2}, false)); }
static boolean exceedsVector(double[] reference, double[] test, boolean orequal) { for (int i = 0; i < reference.length; i++) { if (reference[i] < test[i]) { return true; } if (orequal && reference[i] == test[i]) { return true; } } return false; }
VectorAlgebra { static boolean exceedsVector(double[] reference, double[] test, boolean orequal) { for (int i = 0; i < reference.length; i++) { if (reference[i] < test[i]) { return true; } if (orequal && reference[i] == test[i]) { return true; } } return false; } }
VectorAlgebra { static boolean exceedsVector(double[] reference, double[] test, boolean orequal) { for (int i = 0; i < reference.length; i++) { if (reference[i] < test[i]) { return true; } if (orequal && reference[i] == test[i]) { return true; } } return false; }  }
VectorAlgebra { static boolean exceedsVector(double[] reference, double[] test, boolean orequal) { for (int i = 0; i < reference.length; i++) { if (reference[i] < test[i]) { return true; } if (orequal && reference[i] == test[i]) { return true; } } return false; }   }
VectorAlgebra { static boolean exceedsVector(double[] reference, double[] test, boolean orequal) { for (int i = 0; i < reference.length; i++) { if (reference[i] < test[i]) { return true; } if (orequal && reference[i] == test[i]) { return true; } } return false; }    }