18#ifndef COMPACTFUNCTION_H
19#define COMPACTFUNCTION_H
59#ifndef N2P2_NO_ASYM_POLY
96 double f(
double a)
const;
102 double df(
double a)
const;
109 void fdf(
double a,
double& fa,
double& dfa)
const;
151 return core.
f(std::abs(a));
163 core.
fdf(std::abs(a), fa, dfa);
164 dfa *= copysign(
scale, a);
A general function with compact support.
double width
Width of compact function.
void setCenterWidth(double center, double width)
Set center and width.
double getWidth() const
Getter for width.
void fdf(double a, double &fa, double &dfa) const
Calculate compact function and derivative at once.
void setCoreFunction(CoreFunction::Type const type)
Set type.
double f(double a) const
Compact function .
double center
Center of compact function.
CompactFunction()
Constructor, initializes to #CoreFunction::Type::POLY2.
CoreFunction::Type getCoreFunctionType() const
Getter for #type.
bool getAsymmetric() const
Check if asymmetry is enabled in core function.
void setLeftRight(double left, double right)
Set left and right boundary.
double getLeft() const
Getter for left.
double scale
Inverse width.
double getRight() const
Getter for right.
CoreFunction core
Core function to be used on either side of compact function.
double right
Right boundary of compact function.
double getCenter() const
Getter for center.
double df(double a) const
Derivative of compact function .
double left
Left boundary of compact function.
void setAsymmetric(bool asymmetric)
Set asymmetric property in core function.
void fdf(double x, double &fx, double &dfx) const
Calculate function and derivative at once.
double df(double x) const
Calculate derivative of function at argument .
void setType(Type const type)
Set function type.
Type getType() const
Getter for type.
double f(double x) const
Calculate function value .
Type
List of available function types.