Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
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 JArgument_t argument_type
 
typedef JResult_t result_type
 
typedef JFunctional< argument_type, result_typefunctional_type
 

Public Member Functions

void compile (const bool monotone)
 Determination of derivatives.
 
virtual result_type evaluate (const argument_type *pX) const=0
 Recursive function value evaluation.
 
virtual const JExceptionHandler & getExceptionHandler () const=0
 Get exception handler.
 

Static Public Member Functions

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

Protected Member Functions

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

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)
 

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 50 of file JHermiteSpline.hh.

Member Typedef Documentation

◆ collection_type

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

Definition at line 56 of file JHermiteSpline.hh.

◆ abscissa_type

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

Definition at line 58 of file JHermiteSpline.hh.

◆ ordinate_type

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

Definition at line 59 of file JHermiteSpline.hh.

◆ value_type

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

Definition at line 60 of file JHermiteSpline.hh.

◆ distance_type

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

Definition at line 61 of file JHermiteSpline.hh.

◆ const_iterator

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

Definition at line 63 of file JHermiteSpline.hh.

◆ const_reverse_iterator

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

Definition at line 64 of file JHermiteSpline.hh.

◆ iterator

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

Definition at line 65 of file JHermiteSpline.hh.

◆ reverse_iterator

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

Definition at line 66 of file JHermiteSpline.hh.

◆ argument_type

JArgument_t JTOOLS::JFunctional< JArgument_t, JResult_t >::argument_type
inherited

Definition at line 83 of file JFunctional.hh.

◆ result_type

JResult_t JTOOLS::JFunctional< JArgument_t, JResult_t >::result_type
inherited

Definition at line 84 of file JFunctional.hh.

◆ functional_type

JFunctional<argument_type, result_type> JTOOLS::JFunctional< JArgument_t, JResult_t >::functional_type
inherited

Definition at line 85 of file JFunctional.hh.

Constructor & Destructor Documentation

◆ JHermiteSplineCollection()

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 146 of file JHermiteSpline.hh.

147 {}

Member Function Documentation

◆ compile()

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 76 of file JHermiteSpline.hh.

77 {
78 using namespace std;
79
80 if (this->size() >= 2u) {
81
82 {
83 iterator j = this->begin(), i = j++;
84
85 i->setU((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()));
86 }
87
88 {
89 reverse_iterator j = this->rbegin(), i = j++;
90
91 i->setU((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()));
92 }
93
94 for (iterator k = this->begin(), i = k++, j = k++; k != this->end(); ++i, ++j, ++k) {
95 j->setU(0.5 * ((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()) +
96 (k->getY() - j->getY()) / this->getDistance(j->getX(), k->getX())));
97 }
98
99 if (monotone) {
100
101 for (iterator j = this->begin(), i = j++; j != this->end(); ++i, ++j) {
102 if (i->getY() == j->getY()) {
103 j->setU(JMATH::zero);
104 }
105 }
106
107 for (iterator j = this->begin(), i = j++; j != this->end(); ++i, ++j) {
108
109 const ordinate_type u = (j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX());
110 const ordinate_type w = (i->getU()*i->getU() + j->getU()*j->getU());
111
112 if (w > 9.0*u*u) {
113
114 const ordinate_type v = 3.0*u/sqrt(w);
115
116 i->setU(v*i->getU());
117 j->setU(v*j->getU());
118 }
119 }
120 }
121 }
122 }
collection_type::reverse_iterator reverse_iterator
collection_type::ordinate_type ordinate_type
static const JZero zero
Function object to assign zero value.
Definition JZero.hh:105
int j
Definition JPolint.hh:801

◆ h00()

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 127 of file JHermiteSpline.hh.

127{ return (1.0 + 2*t) * (1.0 - t) * (1.0 - t); }

◆ h10()

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 128 of file JHermiteSpline.hh.

128{ return t * (1.0 - t) * (1.0 - t); }

◆ h01()

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 129 of file JHermiteSpline.hh.

129{ return t * t * (3.0 - 2*t); }

◆ h11()

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 130 of file JHermiteSpline.hh.

130{ return t * t * (t - 1.0); }

◆ h00p()

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 132 of file JHermiteSpline.hh.

132{ return 6 * t * (t - 1.0); }

◆ h10p()

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 133 of file JHermiteSpline.hh.

133{ return t * (3*t - 4.0) + 1.0; }

◆ h01p()

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 134 of file JHermiteSpline.hh.

134{ return 6 * t * (1.0 -t); }

◆ h11p()

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 135 of file JHermiteSpline.hh.

135{ return t * (3*t - 2.0); }

◆ H00()

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 137 of file JHermiteSpline.hh.

137{ return t * (t * t * (0.5*t - 1.0) + 1.0); }

◆ H10()

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 138 of file JHermiteSpline.hh.

138{ return t * t * (t * (0.25*t - 2.0/3.0) + 0.5); }

◆ H01()

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 139 of file JHermiteSpline.hh.

139{ return t * t * t * (1.0 - 0.5*t); }

◆ H11()

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 140 of file JHermiteSpline.hh.

140{ return t * t * t * (0.25*t - 1.0/3.0); }

◆ do_compile()

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 153 of file JHermiteSpline.hh.

154 {
155 compile(true);
156 }
void compile(const bool monotone)
Determination of derivatives.

◆ evaluate()

◆ getValue() [1/2]

static result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( const JFunctional<> & function,
const argument_type * pX )
inlinestaticinherited

Recursive function value evaluation.

Parameters
functionfunction
pXpointer to abscissa values

Definition at line 103 of file JFunctional.hh.

105 {
106 return function.evaluate(pX);
107 }

◆ getValue() [2/2]

static JClass< result_type >::argument_type JTOOLS::JFunctional< JArgument_t, JResult_t >::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 117 of file JFunctional.hh.

119 {
120 return value;
121 }

◆ getExceptionHandler()

virtual const JExceptionHandler & JTOOLS::JFunctional< JArgument_t, JResult_t >::getExceptionHandler ( ) const
pure virtualinherited

Get exception handler.

Returns
exception handler

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