Spline1D Class ReferenceΒΆ

Splines: Splines::Spline1D Class Reference
Splines
Splines::Spline1D Class Reference

Spline Management Class. More...

#include <Splines1D.hxx>

Public Member Functions

 Spline1D (Spline1D const &)=delete
 
Spline1D const & operator= (Spline1D const &)=delete
 
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
 
void reserve (integer npts)
 
void push_back (real_type x, real_type y)
 
void drop_back ()
 
void build ()
 
void setup (GenericContainer const &gc)
 
void build (GenericContainer const &gc)
 
void build (SplineType1D tp, real_type const x[], integer incx, real_type const y[], integer incy, integer n)
 
void build (SplineType1D tp, real_type const x[], real_type const y[], integer n)
 
void build (SplineType1D tp, vector< real_type > const &x, vector< real_type > const &y)
 
void clear ()
 
real_type x_min () const
 
real_type x_max () const
 
real_type y_min () const
 
real_type y_max () const
 
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
 
integer coeffs (real_type cfs[], real_type nodes[], bool transpose=false) const
 
integer order () const
 
void write_to_stream (ostream_type &s) const
 
char const * type_name () const
 
SplineType1D type () const
 
string info () const
 
void info (ostream_type &stream) const
 
Constructors
 Spline1D (std::string const &n)
 
 ~Spline1D ()
 
Open/Close
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 ()
 
Evaluation
real_type eval (real_type x) const
 
real_type D (real_type x) const
 
real_type DD (real_type x) const
 
real_type DDD (real_type x) const
 
real_type DDDD (real_type x) const
 
real_type DDDDD (real_type x) const
 
Evaluation Aliases
real_type operator() (real_type x) const
 
real_type eval_D (real_type x) const
 the value of the first derivative of the spline at x
 
real_type eval_DD (real_type x) const
 the value of the second derivative of the spline at x
 
real_type eval_DDD (real_type x) const
 the value of the third derivative of the spline at x
 
real_type eval_DDDD (real_type x) const
 the value of the 4-th derivative of the spline at x
 
real_type eval_DDDDD (real_type x) const
 the value of the 5-th derivative of the spline at x
 
Evaluation when segment is known
real_type id_eval (integer ni, real_type x) const
 
real_type id_D (integer ni, real_type x) const
 
real_type id_DD (integer ni, real_type x) const
 
real_type id_DDD (integer ni, real_type x) const
 
real_type id_DDDD (integer ni, real_type x) const
 
real_type id_DDDDD (integer ni, real_type x) const
 

Detailed Description

Spline Management Class.

Constructor & Destructor Documentation

◆ Spline1D()

Splines::Spline1D::Spline1D ( std::string const & n)
inline

Build an empty spline of Spline1D type

Parameters
nthe name of the spline

◆ ~Spline1D()

Splines::Spline1D::~Spline1D ( )
inline

Spline destructor.

Member Function Documentation

◆ build() [1/5]

void Splines::Spline1D::build ( )
inline

Build a spline.

◆ build() [2/5]

void Splines::Spline1D::build ( GenericContainer const & gc)
inline

Build a spline using data in GenericContainer

◆ build() [3/5]

void Splines::Spline1D::build ( SplineType1D tp,
real_type const x[],
integer incx,
real_type const y[],
integer incy,
integer n )

Build a spline.

Parameters
tpspline type
xvector of x-coordinates
incxaccess elements as x[0], x[incx], x[2*incx],...
yvector of y-coordinates
incyaccess elements as y[0], y[incy], x[2*incy],...
ntotal number of points

◆ build() [4/5]

void Splines::Spline1D::build ( SplineType1D tp,
real_type const x[],
real_type const y[],
integer n )
inline

Build a spline.

Parameters
tpspline type
xvector of x-coordinates
yvector of y-coordinates
ntotal number of points

◆ build() [5/5]

void Splines::Spline1D::build ( SplineType1D tp,
vector< real_type > const & x,
vector< real_type > const & y )
inline

Build a spline.

Parameters
tpspline type
xvector of x-coordinates
yvector of y-coordinates

◆ clear()

void Splines::Spline1D::clear ( )
inline

Cancel the support points, empty the spline.

◆ coeffs()

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

Get the piecewise polinomials of the spline

◆ D()

real_type Splines::Spline1D::D ( real_type x) const
inline

First derivative at x.

◆ DD()

real_type Splines::Spline1D::DD ( real_type x) const
inline

Second derivative at x.

◆ DDD()

real_type Splines::Spline1D::DDD ( real_type x) const
inline

Third derivative at x.

◆ DDDD()

real_type Splines::Spline1D::DDDD ( real_type x) const
inline

4th derivative at x.

◆ DDDDD()

real_type Splines::Spline1D::DDDDD ( real_type x) const
inline

5th derivative at x.

◆ drop_back()

void Splines::Spline1D::drop_back ( )
inline

Drop last inserted point of the spline.

◆ dump() [1/2]

void Splines::Spline1D::dump ( char const fname[],
integer nintervals,
char const header[] = "x\ty" ) const
inline

dump a sample of the spline

◆ dump() [2/2]

void Splines::Spline1D::dump ( ostream_type & s,
integer nintervals,
char const header[] = "x\ty" ) const
inline

dump a sample of the spline

◆ eval()

real_type Splines::Spline1D::eval ( real_type x) const
inline

Evaluate spline value at x.

◆ id_D()

real_type Splines::Spline1D::id_D ( integer ni,
real_type x ) const
inline

First derivative at x.

Parameters
xvalue at which spline is evaluated
niselect the component

◆ id_DD()

real_type Splines::Spline1D::id_DD ( integer ni,
real_type x ) const
inline

Second derivative at x.

Parameters
xvalue at which spline is evaluated
niselect the component

◆ id_DDD()

real_type Splines::Spline1D::id_DDD ( integer ni,
real_type x ) const
inline

Third derivative at x.

Parameters
xvalue at which spline is evaluated
niselect the component

◆ id_DDDD()

real_type Splines::Spline1D::id_DDDD ( integer ni,
real_type x ) const
inline

4th derivative at x.

Parameters
xvalue at which spline is evaluated
niselect the component

◆ id_DDDDD()

real_type Splines::Spline1D::id_DDDDD ( integer ni,
real_type x ) const
inline

5th derivative at x.

Parameters
xvalue at which spline is evaluated
niselect the component

◆ id_eval()

real_type Splines::Spline1D::id_eval ( integer ni,
real_type x ) const
inline

Evaluate spline at x.

Parameters
xvalue at which spline is evaluated
niselect the component

◆ info() [1/2]

string Splines::Spline1D::info ( ) const
inline

String information of the kind and order of the spline

◆ info() [2/2]

void Splines::Spline1D::info ( ostream_type & stream) const
inline

Print information of the kind and order of the spline

◆ is_bounded()

bool Splines::Spline1D::is_bounded ( ) const
inline
Returns
true if spline cannot extend outside interval of definition

◆ is_closed()

bool Splines::Spline1D::is_closed ( ) const
inline
Returns
true if spline is a closed spline

◆ is_extended_constant()

bool Splines::Spline1D::is_extended_constant ( ) const
inline
Returns
true if the spline extend with a constant value

◆ make_bounded()

void Splines::Spline1D::make_bounded ( )
inline

Set spline as bounded. When evaluated if parameter is outside the domain an error is issued.

◆ make_closed()

void Splines::Spline1D::make_closed ( )
inline

Set spline as a closed spline. When evaluated if parameter is outside the domain is wrapped cyclically before evalation.

◆ make_extended_constant()

void Splines::Spline1D::make_extended_constant ( )
inline

Set spline to extend constant. When evaluated if parameter is outside the domain the value returned is the value of the closed border.

◆ make_extended_not_constant()

void Splines::Spline1D::make_extended_not_constant ( )
inline

Set spline to extend NOT constant. When evaluated if parameter is outside the domain teh value returned is extrapolated using the last spline polynomial.

◆ make_opened()

void Splines::Spline1D::make_opened ( )
inline

Set spline as an opened spline. When evaluated if parameter is outside the domain an error is produced.

◆ make_unbounded()

void Splines::Spline1D::make_unbounded ( )
inline

Set spline as unbounded. When evaluated if parameter is outside the domain an extrapolated value is used.

◆ name()

string const & Splines::Spline1D::name ( ) const
inline
Returns
string with the name of the spline

◆ num_points()

integer Splines::Spline1D::num_points ( ) const
inline

Return the number of support points of the spline.

◆ operator()()

real_type Splines::Spline1D::operator() ( real_type x) const
inline

the value of the spline at x

◆ order()

integer Splines::Spline1D::order ( ) const
inline
Returns
the order of the spline (degree+1)

◆ push_back()

void Splines::Spline1D::push_back ( real_type x,
real_type y )
inline

Add a support point (x,y) to the spline.

◆ reserve()

void Splines::Spline1D::reserve ( integer npts)
inline

Allocate memory for npts points.

◆ set_origin()

void Splines::Spline1D::set_origin ( real_type x0)
inline

Change X-origin of the spline.

◆ set_range()

void Splines::Spline1D::set_range ( real_type xmin,
real_type xmax )
inline

Change X-range of the spline.

◆ setup()

void Splines::Spline1D::setup ( GenericContainer const & gc)

Build a spline using data in GenericContainer

Setup a spline using a GenericContainer

  • gc("spline_type")
    • "constant"
    • "linear"
    • "cubic"
    • "akima"
    • "bessel"
    • "pchip"
    • "quintic"

◆ type()

SplineType1D Splines::Spline1D::type ( ) const
inline

Return spline type (as number).

◆ type_name()

char const * Splines::Spline1D::type_name ( ) const
inline

Return spline typename.

◆ write_to_stream()

void Splines::Spline1D::write_to_stream ( ostream_type & s) const
inline

Print spline coefficients.

◆ x_begin()

real_type Splines::Spline1D::x_begin ( ) const
inline

Return first node of the spline (x component).

◆ x_end()

real_type Splines::Spline1D::x_end ( ) const
inline

Return last node of the spline (x component).

◆ x_max()

real_type Splines::Spline1D::x_max ( ) const
inline

Return x-maximum spline value.

◆ x_min()

real_type Splines::Spline1D::x_min ( ) const
inline

Return x-minumum spline value.

◆ x_node()

real_type Splines::Spline1D::x_node ( integer i) const
inline

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

◆ y_begin()

real_type Splines::Spline1D::y_begin ( ) const
inline

Return first node of the spline (y component).

◆ y_end()

real_type Splines::Spline1D::y_end ( ) const
inline

Return last node of the spline (y component).

◆ y_max()

real_type Splines::Spline1D::y_max ( ) const
inline

Return y-maximum spline value (on the support point of the spline).

◆ y_min()

real_type Splines::Spline1D::y_min ( ) const
inline

Return y-minumum spline value (on the support point of the spline).

◆ y_node()

real_type Splines::Spline1D::y_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 files:
  • /Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Splines/src/Splines/Splines1D.hxx
  • /Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Splines/src/Splines1D.cc