Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JMATH::JSin< JF1_t > Struct Template Reference

Sine of function. More...

#include <JMathlib.hh>

Inheritance diagram for JMATH::JSin< JF1_t >:
JMATH::JMathlib< JSin< JF1_t > >

Public Member Functions

 JSin ()
 Default constructor.
 
 JSin (const JF1_t &f1)
 Constructor.
 
double getValue (const double x) const
 Function value.
 
double getDerivative (const double x) const
 Derivative value.
 
const JSingetGradient (const double x) const
 Get gradient.
 
double operator() (const Args &...args) const
 Function value.
 

Detailed Description

template<class JF1_t>
struct JMATH::JSin< JF1_t >

Sine of function.

Definition at line 2221 of file JMathlib.hh.

Constructor & Destructor Documentation

◆ JSin() [1/2]

template<class JF1_t >
JMATH::JSin< JF1_t >::JSin ( )
inline

Default constructor.

Definition at line 2231 of file JMathlib.hh.

2231 :
2232 JF1_t()
2233 {}

◆ JSin() [2/2]

template<class JF1_t >
JMATH::JSin< JF1_t >::JSin ( const JF1_t & f1)
inline

Constructor.

Parameters
f1function

Definition at line 2241 of file JMathlib.hh.

2241 :
2242 JF1_t(f1)
2243 {}

Member Function Documentation

◆ getValue()

template<class JF1_t >
double JMATH::JSin< JF1_t >::getValue ( const double x) const
inline

Function value.

Parameters
xabscissa value
Returns
function value

Definition at line 2252 of file JMathlib.hh.

2253 {
2254 const double u = static_cast<const JF1_t&>(*this).getValue(x);
2255
2256 return sin(u);
2257 }

◆ getDerivative()

template<class JF1_t >
double JMATH::JSin< JF1_t >::getDerivative ( const double x) const
inline

Derivative value.

Parameters
xabscissa value
Returns
derivative value

Definition at line 2266 of file JMathlib.hh.

2267 {
2268 const double u = static_cast<const JF1_t&>(*this).getValue(x);
2269 const double v = static_cast<const JF1_t&>(*this).getDerivative(x);
2270
2271 return v * cos(u);
2272 }

◆ getGradient()

template<class JF1_t >
const JSin & JMATH::JSin< JF1_t >::getGradient ( const double x) const
inline

Get gradient.

Parameters
xabscissa value
Returns
gradient

Definition at line 2281 of file JMathlib.hh.

2282 {
2283 static JSin gradient; // d(f)/d(a)
2284
2285 const double u = static_cast<const JF1_t&>(*this).getValue(x);
2286
2287 static_cast<JF1_t&>(gradient) = static_cast<const JF1_t&>(*this).getGradient(x);
2288 static_cast<JF1_t&>(gradient) *= cos(u);
2289
2290 return gradient;
2291 }
JSin()
Default constructor.
Definition JMathlib.hh:2231

◆ operator()()

double JMATH::JMathlib< JF1_t >::operator() ( const Args &... args) const
inlineinherited

Function value.

Parameters
argsabscissa value(s)
Returns
function value

Definition at line 362 of file JMathlib.hh.

363 {
364 return static_cast<const JF1_t&>(*this).getValue(args...);
365 }

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