QMCPACK
NaNguard.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2023 QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef QMCPLUSPLUS_NANGUARD_H
14 #define QMCPLUSPLUS_NANGUARD_H
15 
16 #include "Configuration.h"
17 
18 namespace qmcplusplus
19 {
20 
21 class NaNguard
22 {
25 
26 public:
27  /** check if ratio is NaN and throw an error if yes.
28  * @param ratio psi ratio to be checked
29  * @param message printout to indicate what the issue is.
30  */
31  static void checkOneParticleRatio(const PsiValue& ratio, const std::string_view info);
32 
33  /** check if any gradient component (x,y,z) is NaN and throw an error if yes.
34  * @param grads gradients to be checked
35  * @param message printout to indicate what the issue is.
36  */
37  static void checkOneParticleGradients(const GradType& grads, const std::string_view info);
38 };
39 } // namespace qmcplusplus
40 #endif
QMCTraits::QTFull::ValueType PsiValue
Definition: NaNguard.h:23
Fixed-size array.
Definition: OhmmsTinyMeta.h:30
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
QTBase::GradType GradType
Definition: Configuration.h:62
RealType ValueType
Definition: QMCTypes.h:42
static void checkOneParticleRatio(const PsiValue &ratio, const std::string_view info)
check if ratio is NaN and throw an error if yes.
Definition: NaNguard.cpp:18
static void checkOneParticleGradients(const GradType &grads, const std::string_view info)
check if any gradient component (x,y,z) is NaN and throw an error if yes.
Definition: NaNguard.cpp:29