Definition at line 21 of file NaNguard.h.
◆ GradType
◆ PsiValue
◆ checkOneParticleGradients()
void checkOneParticleGradients |
( |
const GradType & |
grads, |
|
|
const std::string_view |
info |
|
) |
| |
|
static |
check if any gradient component (x,y,z) is NaN and throw an error if yes.
- Parameters
-
grads | gradients to be checked |
message | printout to indicate what the issue is. |
Definition at line 29 of file NaNguard.cpp.
References qmcplusplus::dot(), qmcplusplus::isnan(), norm(), and TinyVector< T, D >::size().
Referenced by TrialWaveFunction::calcRatioGrad(), TrialWaveFunction::calcRatioGradWithSpin(), TrialWaveFunction::evalGrad(), TrialWaveFunction::evalGradWithSpin(), TrialWaveFunction::mw_calcRatioGrad(), TrialWaveFunction::mw_evalGrad(), and qmcplusplus::TEST_CASE().
33 std::ostringstream error_message;
34 error_message <<
"NaNguard::checkOneParticleGradients error message: " << info << std::endl;
35 for (
int i = 0; i < grads.size(); ++i)
37 error_message <<
" grads[" << i <<
"] = " << grads[i] << std::endl;
38 throw std::runtime_error(error_message.str());
double norm(const zVec &c)
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
bool isnan(float a)
return true if the value is NaN.
◆ checkOneParticleRatio()
void checkOneParticleRatio |
( |
const PsiValue & |
ratio, |
|
|
const std::string_view |
info |
|
) |
| |
|
static |
The documentation for this class was generated from the following files:
- /home/pk7/projects/qmc/for_cron_doxygen/qmcpack/src/QMCWaveFunctions/NaNguard.h
- /home/pk7/projects/qmc/for_cron_doxygen/qmcpack/src/QMCWaveFunctions/NaNguard.cpp