CubicSplineBase Class ReferenceΒΆ

Splines: Splines::CubicSplineBase Class Reference
Splines
Splines::CubicSplineBase Class Reference

#include <Splines.hh>

Inheritance diagram for Splines::CubicSplineBase:
Splines::Spline Splines::AkimaSpline Splines::BesselSpline Splines::CubicSpline Splines::HermiteSpline Splines::PchipSpline

Public Member Functions

void copy_spline (CubicSplineBase const &S)
 
real_type yp_node (integer i) const
 
void set_range (real_type xmin, real_type xmax)
 
void reserve_external (integer n, real_type *&p_x, real_type *&p_y, real_type *&p_dy)
 
void y_min_max (integer &i_min_pos, real_type &x_min_pos, real_type &y_min, integer &i_max_pos, real_type &x_max_pos, real_type &y_max) const override
 
void y_min_max (vector< integer > &i_min_pos, vector< real_type > &x_min_pos, vector< real_type > &y_min, vector< integer > &i_max_pos, vector< real_type > &x_max_pos, vector< real_type > &y_max) const override
 
void write_to_stream (ostream_type &s) const override
 
void clear () override
 
integer coeffs (real_type cfs[], real_type nodes[], bool transpose=false) const override
 
integer order () const override
 
Contructors/Destructors
 CubicSplineBase (string const &name="CubicSplineBase")
 
Evaluation
real_type eval (real_type x) const override
 
real_type D (real_type x) const override
 
real_type DD (real_type x) const override
 
real_type DDD (real_type x) const override
 
real_type DDDD (real_type) const override
 
real_type DDDDD (real_type) const override
 
Evaluation when segment is known
real_type id_eval (integer ni, real_type x) const override
 
real_type id_D (integer ni, real_type x) const override
 
real_type id_DD (integer ni, real_type x) const override
 
real_type id_DDD (integer ni, real_type x) const override
 
real_type id_DDDD (integer, real_type) const override
 
real_type id_DDDDD (integer, real_type) const override
 
Build
void build (real_type const x[], integer incx, real_type const y[], integer incy, real_type const yp[], integer incyp, integer n)
 
void build (real_type const x[], real_type const y[], real_type const yp[], integer n)
 
void build (vector< real_type > const &x, vector< real_type > const &y, vector< real_type > const &yp)
 
void reserve (integer npts) override
 
- Public Member Functions inherited from Splines::Spline
void search (std::pair< integer, real_type > &res) const
 
 Spline (string const &name="Spline")
 
virtual ~Spline ()
 
string const & name () const
 
bool is_closed () const
 
void make_closed ()
 
void make_opened ()
 
bool is_bounded () const
 
void make_unbounded ()
 
void make_bounded ()
 
bool is_extended_constant () const
 
void make_extended_constant ()
 
void make_extended_not_constant ()
 
integer num_points () const
 
real_type x_node (integer i) const
 
real_type y_node (integer i) const
 
real_type x_begin () const
 
real_type y_begin () const
 
real_type x_end () const
 
real_type y_end () const
 
real_type x_min () const
 
real_type x_max () const
 
real_type y_min () const
 
real_type y_max () const
 
void build (GenericContainer const &gc)
 
virtual void build (real_type const x[], integer incx, real_type const y[], integer incy, integer n)
 
void build (real_type const x[], real_type const y[], integer n)
 
void build (vector< real_type > const &x, vector< real_type > const &y)
 
virtual void build ()=0
 
virtual void setup (GenericContainer const &gc)
 
void push_back (real_type x, real_type y)
 
void drop_back ()
 
void set_origin (real_type x0)
 
void set_range (real_type xmin, real_type xmax)
 
void dump (ostream_type &s, integer nintervals, char const header[]="x\ty") const
 
void dump (char const fname[], integer nintervals, char const header[]="x\ty") const
 
real_type operator() (real_type x) const
 
real_type eval_D (real_type x) const
 
real_type eval_DD (real_type x) const
 
real_type eval_DDD (real_type x) const
 
real_type eval_DDDD (real_type x) const
 
real_type eval_DDDDD (real_type x) const
 
char const * type_name () const
 
virtual SplineType1D type () const =0
 
string info () const
 
void info (ostream_type &stream) const
 

Detailed Description

cubic spline base class

Constructor & Destructor Documentation

◆ CubicSplineBase()

Splines::CubicSplineBase::CubicSplineBase ( string const & name = "CubicSplineBase")

Spline constructor.

Member Function Documentation

◆ build() [1/3]

void Splines::CubicSplineBase::build ( real_type const x[],
integer incx,
real_type const y[],
integer incy,
real_type const yp[],
integer incyp,
integer n )

Build a spline.

Parameters
[in]xvector of x-coordinates
[in]incxaccess elements as x[0], x[incx], x[2*incx],...
[in]yvector of y-coordinates
[in]incyaccess elements as y[0], y[incy], y[2*incy],...
[in]ypvector of y-defivative
[in]incypaccess elements as yp[0], yp[incyp], yp[2*incyy],...
[in]ntotal number of points

◆ build() [2/3]

void Splines::CubicSplineBase::build ( real_type const x[],
real_type const y[],
real_type const yp[],
integer n )
inline

Build a spline.

Parameters
[in]xvector of x-coordinates
[in]yvector of y-coordinates
[in]ypvector of y'-coordinates
[in]ntotal number of points

◆ build() [3/3]

void Splines::CubicSplineBase::build ( vector< real_type > const & x,
vector< real_type > const & y,
vector< real_type > const & yp )

Build a spline.

Parameters
[in]xvector of x-coordinates
[in]yvector of y-coordinates
[in]ypvector of y'-coordinates

◆ clear()

void Splines::CubicSplineBase::clear ( )
overridevirtual

Delete the support points, empty the spline.

Implements Splines::Spline.

◆ coeffs()

integer Splines::CubicSplineBase::coeffs ( real_type cfs[],
real_type nodes[],
bool transpose = false ) const
overridevirtual

get the piecewise polinomials of the spline

Implements Splines::Spline.

◆ copy_spline()

void Splines::CubicSplineBase::copy_spline ( CubicSplineBase const & S)

Build a copy of spline S

◆ D()

real_type Splines::CubicSplineBase::D ( real_type x) const
overridevirtual

First derivative

Implements Splines::Spline.

◆ DD()

real_type Splines::CubicSplineBase::DD ( real_type x) const
overridevirtual

Second derivative

Implements Splines::Spline.

◆ DDD()

real_type Splines::CubicSplineBase::DDD ( real_type x) const
overridevirtual

Third derivative

Implements Splines::Spline.

◆ DDDD()

real_type Splines::CubicSplineBase::DDDD ( real_type ) const
inlineoverridevirtual

4th derivative

Reimplemented from Splines::Spline.

◆ DDDDD()

real_type Splines::CubicSplineBase::DDDDD ( real_type ) const
inlineoverridevirtual

5th derivative

Reimplemented from Splines::Spline.

◆ eval()

real_type Splines::CubicSplineBase::eval ( real_type x) const
overridevirtual

Evaluate spline value

Implements Splines::Spline.

◆ id_D()

real_type Splines::CubicSplineBase::id_D ( integer ni,
real_type x ) const
overridevirtual

First derivative

Implements Splines::Spline.

◆ id_DD()

real_type Splines::CubicSplineBase::id_DD ( integer ni,
real_type x ) const
overridevirtual

Second derivative

Implements Splines::Spline.

◆ id_DDD()

real_type Splines::CubicSplineBase::id_DDD ( integer ni,
real_type x ) const
overridevirtual

Third derivative

Implements Splines::Spline.

◆ id_DDDD()

real_type Splines::CubicSplineBase::id_DDDD ( integer ,
real_type  ) const
inlineoverridevirtual

4th derivative

Reimplemented from Splines::Spline.

◆ id_DDDDD()

real_type Splines::CubicSplineBase::id_DDDDD ( integer ,
real_type  ) const
inlineoverridevirtual

5th derivative

Reimplemented from Splines::Spline.

◆ id_eval()

real_type Splines::CubicSplineBase::id_eval ( integer ni,
real_type x ) const
overridevirtual

Evaluate spline value

Implements Splines::Spline.

◆ order()

integer Splines::CubicSplineBase::order ( ) const
overridevirtual

Spline order of the piecewise polynomial

Implements Splines::Spline.

◆ reserve()

void Splines::CubicSplineBase::reserve ( integer npts)
overridevirtual

Allocate memory for npts points

Implements Splines::Spline.

◆ reserve_external()

void Splines::CubicSplineBase::reserve_external ( integer n,
real_type *& p_x,
real_type *& p_y,
real_type *& p_dy )

Use externally allocated memory for npts points.

◆ set_range()

void Splines::CubicSplineBase::set_range ( real_type xmin,
real_type xmax )

Change X-range of the spline.

◆ write_to_stream()

void Splines::CubicSplineBase::write_to_stream ( ostream_type & s) const
overridevirtual

Print spline coefficients

Implements Splines::Spline.

◆ y_min_max() [1/2]

void Splines::CubicSplineBase::y_min_max ( integer & i_min_pos,
real_type & x_min_pos,
real_type & y_min,
integer & i_max_pos,
real_type & x_max_pos,
real_type & y_max ) const
overridevirtual

Search the max and min values of y along the spline with the corresponding x position

Parameters
[out]i_min_posinterval where is the minimum
[out]x_min_poswhere is the minimum
[out]y_minthe minimum value
[out]i_max_posinterval where is the maximum
[out]x_max_poswhere is the maximum
[out]y_maxthe maximum value

Reimplemented from Splines::Spline.

◆ y_min_max() [2/2]

void Splines::CubicSplineBase::y_min_max ( vector< integer > & i_min_pos,
vector< real_type > & x_min_pos,
vector< real_type > & y_min,
vector< integer > & i_max_pos,
vector< real_type > & x_max_pos,
vector< real_type > & y_max ) const
overridevirtual

Search the max and min values of y along the spline with the corresponding x position

Parameters
[out]i_min_posinterval where is the minimum
[out]x_min_poswhere is the minimum
[out]y_minthe minimum value
[out]i_max_posinterval where is the maximum
[out]x_max_poswhere is the maximum
[out]y_maxthe maximum value

Reimplemented from Splines::Spline.

◆ yp_node()

real_type Splines::CubicSplineBase::yp_node ( integer i) const
inline

Return the i-th node of the spline (y' component).


The documentation for this class was generated from the following file:
  • /Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Splines/src/Splines.hh