Jpp  master_rocky-40-g5f0272dcd
the software that should make you happy
Public Member Functions | List of all members
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. More...
 
 JSin (const JF1_t &f1)
 Constructor. More...
 
double getValue (const double x) const
 Function value. More...
 
double getDerivative (const double x) const
 Derivative value. More...
 
const JSingetGradient (const double x) const
 Get gradient. More...
 
double operator() (const Args &...args) const
 Function value. More...
 

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  {}
const JPolynome f1(1.0, 2.0, 3.0)
Function.

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  }
double u[N+1]
Definition: JPolint.hh:865

◆ 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  }
data_type v[N+1][M+1]
Definition: JPolint.hh:866

◆ 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  }
Sine of function.
Definition: JMathlib.hh:2224

◆ operator()()

double JMATH::JMathlib< JSin< 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: