n2p2 - A neural network potential package
|
#include <CoreFunction.h>
Public Types | |
enum class | Type { POLY1 , POLY2 , POLY3 , POLY4 , EXP } |
List of available function types. More... | |
Public Member Functions | |
CoreFunction () | |
Constructor, initializes to #Type::POLY2. More... | |
void | setType (Type const type) |
Set function type. More... | |
Type | getType () const |
Getter for type. More... | |
void | setAsymmetric (bool asymmetric) |
Set asymmetric property. More... | |
bool | getAsymmetric () const |
Getter for asymmetric. More... | |
double | f (double x) const |
Calculate function value \(f(x)\). More... | |
double | df (double x) const |
Calculate derivative of function at argument \(\frac{df(x)}{dx}\). More... | |
void | fdf (double x, double &fx, double &dfx) const |
Calculate function and derivative at once. More... | |
Private Member Functions | |
double | fPOLY1 (double x) const |
double | dfPOLY1 (double x) const |
void | fdfPOLY1 (double x, double &fx, double &dfx) const |
double | fPOLY2 (double x) const |
double | dfPOLY2 (double x) const |
void | fdfPOLY2 (double x, double &fx, double &dfx) const |
double | fPOLY3 (double x) const |
double | dfPOLY3 (double x) const |
void | fdfPOLY3 (double x, double &fx, double &dfx) const |
double | fPOLY4 (double x) const |
double | dfPOLY4 (double x) const |
void | fdfPOLY4 (double x, double &fx, double &dfx) const |
double | fEXP (double x) const |
double | dfEXP (double x) const |
void | fdfEXP (double x, double &fx, double &dfx) const |
Private Attributes | |
Type | type |
Core function type. More... | |
bool | asymmetric |
Enables asymmetry modification (use with polynomials). More... | |
double(CoreFunction::* | fPtr )(double x) const |
Function pointer to f. More... | |
double(CoreFunction::* | dfPtr )(double x) const |
Function pointer to df. More... | |
void(CoreFunction::* | fdfPtr )(double x, double &fx, double &dfx) const |
Function pointer to fdf. More... | |
Static Private Attributes | |
static double const | E = exp(1.0) |
Definition at line 26 of file CoreFunction.h.
|
strong |
List of available function types.
Definition at line 30 of file CoreFunction.h.
CoreFunction::CoreFunction | ( | ) |
Constructor, initializes to #Type::POLY2.
Definition at line 26 of file CoreFunction.cpp.
void CoreFunction::setType | ( | Type const | type | ) |
Set function type.
[in] | type | Type of core function used. |
Definition at line 36 of file CoreFunction.cpp.
References dfEXP(), dfPOLY1(), dfPOLY2(), dfPOLY3(), dfPOLY4(), dfPtr, EXP, fdfEXP(), fdfPOLY1(), fdfPOLY2(), fdfPOLY3(), fdfPOLY4(), fdfPtr, fEXP(), fPOLY1(), fPOLY2(), fPOLY3(), fPOLY4(), fPtr, POLY1, POLY2, POLY3, POLY4, and type.
Referenced by nnp::CompactFunction::CompactFunction(), nnp::CompactFunction::setCoreFunction(), and nnp::CutoffFunction::setCutoffType().
|
inline |
Getter for type.
Definition at line 137 of file CoreFunction.h.
References type.
Referenced by nnp::CompactFunction::getCoreFunctionType().
|
inline |
Set asymmetric property.
[in] | asymmetric | Whether asymmetry should be activated. |
Definition at line 143 of file CoreFunction.h.
References asymmetric.
Referenced by nnp::CompactFunction::setAsymmetric().
|
inline |
Getter for asymmetric.
Definition at line 150 of file CoreFunction.h.
References asymmetric.
Referenced by nnp::CompactFunction::getAsymmetric().
|
inline |
Calculate function value \(f(x)\).
[in] | x | Function argument. |
Definition at line 156 of file CoreFunction.h.
References asymmetric, and fPtr.
Referenced by nnp::CompactFunction::f(), and nnp::CutoffFunction::fCORE().
|
inline |
Calculate derivative of function at argument \(\frac{df(x)}{dx}\).
[in] | x | Function argument. |
Definition at line 164 of file CoreFunction.h.
References asymmetric, and dfPtr.
Referenced by nnp::CompactFunction::df(), and nnp::CutoffFunction::dfCORE().
|
inline |
Calculate function and derivative at once.
[in] | x | Function argument. |
[out] | fx | Function value. |
[out] | dfx | Derivative value. |
Definition at line 174 of file CoreFunction.h.
References asymmetric, and fdfPtr.
Referenced by nnp::CompactFunction::fdf(), and nnp::CutoffFunction::fdfCORE().
|
inlineprivate |
Definition at line 189 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 194 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 199 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 206 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 211 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 216 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 224 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 230 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 235 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 243 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 250 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 257 of file CoreFunction.h.
Referenced by setType().
|
inlineprivate |
Definition at line 268 of file CoreFunction.h.
References E.
Referenced by setType().
|
inlineprivate |
Definition at line 273 of file CoreFunction.h.
References E.
Referenced by setType().
|
inlineprivate |
Definition at line 279 of file CoreFunction.h.
Referenced by setType().
|
staticprivate |
Definition at line 95 of file CoreFunction.h.
|
private |
Core function type.
Definition at line 97 of file CoreFunction.h.
|
private |
Enables asymmetry modification (use with polynomials).
Definition at line 100 of file CoreFunction.h.
Referenced by df(), f(), fdf(), getAsymmetric(), and setAsymmetric().
|
private |
Function pointer to f.
Definition at line 103 of file CoreFunction.h.
|
private |
Function pointer to df.
Definition at line 105 of file CoreFunction.h.
|
private |
Function pointer to fdf.
Definition at line 107 of file CoreFunction.h.