Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
JTOOLS::JResultPolynome< N, JResult_t > Struct Template Reference

Data structure for result including value and N derivatives of function. More...

#include <JResult.hh>

Inheritance diagram for JTOOLS::JResultPolynome< N, JResult_t >:
JMATH::JMath< JResultPolynome< N, JResult_t > >

Public Types

typedef JLANG::JClass
< JResult_t >::argument_type 
argument_type
 

Public Member Functions

 JResultPolynome ()
 Default constructor. More...
 
JResultPolynomenegate ()
 Prefix unary minus for function value of PDF. More...
 
JResultPolynomeadd (const JResultPolynome &value)
 Addition operator for function value of PDF. More...
 
JResultPolynomesub (const JResultPolynome &value)
 Subtraction operator for function value of PDF. More...
 
JResultPolynomemul (const double value)
 Multiplication operator for function value of PDF. More...
 
JResultPolynomediv (const double value)
 Division operator for function value of PDF. More...
 
double getValue (const double x) const
 Function value. More...
 
double operator() (const double x) const
 Function value. More...
 
JResultPolynome< N, JResult_t > & mul (const JNullType &object)
 Multiply with object. More...
 

Public Attributes

JResult_t y [NUMBER_OF_POINTS]
 values More...
 

Static Public Attributes

static const int NUMBER_OF_POINTS = N + 1
 

Detailed Description

template<unsigned int N, class JResult_t>
struct JTOOLS::JResultPolynome< N, JResult_t >

Data structure for result including value and N derivatives of function.

This data structure contains the following data mambers:

   JResultPolynome::y[0] = function value;
   JResultPolynome::y[i] = ith derivative; 
   JResultPolynome::y[N] = Nth derivative; 

This class implements the JMATH::JMath interface.

Definition at line 407 of file JResult.hh.

Member Typedef Documentation

template<unsigned int N, class JResult_t>
typedef JLANG::JClass<JResult_t>::argument_type JTOOLS::JResultPolynome< N, JResult_t >::argument_type

Definition at line 411 of file JResult.hh.

Constructor & Destructor Documentation

template<unsigned int N, class JResult_t>
JTOOLS::JResultPolynome< N, JResult_t >::JResultPolynome ( )
inline

Default constructor.

Definition at line 419 of file JResult.hh.

420  {
421  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
422  y[i] = JMATH::zero;
423  }
424  }
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:94
static const int NUMBER_OF_POINTS
Definition: JResult.hh:413
JResult_t y[NUMBER_OF_POINTS]
values
Definition: JResult.hh:537

Member Function Documentation

template<unsigned int N, class JResult_t>
JResultPolynome& JTOOLS::JResultPolynome< N, JResult_t >::negate ( )
inline

Prefix unary minus for function value of PDF.

Returns
function value of PDF

Definition at line 432 of file JResult.hh.

433  {
434  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
435  y[i] = -y[i];
436  }
437 
438  return *this;
439  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:413
JResult_t y[NUMBER_OF_POINTS]
values
Definition: JResult.hh:537
template<unsigned int N, class JResult_t>
JResultPolynome& JTOOLS::JResultPolynome< N, JResult_t >::add ( const JResultPolynome< N, JResult_t > &  value)
inline

Addition operator for function value of PDF.

Parameters
valuefunction value of PDF
Returns
function value of PDF

Definition at line 448 of file JResult.hh.

449  {
450  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
451  y[i] += value.y[i];
452  }
453 
454  return *this;
455  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:413
JResult_t y[NUMBER_OF_POINTS]
values
Definition: JResult.hh:537
template<unsigned int N, class JResult_t>
JResultPolynome& JTOOLS::JResultPolynome< N, JResult_t >::sub ( const JResultPolynome< N, JResult_t > &  value)
inline

Subtraction operator for function value of PDF.

Parameters
valuefunction value of PDF
Returns
function value of PDF

Definition at line 464 of file JResult.hh.

465  {
466  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
467  y[i] -= value.y[i];
468  }
469 
470  return *this;
471  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:413
JResult_t y[NUMBER_OF_POINTS]
values
Definition: JResult.hh:537
template<unsigned int N, class JResult_t>
JResultPolynome& JTOOLS::JResultPolynome< N, JResult_t >::mul ( const double  value)
inline

Multiplication operator for function value of PDF.

Parameters
valuemultiplication factor
Returns
function value of PDF

Definition at line 480 of file JResult.hh.

481  {
482  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
483  y[i] *= value;
484  }
485 
486  return *this;
487  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:413
JResult_t y[NUMBER_OF_POINTS]
values
Definition: JResult.hh:537
template<unsigned int N, class JResult_t>
JResultPolynome& JTOOLS::JResultPolynome< N, JResult_t >::div ( const double  value)
inline

Division operator for function value of PDF.

Parameters
valuemultiplication factor
Returns
function value of PDF

Definition at line 496 of file JResult.hh.

497  {
498  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
499  y[i] /= value;
500  }
501 
502  return *this;
503  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:413
JResult_t y[NUMBER_OF_POINTS]
values
Definition: JResult.hh:537
template<unsigned int N, class JResult_t>
double JTOOLS::JResultPolynome< N, JResult_t >::getValue ( const double  x) const
inline

Function value.

Parameters
xabscissa value
Returns
function value

Definition at line 512 of file JResult.hh.

513  {
514  double w = 0.0;
515  double z = 1.0;
516 
517  for (int i = 0; i != NUMBER_OF_POINTS; ++i, z *= x / i) {
518  w += y[i] * z;
519  }
520 
521  return w;
522  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:413
JResult_t y[NUMBER_OF_POINTS]
values
Definition: JResult.hh:537
template<unsigned int N, class JResult_t>
double JTOOLS::JResultPolynome< N, JResult_t >::operator() ( const double  x) const
inline

Function value.

Parameters
xabscissa value
Returns
function value

Definition at line 531 of file JResult.hh.

532  {
533  return getValue(x);
534  }
double getValue(const double x) const
Function value.
Definition: JResult.hh:512
JResultPolynome< N, JResult_t > & JMATH::JMath< JResultPolynome< N, JResult_t > , JNullType >::mul ( const JNullType object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
Auxiliary class for product evaluation of objects.
Definition: JCalculator.hh:18

Member Data Documentation

template<unsigned int N, class JResult_t>
const int JTOOLS::JResultPolynome< N, JResult_t >::NUMBER_OF_POINTS = N + 1
static

Definition at line 413 of file JResult.hh.

template<unsigned int N, class JResult_t>
JResult_t JTOOLS::JResultPolynome< N, JResult_t >::y[NUMBER_OF_POINTS]

values

Definition at line 537 of file JResult.hh.


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