QMCPACK
CubicSplineBasisSet< RT > Struct Template Reference
+ Inheritance diagram for CubicSplineBasisSet< RT >:
+ Collaboration diagram for CubicSplineBasisSet< RT >:

Public Types

using FNIN = OptimizableFunctorBase
 typedef of the source functor More...
 
using FNOUT = CubicBspline< RT, LINEAR_1DGRID, FIRSTDERIV_CONSTRAINTS >
 typedef for the argument More...
 
using grid_type = OneDimGridBase< real_type >
 typedef for the grid More...
 
- Public Types inherited from OptimizableFunctorBase
using real_type = optimize::VariableSet::real_type
 typedef for real values More...
 
using opt_variables_type = optimize::VariableSet
 typedef for variableset: this is going to be replaced More...
 

Public Member Functions

 CubicSplineBasisSet ()
 constructor More...
 
 CubicSplineBasisSet (FNIN *in_, grid_type *agrid)
 constructor with arguments More...
 
void setInFunc (FNIN *in_)
 set the input, analytic function More...
 
void setOutFunc (FNOUT *out_)
 set the output numerical function More...
 
void resetParametersExclusive (const opt_variables_type &active) override
 reset the input/output function More...
 
void reset () override
 reset function More...
 
real_type evaluate (real_type r, real_type &dudr, real_type &d2udr2)
 evaluate everything: value, first and second derivatives More...
 
real_type evaluate (real_type r)
 evaluate value only More...
 
real_type f (real_type r) override
 implement the virtual function of OptimizableFunctorBase More...
 
real_type df (real_type r) override
 implement the virtual function of OptimizableFunctorBase More...
 
bool put (xmlNodePtr cur) override
 process xmlnode and registers variables to optimize More...
 
void print (std::ostream &os)
 
void initialize (FNIN *in_, grid_type *agrid)
 set the input, analytic function More...
 
- Public Member Functions inherited from OptimizableFunctorBase
 OptimizableFunctorBase (const std::string &name="")
 default constructor More...
 
virtual ~OptimizableFunctorBase ()=default
 virtual destrutor More...
 
virtual void checkOutVariables (const opt_variables_type &active)=0
 check out variational optimizable variables More...
 
void getIndex (const opt_variables_type &active)
 
virtual OptimizableFunctorBasemakeClone () const =0
 create a clone of this object More...
 
virtual void setDensity (real_type n)
 empty virtual function to help builder classes More...
 
virtual void setCusp (real_type cusp)
 empty virtual function to help builder classes More...
 
virtual void setPeriodic (bool periodic)
 empty virtual function to help builder classes More...
 
virtual bool evaluateDerivatives (real_type r, std::vector< qmcplusplus::TinyVector< real_type, 3 >> &derivs)
 
virtual bool evaluateDerivatives (real_type r, std::vector< real_type > &derivs)
 
virtual void setGridManager (bool willmanage)
 
virtual void checkInVariablesExclusive (opt_variables_type &active)=0
 check in variational parameters to the global list of parameters used by the optimizer. More...
 
virtual void resetParametersExclusive (const opt_variables_type &active)=0
 reset the parameters during optimizations More...
 
- Public Member Functions inherited from OptimizableObject
 OptimizableObject (const std::string &name)
 
const std::string & getName () const
 
bool isOptimized () const
 
virtual void checkInVariablesExclusive (opt_variables_type &active)=0
 check in variational parameters to the global list of parameters used by the optimizer. More...
 
virtual void reportStatus (std::ostream &os)
 print the state, e.g., optimizables More...
 
void setOptimization (bool state)
 
virtual void writeVariationalParameters (hdf_archive &hout)
 Write the variational parameters for this object to the VP HDF file. More...
 
virtual void readVariationalParameters (hdf_archive &hin)
 Read the variational parameters for this object from the VP HDF file. More...
 

Public Attributes

FNINInFunc
 
FNOUTOutFunc
 
int NumGridPoints
 
real_type Rmax
 
real_type GridDelta
 
- Public Attributes inherited from OptimizableFunctorBase
real_type cutoff_radius = 0.0
 maximum cutoff More...
 
opt_variables_type myVars
 set of variables to be optimized More...
 

Detailed Description

template<typename RT>
struct qmcplusplus::CubicSplineBasisSet< RT >

Definition at line 236 of file SplineFunctors.h.

Member Typedef Documentation

◆ FNIN

typedef of the source functor

Definition at line 239 of file SplineFunctors.h.

◆ FNOUT

typedef for the argument

Definition at line 241 of file SplineFunctors.h.

◆ grid_type

typedef for the grid

Definition at line 243 of file SplineFunctors.h.

Constructor & Destructor Documentation

◆ CubicSplineBasisSet() [1/2]

CubicSplineBasisSet ( )
inline

constructor

Definition at line 252 of file SplineFunctors.h.

◆ CubicSplineBasisSet() [2/2]

CubicSplineBasisSet ( FNIN in_,
grid_type agrid 
)
inline

constructor with arguments

Definition at line 254 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::initialize().

254 { initialize(in_, agrid); }
void initialize(FNIN *in_, grid_type *agrid)
set the input, analytic function

Member Function Documentation

◆ df()

real_type df ( real_type  r)
inlineoverridevirtual

implement the virtual function of OptimizableFunctorBase

Implements OptimizableFunctorBase.

Definition at line 294 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::OutFunc, and CubicBspline< T, GRIDTYPE, BC >::splint().

