21 #ifndef RFFGEN_CMATH_COSINE_HH
22 #define RFFGEN_CMATH_COSINE_HH
25 #include "../Util/base.hh"
26 #include "../Util/chainer.hh"
44 using Chainer<Cos>::operator ();
49 explicit Cos(
double x=0.)
62 double d0() const noexcept {
return cosx; }
66 double d1(
double dx=1.)
const {
return -sinx*dx; }
69 template <
int = -1 ,
int = -1 >
70 double d2(
double dx=1.,
double dy=1.)
const {
return -cosx*dx*dy; }
73 template <
int = -1,
int = -1 ,
int = -1 >
74 double d3(
double dx=1.,
double dy=1.,
double dz=1.)
const {
return sinx*dx*dy*dz; }
84 template <
class Function ,
85 class = std::enable_if_t< std::is_base_of<Base,Function>::value > >
86 auto cos(
const Function& f)
93 #endif // RFFGEN_CMATH_COSINE_HH
double d1(double dx=1.) const
First (directional) derivative.
Definition: cosine.hh:66
Base class for functions satisfying FunctionConcept. Required for enabling the operators in generate...
Definition: base.hh:27
Cosine function including first three derivatives (based on cos(double) in <cmath>).
Definition: cosine.hh:42
double d2(double dx=1., double dy=1.) const
Second (directional) derivative.
Definition: cosine.hh:70
Cos(double x=0.)
Constructor.
Definition: cosine.hh:49
double d3(double dx=1., double dy=1., double dz=1.) const
Third (directional) derivative.
Definition: cosine.hh:74
void update(const double &x)
Reset point of evaluation.
Definition: cosine.hh:55
double d0() const noexcept
Function value.
Definition: cosine.hh:62