Add getXmax, getXmin, getYmax, getYmin to BicubicInterpolatingFunction.
These can be useful to manage an OutOfRangeException without the need to access the original x and y arrays. Closes #9.
This commit is contained in:
parent
088d0f9222
commit
3ac3ff62b8
|
@ -54,6 +54,11 @@ If the output is not quite correct, check for invisible trailing spaces!
|
||||||
</release>
|
</release>
|
||||||
|
|
||||||
<release version="4.0" date="XXXX-XX-XX" description="">
|
<release version="4.0" date="XXXX-XX-XX" description="">
|
||||||
|
<action dev="luc" type="add" due-to="Lorenzoexe">
|
||||||
|
Add getXmax(), getXmin(), getYmax(), getYmin() to bicubic interpolating function.
|
||||||
|
These can be useful to manage an OutOfRangeException without the need to access
|
||||||
|
the original x and y arrays.
|
||||||
|
</action>
|
||||||
<action dev="luc" type="add" >
|
<action dev="luc" type="add" >
|
||||||
Added mapping functions to MathArrays. These methods allow to map
|
Added mapping functions to MathArrays. These methods allow to map
|
||||||
any univariate or bivariate functions to arrays.
|
any univariate or bivariate functions to arrays.
|
||||||
|
|
|
@ -184,6 +184,38 @@ public class BicubicInterpolatingFunction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the minimum value of the first coordinate
|
||||||
|
* @return xval[0].
|
||||||
|
*/
|
||||||
|
public double getXmin() {
|
||||||
|
return xval[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the maximum value of the second coordinate
|
||||||
|
* @return xval[xval.length - 1].
|
||||||
|
*/
|
||||||
|
public double getXmax() {
|
||||||
|
return xval[xval.length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the minimum value of the second coordinate
|
||||||
|
* @return yval[0].
|
||||||
|
*/
|
||||||
|
public double getYmin() {
|
||||||
|
return yval[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the maximum value of the second coordinate
|
||||||
|
* @return yval[yval.length - 1].
|
||||||
|
*/
|
||||||
|
public double getYmax() {
|
||||||
|
return yval[yval.length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param c Coordinate.
|
* @param c Coordinate.
|
||||||
* @param val Coordinate samples.
|
* @param val Coordinate samples.
|
||||||
|
|
|
@ -160,7 +160,12 @@ public final class BicubicInterpolatingFunctionTest {
|
||||||
try {
|
try {
|
||||||
bcf.value(x, y);
|
bcf.value(x, y);
|
||||||
Assert.fail("OutOfRangeException expected");
|
Assert.fail("OutOfRangeException expected");
|
||||||
} catch (OutOfRangeException expected) {}
|
} catch (OutOfRangeException expected) {
|
||||||
|
Assert.assertEquals(xMin, bcf.getXmin(), 1.0e-15);
|
||||||
|
Assert.assertEquals(xMax, bcf.getXmax(), 1.0e-15);
|
||||||
|
Assert.assertEquals(yMin, bcf.getYmin(), 1.0e-15);
|
||||||
|
Assert.assertEquals(yMax, bcf.getYmax(), 1.0e-15);
|
||||||
|
}
|
||||||
|
|
||||||
x = xMin;
|
x = xMin;
|
||||||
y = yMax + small;
|
y = yMax + small;
|
||||||
|
@ -169,7 +174,12 @@ public final class BicubicInterpolatingFunctionTest {
|
||||||
try {
|
try {
|
||||||
bcf.value(x, y);
|
bcf.value(x, y);
|
||||||
Assert.fail("OutOfRangeException expected");
|
Assert.fail("OutOfRangeException expected");
|
||||||
} catch (OutOfRangeException expected) {}
|
} catch (OutOfRangeException expected) {
|
||||||
|
Assert.assertEquals(xMin, bcf.getXmin(), 1.0e-15);
|
||||||
|
Assert.assertEquals(xMax, bcf.getXmax(), 1.0e-15);
|
||||||
|
Assert.assertEquals(yMin, bcf.getYmin(), 1.0e-15);
|
||||||
|
Assert.assertEquals(yMax, bcf.getYmax(), 1.0e-15);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue