| 4189 | } |
| 4190 | |
| 4191 | void validate_purifiedDistanceIsNormalised(qcomp fid, const char* caller) { |
| 4192 | |
| 4193 | if (isNumericalValidationDisabled()) |
| 4194 | return; |
| 4195 | |
| 4196 | /// @todo include scalars in error message when non-integers are supported |
| 4197 | |
| 4198 | qreal eps = REDUCTION_EPSILON_FACTOR * global_validationEpsilon; |
| 4199 | assertThat(util_isApproxReal(fid, eps), report::CALC_PURIFIED_DISTANCE_NOT_APPROX_REAL, caller); |
| 4200 | assertThat(std::real(fid) <= 1 + eps, report::CALC_PURIFIED_DISTANCE_REAL_EXCEEDED_ONE, caller); |
| 4201 | } |
| 4202 | |
| 4203 | |
| 4204 |
no test coverage detected