SSAGES  0.8.3
Software Suite for Advanced General Ensemble Simulations
Public Member Functions | Static Public Member Functions | List of all members
SSAGES::Chebyshev Class Reference

Defines the class of Chebyshev polynomials. More...

#include <Basis.h>

Inheritance diagram for SSAGES::Chebyshev:
Inheritance graph
[legend]

Public Member Functions

 Chebyshev (unsigned int polyOrd, double boundLow, double boundUp, unsigned int nbins)
 Constructor. More...
 
double ChangeVariable (double x)
 
double Evaluate (double x, int n)
 Calculates the output of the basis function. More...
 
double EvalGrad (double x, int n)
 Calculates the gradient of the basis function. More...
 
double Weight (double x)
 Calculates the gradient of the basis function. More...
 
double GetNorm (int)
 Gets the norm of the basis function. More...
 
- Public Member Functions inherited from SSAGES::BasisFunction
 BasisFunction (unsigned int polyOrd, unsigned int nbins, bool isFinite, bool zeroOrder, double boundLow, double boundUp)
 Constructor. More...
 
unsigned int GetOrder ()
 Gets the order of the current polynomial.
 
unsigned int GetBins ()
 Gets the number of bins for the discretization.
 
bool GetZeroOrder ()
 Gets the flag for constant-order polynomials.
 
double GetLower ()
 Gets the lower bound on the CV.
 
double GetUpper ()
 Gets the upper bound on the CV.
 
double GetRange ()
 Gets the magnitude of the range of bounds.
 
virtual ~BasisFunction ()
 Destructor.
 

Static Public Member Functions

static ChebyshevBuild (const Json::Value &json, const std::string &path, unsigned int nbins)
 Build the Chebyshev polynomial.
 
- Static Public Member Functions inherited from SSAGES::BasisFunction
static BasisFunctionBuild (const Json::Value &json, const std::string &path, unsigned int nbins)
 Build BasisFunction from JSON value. More...
 

Additional Inherited Members

- Protected Attributes inherited from SSAGES::BasisFunction
unsigned int polyOrd_
 Order of the polynomial.
 
unsigned int nbins_
 Number of bins.
 
bool isFinite_
 Flag for finite-range polynomials.
 
bool zeroOrder_
 Flag for constant-order polynomials.
 
double boundLow_
 Lower bound on CV.
 
double boundUp_
 Upper bound on CV.
 

Detailed Description

Defines the class of Chebyshev polynomials.

Definition at line 183 of file Basis.h.

Constructor & Destructor Documentation

◆ Chebyshev()

SSAGES::Chebyshev::Chebyshev ( unsigned int  polyOrd,
double  boundLow,
double  boundUp,
unsigned int  nbins 
)
inline

Constructor.

Parameters
polyOrdOrder of Chebyshev polynomial.
boundLowLower bounds of restraint springs.
boundUpUpper bounds of restraint springs.
nbinsNumber of bins.

Constructs an instance of the Chebyshev function class.

Definition at line 197 of file Basis.h.

197  :
198  BasisFunction(polyOrd, nbins, true, false, boundLow, boundUp)
199  {
200  }
BasisFunction(unsigned int polyOrd, unsigned int nbins, bool isFinite, bool zeroOrder, double boundLow, double boundUp)
Constructor.
Definition: Basis.h:84

Member Function Documentation

◆ EvalGrad()

double SSAGES::Chebyshev::EvalGrad ( double  val,
int  order 
)
inlinevirtual

Calculates the gradient of the basis function.

Parameters
valInput value for function.
orderOrder of the polynomial.
Returns
Gradient for function.

Reimplemented from SSAGES::BasisFunction.

Definition at line 216 of file Basis.h.

217  {
218  double xMod = ChangeVariable(x);
219  return n == 0 ? 0.0 :
220  n == 1 ? 1.0 :
221  2.0*(Evaluate(x,n-1) + xMod * EvalGrad(x,n-1)) - EvalGrad(x,n-2);
222  }
double EvalGrad(double x, int n)
Calculates the gradient of the basis function.
Definition: Basis.h:216
double Evaluate(double x, int n)
Calculates the output of the basis function.
Definition: Basis.h:208

◆ Evaluate()

double SSAGES::Chebyshev::Evaluate ( double  val,
int  order 
)
inlinevirtual

Calculates the output of the basis function.

Parameters
valInput value for function.
orderOrder of the polynomial.
Returns
Output value for function.

Reimplemented from SSAGES::BasisFunction.

Definition at line 208 of file Basis.h.

209  {
210  double xMod = ChangeVariable(x);
211  return n == 0 ? 1.0 :
212  n == 1 ? xMod :
213  2.0*xMod*Evaluate(x,n-1) - Evaluate(x,n-2);
214  }
double Evaluate(double x, int n)
Calculates the output of the basis function.
Definition: Basis.h:208

◆ GetNorm()

double SSAGES::Chebyshev::GetNorm ( int  order)
inlinevirtual

Gets the norm of the basis function.

Parameters
orderOrder of the polynomial.
Returns
Norm of a specific order of polynomial.

Reimplemented from SSAGES::BasisFunction.

Definition at line 230 of file Basis.h.

231  {
232  return 2.0/M_PI;
233  }

◆ Weight()

double SSAGES::Chebyshev::Weight ( double  val)
inlinevirtual

Calculates the gradient of the basis function.

Parameters
valInput value for function.
Returns
Gradient of function.

Reimplemented from SSAGES::BasisFunction.

Definition at line 224 of file Basis.h.

225  {
226  double xMod = ChangeVariable(x);
227  return 1.0/sqrt(1.0-xMod*xMod);
228  }

The documentation for this class was generated from the following files: