QMCPACK
LogGridLight< T > Struct Template Reference
+ Collaboration diagram for LogGridLight< T >:

Public Member Functions

void set (T ri, T rf, int n)
 
int locate (T r) const
 
operator() (int i)
 
getCLForQuintic (T r, int &loc) const
 
int size ()
 

Static Public Member Functions

static T getCL (T r, int &loc, double one_over_log_delta, T lower_bound, double log_delta)
 

Public Attributes

lower_bound
 
upper_bound
 
OneOverLogDelta
 
double LogDelta
 
std::vector< T > r_values
 

Detailed Description

template<typename T>
struct qmcplusplus::LogGridLight< T >

Definition at line 38 of file MultiQuinticSpline1D.h.

Member Function Documentation

◆ getCL()

static T getCL ( r,
int &  loc,
double  one_over_log_delta,
lower_bound,
double  log_delta 
)
inlinestatic

Definition at line 61 of file MultiQuinticSpline1D.h.

References qmcplusplus::exp(), qmcplusplus::log(), and LogGridLight< T >::lower_bound.

Referenced by MultiQuinticSpline1D< T >::batched_evaluate(), and MultiQuinticSpline1D< T >::batched_evaluateVGL().

62  {
63  loc = static_cast<int>(std::log(r / lower_bound) * one_over_log_delta);
64  return r - lower_bound * std::exp(loc * log_delta);
65  }
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnLog, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t log(const Vector< T1, C1 > &l)

◆ getCLForQuintic()

T getCLForQuintic ( r,
int &  loc 
) const
inline

Definition at line 83 of file MultiQuinticSpline1D.h.

References LogGridLight< T >::locate(), and LogGridLight< T >::r_values.

Referenced by qmcplusplus::TEST_CASE().

84  {
85  loc = locate(r);
86  return r - r_values[loc];
87  }

◆ locate()

int locate ( r) const
inline

Definition at line 68 of file MultiQuinticSpline1D.h.

References qmcplusplus::log(), LogGridLight< T >::lower_bound, LogGridLight< T >::OneOverLogDelta, LogGridLight< T >::r_values, and LogGridLight< T >::upper_bound.

Referenced by LogGridLight< T >::getCLForQuintic(), and qmcplusplus::TEST_CASE().

69  {
70  int loc = static_cast<int>(std::log(r / lower_bound) * OneOverLogDelta);
71  if (loc >= r_values.size())
72  throw std::domain_error("r value " + std::to_string(r) + ">=" + std::to_string(upper_bound) + "\n");
73  return loc;
74  }
MakeReturn< UnaryNode< FnLog, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t log(const Vector< T1, C1 > &l)

◆ operator()()

T operator() ( int  i)
inline

Definition at line 76 of file MultiQuinticSpline1D.h.

References LogGridLight< T >::r_values.

77  {
78  //return static_cast<T>(lower_bound*std::exp(i*LogDelta));
79  return r_values[i];
80  }

◆ set()

void set ( ri,
rf,
int  n 
)
inline

Definition at line 46 of file MultiQuinticSpline1D.h.

References qmcplusplus::exp(), qmcplusplus::log(), LogGridLight< T >::LogDelta, LogGridLight< T >::lower_bound, qmcplusplus::n, LogGridLight< T >::OneOverLogDelta, LogGridLight< T >::r_values, and LogGridLight< T >::upper_bound.

Referenced by RadialOrbitalSetBuilder< COT >::find_cutoff(), and qmcplusplus::TEST_CASE().

47  {
48  lower_bound = ri;
49  upper_bound = rf;
50  double ratio = rf / ri;
51  double log_ratio = std::log(ratio);
52  double dlog_ratio = log_ratio / static_cast<double>(n - 1);
53  OneOverLogDelta = 1.0 / dlog_ratio;
54  LogDelta = dlog_ratio;
55  r_values.resize(n);
56  for (int i = 0; i < n; i++)
57  r_values[i] = ri * std::exp(i * dlog_ratio);
58  }
MakeReturn< UnaryNode< FnExp, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t exp(const Vector< T1, C1 > &l)
MakeReturn< UnaryNode< FnLog, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t log(const Vector< T1, C1 > &l)

◆ size()

int size ( void  )
inline

Definition at line 89 of file MultiQuinticSpline1D.h.

References LogGridLight< T >::r_values.

89 { return r_values.size(); }

Member Data Documentation

◆ LogDelta

double LogDelta

Definition at line 43 of file MultiQuinticSpline1D.h.

Referenced by LogGridLight< T >::set().

◆ lower_bound

T lower_bound

◆ OneOverLogDelta

T OneOverLogDelta

Definition at line 42 of file MultiQuinticSpline1D.h.

Referenced by LogGridLight< T >::locate(), and LogGridLight< T >::set().

◆ r_values

◆ upper_bound

T upper_bound

Definition at line 41 of file MultiQuinticSpline1D.h.

Referenced by LogGridLight< T >::locate(), and LogGridLight< T >::set().


The documentation for this struct was generated from the following file: