Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t > Class Template Referenceabstract

Template base class spline interpolations. More...

#include <JHermiteSpline.hh>

Inheritance diagram for JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >:
JTOOLS::JFunctional<> JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t > JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t > JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >

Public Types

typedef JCollection_t
< JElement_t, JDistance_t > 
collection_type
 
typedef
collection_type::abscissa_type 
abscissa_type
 
typedef
collection_type::ordinate_type 
ordinate_type
 
typedef collection_type::value_type value_type
 
typedef
collection_type::distance_type 
distance_type
 
typedef
collection_type::const_iterator 
const_iterator
 
typedef
collection_type::const_reverse_iterator 
const_reverse_iterator
 
typedef collection_type::iterator iterator
 
typedef
collection_type::reverse_iterator 
reverse_iterator
 
typedef JNullType argument_type
 
typedef JNullType result_type
 
typedef JFunctional
< argument_type, result_type
functional_type
 
typedef JSupervisor supervisor_type
 

Public Member Functions

void compile (const bool monotone)
 Determination of derivatives. More...
 
virtual result_type evaluate (const argument_type *pX) const =0
 Recursive function value evaluation. More...
 
JSupervisor getSupervisor () const
 Get supervisor. More...
 
const JExceptionHandler & getExceptionHandler () const
 Get exception handler. More...
 
void setExceptionHandler (const JSupervisor &supervisor)
 Set the supervisor for handling of exceptions. More...
 

Static Public Member Functions

static result_type getValue (const JFunctional &function, const argument_type *pX)
 Recursive function value evaluation. More...
 
static JClass< result_type >
::argument_type 
getValue (typename JClass< result_type >::argument_type value, const argument_type *pX)
 Termination of recursive function value evaluation. More...
 

Protected Member Functions

 JHermiteSplineCollection ()
 Default constructor. More...
 
virtual void do_compile () override
 Determination of derivatives. More...
 

Static Protected Member Functions

static abscissa_type h00 (abscissa_type t)
 
static abscissa_type h10 (abscissa_type t)
 
static abscissa_type h01 (abscissa_type t)
 
static abscissa_type h11 (abscissa_type t)
 
static abscissa_type h00p (abscissa_type t)
 
static abscissa_type h10p (abscissa_type t)
 
static abscissa_type h01p (abscissa_type t)
 
static abscissa_type h11p (abscissa_type t)
 
static abscissa_type H00 (abscissa_type t)
 
static abscissa_type H10 (abscissa_type t)
 
static abscissa_type H01 (abscissa_type t)
 
static abscissa_type H11 (abscissa_type t)
 

Protected Attributes

JSupervisor supervisor
 

Detailed Description

template<class JElement_t, template< class, class > class JCollection_t, class JDistance_t>
class JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >

Template base class spline interpolations.

This class implements the JFunctional interface.

Note that the data structure of the elements in the collection should have the additional methods:

    ordinate_type getU() const;
    void setU(ordinate_type u);

to get and set the derivatives, respectively.

Note that -by default- the compilation is for a monotonous interpolation.

Definition at line 47 of file JHermiteSpline.hh.

Member Typedef Documentation

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef JCollection_t<JElement_t, JDistance_t> JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::collection_type

Definition at line 53 of file JHermiteSpline.hh.

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef collection_type::abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::abscissa_type

Definition at line 55 of file JHermiteSpline.hh.

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef collection_type::ordinate_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::ordinate_type

Definition at line 56 of file JHermiteSpline.hh.

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef collection_type::value_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::value_type

Definition at line 57 of file JHermiteSpline.hh.

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef collection_type::distance_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::distance_type

Definition at line 58 of file JHermiteSpline.hh.

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef collection_type::const_iterator JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::const_iterator

Definition at line 60 of file JHermiteSpline.hh.

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef collection_type::const_reverse_iterator JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::const_reverse_iterator

Definition at line 61 of file JHermiteSpline.hh.

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef collection_type::iterator JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::iterator

Definition at line 62 of file JHermiteSpline.hh.

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
typedef collection_type::reverse_iterator JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::reverse_iterator

Definition at line 63 of file JHermiteSpline.hh.

Definition at line 84 of file JFunctional.hh.

Definition at line 87 of file JFunctional.hh.

Definition at line 88 of file JFunctional.hh.

typedef JSupervisor JTOOLS::JFunctional< JNullType , JNullType >::supervisor_type
inherited

Definition at line 89 of file JFunctional.hh.

Constructor & Destructor Documentation

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::JHermiteSplineCollection ( )
inlineprotected

Default constructor.

Definition at line 143 of file JHermiteSpline.hh.

144  {}

Member Function Documentation

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
void JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::compile ( const bool  monotone)
inline

Determination of derivatives.

Parameters
monotonemonotone

Definition at line 73 of file JHermiteSpline.hh.

74  {
75  using namespace std;
76 
77  if (this->size() >= 2u) {
78 
79  {
80  iterator j = this->begin(), i = j++;
81 
82  i->setU((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()));
83  }
84 
85  {
86  reverse_iterator j = this->rbegin(), i = j++;
87 
88  i->setU((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()));
89  }
90 
91  for (iterator k = this->begin(), i = k++, j = k++; k != this->end(); ++i, ++j, ++k) {
92  j->setU(0.5 * ((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()) +
93  (k->getY() - j->getY()) / this->getDistance(j->getX(), k->getX())));
94  }
95 
96  if (monotone) {
97 
98  for (iterator j = this->begin(), i = j++; j != this->end(); ++i, ++j) {
99  if (i->getY() == j->getY()) {
100  j->setU(JMATH::zero);
101  }
102  }
103 
104  for (iterator j = this->begin(), i = j++; j != this->end(); ++i, ++j) {
105 
106  const ordinate_type u = (j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX());
107  const ordinate_type w = (i->getU()*i->getU() + j->getU()*j->getU());
108 
109  if (w > 9.0*u*u) {
110 
111  const ordinate_type v = 3.0*u/sqrt(w);
112 
113  i->setU(v*i->getU());
114  j->setU(v*j->getU());
115  }
116  }
117  }
118  }
119  }
data_type w[N+1][M+1]
Definition: JPolint.hh:867
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
collection_type::reverse_iterator reverse_iterator
collection_type::ordinate_type ordinate_type
int j
Definition: JPolint.hh:792
data_type v[N+1][M+1]
Definition: JPolint.hh:866
double u[N+1]
Definition: JPolint.hh:865
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::h00 ( abscissa_type  t)
inlinestaticprotected

Definition at line 124 of file JHermiteSpline.hh.

124 { return (1.0 + 2*t) * (1.0 - t) * (1.0 - t); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::h10 ( abscissa_type  t)
inlinestaticprotected

Definition at line 125 of file JHermiteSpline.hh.

125 { return t * (1.0 - t) * (1.0 - t); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::h01 ( abscissa_type  t)
inlinestaticprotected

Definition at line 126 of file JHermiteSpline.hh.

126 { return t * t * (3.0 - 2*t); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::h11 ( abscissa_type  t)
inlinestaticprotected

Definition at line 127 of file JHermiteSpline.hh.

127 { return t * t * (t - 1.0); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::h00p ( abscissa_type  t)
inlinestaticprotected

Definition at line 129 of file JHermiteSpline.hh.

129 { return 6 * t * (t - 1.0); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::h10p ( abscissa_type  t)
inlinestaticprotected

Definition at line 130 of file JHermiteSpline.hh.

130 { return t * (3*t - 4.0) + 1.0; }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::h01p ( abscissa_type  t)
inlinestaticprotected

Definition at line 131 of file JHermiteSpline.hh.

131 { return 6 * t * (1.0 -t); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::h11p ( abscissa_type  t)
inlinestaticprotected

Definition at line 132 of file JHermiteSpline.hh.

132 { return t * (3*t - 2.0); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::H00 ( abscissa_type  t)
inlinestaticprotected

Definition at line 134 of file JHermiteSpline.hh.

134 { return t * (t * t * (0.5*t - 1.0) + 1.0); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::H10 ( abscissa_type  t)
inlinestaticprotected

Definition at line 135 of file JHermiteSpline.hh.

135 { return t * t * (t * (0.25*t - 2.0/3.0) + 0.5); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::H01 ( abscissa_type  t)
inlinestaticprotected

Definition at line 136 of file JHermiteSpline.hh.

136 { return t * t * t * (1.0 - 0.5*t); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
static abscissa_type JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::H11 ( abscissa_type  t)
inlinestaticprotected

Definition at line 137 of file JHermiteSpline.hh.

137 { return t * t * t * (0.25*t - 1.0/3.0); }
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
virtual void JTOOLS::JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t >::do_compile ( )
inlineoverrideprotectedvirtual

Determination of derivatives.

Reimplemented in JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >.

Definition at line 150 of file JHermiteSpline.hh.

151  {
152  compile(true);
153  }
void compile(const bool monotone)
Determination of derivatives.
virtual result_type JTOOLS::JFunctional< JNullType , JNullType >::evaluate ( const argument_type pX) const
pure virtualinherited

Recursive function value evaluation.

Parameters
pXpointer to abscissa values
Returns
function value
static result_type JTOOLS::JFunctional< JNullType , JNullType >::getValue ( const JFunctional<> &  function,
const argument_type pX 
)
inlinestaticinherited

Recursive function value evaluation.

Parameters
functionfunction
pXpointer to abscissa values

Definition at line 107 of file JFunctional.hh.

109  {
110  return function.evaluate(pX);
111  }
static JClass<result_type>::argument_type JTOOLS::JFunctional< JNullType , JNullType >::getValue ( typename JClass< result_type >::argument_type  value,
const argument_type pX 
)
inlinestaticinherited

Termination of recursive function value evaluation.

Parameters
valueresult
pXpointer to abscissa values

Definition at line 121 of file JFunctional.hh.

123  {
124  return value;
125  }
JSupervisor JTOOLS::JFunctional< JNullType , JNullType >::getSupervisor ( ) const
inlineinherited

Get supervisor.

Returns
supervisor

Definition at line 281 of file JFunctional.hh.

282  {
283  return supervisor;
284  }
JSupervisor supervisor
Definition: JFunctional.hh:310
const JExceptionHandler& JTOOLS::JFunctional< JNullType , JNullType >::getExceptionHandler ( ) const
inlineinherited

Get exception handler.

Returns
exception handler

Definition at line 292 of file JFunctional.hh.

293  {
294  return *supervisor;
295  }
JSupervisor supervisor
Definition: JFunctional.hh:310
void JTOOLS::JFunctional< JNullType , JNullType >::setExceptionHandler ( const JSupervisor &  supervisor)
inlineinherited

Set the supervisor for handling of exceptions.

Parameters
supervisorsupervisor

Definition at line 303 of file JFunctional.hh.

304  {
305  this->supervisor = supervisor;
306  }
JSupervisor supervisor
Definition: JFunctional.hh:310

Member Data Documentation

JSupervisor JTOOLS::JFunctional< JNullType , JNullType >::supervisor
protectedinherited

Definition at line 310 of file JFunctional.hh.


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