DoubleExponentialMeshing extends MeshingFunction { @Override public Double evaluate(final Integer i) { if (i < _nPointsLower) { return _lowerMesh.evaluate(i); } return _upperMesh.evaluate(i - _nPointsLower + 1); } DoubleExponentialMeshing(final double lowerBound, final double upperBound, final double centre, final int nPoints, final double lambdaLower, final double lambdaUpper); @Override Double evaluate(final Integer i);  }
@Test public void testEndPoints() { assertEquals(LOWER, MESHER.evaluate(0)); assertEquals(UPPER, MESHER.evaluate(N-1)); double frac = (CENTRE-LOWER) / (UPPER - LOWER); assertEquals(CENTRE, MESHER.evaluate((int) (frac * N)-1)); }
@Test public void testIncreassing() { double vOld = LOWER; for (int i = 1; i < N; i++) { double vNew = MESHER.evaluate(i); assertTrue(vNew > vOld); vOld = vNew; } }
@Test(enabled=false) public void testIncreassingprint() { for (int i = 0; i < N; i++) { double vNew = MESHER.evaluate(i); System.out.println(i+"\t"+vNew); } }