295  {
296  real_type dudr, d2udr2;
297  OutFunc->splint(r, dudr, d2udr2);
298  return dudr;
299  }
value_type splint(T x)
Definition: CubicBspline.h:135
OHMMS_PRECISION real_type

◆ evaluate() [1/2]

real_type evaluate ( real_type  r,
real_type dudr,
real_type d2udr2 
)
inline

evaluate everything: value, first and second derivatives

Definition at line 281 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::OutFunc, and CubicBspline< T, GRIDTYPE, BC >::splint().

282  {
283  return OutFunc->splint(r, dudr, d2udr2);
284  }
value_type splint(T x)
Definition: CubicBspline.h:135

◆ evaluate() [2/2]

real_type evaluate ( real_type  r)
inline

evaluate value only

Definition at line 288 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::OutFunc, and CubicBspline< T, GRIDTYPE, BC >::splint().

288 { return OutFunc->splint(r); }
value_type splint(T x)
Definition: CubicBspline.h:135

◆ f()

real_type f ( real_type  r)
inlineoverridevirtual

implement the virtual function of OptimizableFunctorBase

Implements OptimizableFunctorBase.

Definition at line 291 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::OutFunc, and CubicBspline< T, GRIDTYPE, BC >::splint().

291 { return OutFunc->splint(r); }
value_type splint(T x)
Definition: CubicBspline.h:135

◆ initialize()

void initialize ( FNIN in_,
grid_type agrid 
)
inline

◆ print()

void print ( std::ostream &  os)
inline

Definition at line 303 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::GridDelta, CubicSplineBasisSet< RT >::NumGridPoints, CubicSplineBasisSet< RT >::OutFunc, and CubicBspline< T, GRIDTYPE, BC >::splint().

304  {
305  real_type r = 0;
306  for (int i = 0; i < NumGridPoints; i++, r += GridDelta)
307  os << r << " " << OutFunc->splint(r) << std::endl;
308  }
value_type splint(T x)
Definition: CubicBspline.h:135
OHMMS_PRECISION real_type

◆ put()

bool put ( xmlNodePtr  cur)
inlineoverridevirtual

process xmlnode and registers variables to optimize

Parameters
curxmlNode for a functor

Implements OptimizableFunctorBase.

Definition at line 301 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::InFunc, and OptimizableFunctorBase::put().

301 { return InFunc->put(cur); }
virtual bool put(xmlNodePtr cur)=0
process xmlnode and registers variables to optimize

◆ reset()

void reset ( )
inlineoverridevirtual

reset function

Implements OptimizableFunctorBase.

Definition at line 268 of file SplineFunctors.h.

References OptimizableFunctorBase::df(), OptimizableFunctorBase::f(), CubicSplineBasisSet< RT >::GridDelta, CubicSplineBasisSet< RT >::InFunc, CubicBspline< T, GRIDTYPE, BC >::Init(), CubicSplineBasisSet< RT >::NumGridPoints, CubicSplineBasisSet< RT >::OutFunc, and CubicSplineBasisSet< RT >::Rmax.

Referenced by CubicSplineBasisSet< RT >::initialize(), and CubicSplineBasisSet< RT >::resetParametersExclusive().

269  {
270  if (!OutFunc)
271  OutFunc = new FNOUT;
272  typename FNOUT::container_type datain(NumGridPoints);
273  real_type r = 0;
274  for (int i = 0; i < NumGridPoints; i++, r += GridDelta)
275  datain[i] = InFunc->f(r);
276  OutFunc->Init(0.0, Rmax, datain, true, InFunc->df(0.0), 0.0);
277  }
void Init(point_type start, point_type end, const container_type &datain, bool closed)
Definition: CubicBspline.h:90
virtual real_type f(real_type r)=0
evaluate the value at r
OHMMS_PRECISION real_type
CubicBspline< RT, LINEAR_1DGRID, FIRSTDERIV_CONSTRAINTS > FNOUT
typedef for the argument
virtual real_type df(real_type r)=0
evaluate the first derivative
typename CubicBsplineGrid< T, GRIDTYPE, BC >::container_type container_type
Definition: CubicBspline.h:27

◆ resetParametersExclusive()

void resetParametersExclusive ( const opt_variables_type active)
inlineoverridevirtual

reset the input/output function

Implements OptimizableObject.

Definition at line 260 of file SplineFunctors.h.

References APP_ABORT, CubicSplineBasisSet< RT >::InFunc, CubicSplineBasisSet< RT >::reset(), and OptimizableFunctorBase::resetParametersExclusive().

261  {
262  if (!InFunc)
263  APP_ABORT("CubicSplineBasisSet::resetParameters failed due to null input function ");
265  reset();
266  }
virtual void resetParametersExclusive(const opt_variables_type &active)=0
reset the parameters during optimizations
void reset() override
reset function
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
Definition: AppAbort.h:27

◆ setInFunc()

void setInFunc ( FNIN in_)
inline

set the input, analytic function

Definition at line 256 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::InFunc.

◆ setOutFunc()

void setOutFunc ( FNOUT out_)
inline

set the output numerical function

Definition at line 258 of file SplineFunctors.h.

References CubicSplineBasisSet< RT >::OutFunc.

258 { OutFunc = out_; }

Member Data Documentation

◆ GridDelta

◆ InFunc

◆ NumGridPoints

◆ OutFunc

◆ Rmax


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