Jpp  17.2.0
the software that should make you happy
 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< JFirst_t, JSecond_t >

Public Types

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

Public Member Functions

 JResultPolynome ()
 Default constructor. More...
 
 operator JResultDerivative< JResult_t > () const
 Type conversion operator. More...
 
 operator JResultHesse< JResult_t > () const
 Type conversion operator. 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...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 

Public Attributes

JResult_t y [NUMBER_OF_POINTS]
 function and derivative 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 533 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 537 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 545 of file JResult.hh.

546  {
547  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
548  y[i] = JMATH::zero;
549  }
550  }
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687

Member Function Documentation

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

Type conversion operator.

Returns
result

Definition at line 558 of file JResult.hh.

559  {
561  return JResultDerivative<JResult_t>(y[0], y[1]);
562  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687
#define STATIC_CHECK(expr)
Definition: JAssert.hh:31
template<unsigned int N, class JResult_t>
JTOOLS::JResultPolynome< N, JResult_t >::operator JResultHesse< JResult_t > ( ) const
inline

Type conversion operator.

Returns
result

Definition at line 570 of file JResult.hh.

571  {
573  return JResultHesse<JResult_t>(y[0], y[1], y[2]);
574  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687
#define STATIC_CHECK(expr)
Definition: JAssert.hh:31
Data structure for result including value and first derivative of function.
Definition: JResult.hh:212
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 582 of file JResult.hh.

583  {
584  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
585  y[i] = -y[i];
586  }
587 
588  return *this;
589  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687
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 598 of file JResult.hh.

599  {
600  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
601  y[i] += value.y[i];
602  }
603 
604  return *this;
605  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687
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 614 of file JResult.hh.

615  {
616  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
617  y[i] -= value.y[i];
618  }
619 
620  return *this;
621  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687
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 630 of file JResult.hh.

631  {
632  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
633  y[i] *= value;
634  }
635 
636  return *this;
637  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687
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 646 of file JResult.hh.

647  {
648  for (int i = 0; i != NUMBER_OF_POINTS; ++i) {
649  y[i] /= value;
650  }
651 
652  return *this;
653  }
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687
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 662 of file JResult.hh.

663  {
664  double w = 0.0;
665  double z = 1.0;
666 
667  for (int i = 0; i != NUMBER_OF_POINTS; ++i, z *= x / i) {
668  w += y[i] * z;
669  }
670 
671  return w;
672  }
data_type w[N+1][M+1]
Definition: JPolint.hh:778
static const int NUMBER_OF_POINTS
Definition: JResult.hh:539
JResult_t y[NUMBER_OF_POINTS]
function and derivative values
Definition: JResult.hh:687
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 681 of file JResult.hh.

682  {
683  return getValue(x);
684  }
double getValue(const double x) const
Function value.
Definition: JResult.hh:662
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 354 of file JMath.hh.

355  {
356  return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357  }

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 539 of file JResult.hh.

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

function and derivative values

Definition at line 687 of file JResult.hh.


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