ResolutionShells: Don't allow zero resolution (calculating 1/d^2 gives NaN)
This commit is contained in:
@@ -12,8 +12,10 @@ ResolutionShells::ResolutionShells(float d_min, float d_max, int32_t nshells)
|
||||
one_over_dmin2(1 / (d_min * d_min)),
|
||||
one_over_dmax2(1 / (d_max * d_max)),
|
||||
nshells(nshells) {
|
||||
if (d_min >= d_max || d_min < 0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Wrong resolution range");
|
||||
if (d_min <= 0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Resolution must be above zero");
|
||||
if (d_min >= d_max)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Reversed resolution bounds");
|
||||
|
||||
if (nshells <= 0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
|
||||
Reference in New Issue
Block a user