throws DimensionMismatchException,
NoDataException,
NullArgumentException {
if (xval == null ||
yval == null) {
throw new NullArgumentException();
}
if (xval.length == 0) {
throw new NoDataException();
}
if (xval.length != yval.length) {
throw new DimensionMismatchException(xval.length, yval.length);
}
if (xval[0] == null) {
throw new NullArgumentException();
}
dimension = xval[0].length;
this.brightnessExponent = brightnessExponent;
// Copy data samples.
samples = new HashMap<RealVector, Double>(yval.length);
for (int i = 0; i < xval.length; ++i) {
final double[] xvalI = xval[i];
if (xvalI == null) {
throw new NullArgumentException();
}
if (xvalI.length != dimension) {
throw new DimensionMismatchException(xvalI.length, dimension);
}