mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 06:11:24 +00:00
Ensure throw with incorrect use of SimplexStyle derivatives
This should ensure that in the case an implementation fails to correctly check isDifferentiable then performs a subsequent derivative based sample, an error is thrown, rather than potentially missing a logic bug due to noise of 0 and derivative of 0 being returned which could otherwise be hard to narrow down.
This commit is contained in:
+2
-2
@@ -116,12 +116,12 @@ public abstract class SimplexStyleSampler extends DerivativeNoiseFunction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double[] getNoiseDerivativeRaw(long seed, double x, double y) {
|
public double[] getNoiseDerivativeRaw(long seed, double x, double y) {
|
||||||
return new double[]{ 0, 0, 0 };
|
throw new UnsupportedOperationException("Implementation failed to check or set isDifferentiable correctly");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double[] getNoiseDerivativeRaw(long seed, double x, double y, double z) {
|
public double[] getNoiseDerivativeRaw(long seed, double x, double y, double z) {
|
||||||
return new double[]{ 0, 0, 0, 0 };
|
throw new UnsupportedOperationException("Implementation failed to check or set isDifferentiable correctly");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user