ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tk::spline Class Reference

#include <AtSpline.h>

Collaboration diagram for tk::spline:
Collaboration graph
[legend]

Public Types

enum  spline_type { linear = 10, cspline = 30, cspline_hermite = 31 }
 
enum  bd_type { first_deriv = 1, second_deriv = 2, not_a_knot = 3 }
 

Public Member Functions

 spline ()
 
 spline (const std::vector< double > &X, const std::vector< double > &Y, spline_type type=cspline, bool make_monotonic=false, bd_type left=second_deriv, double left_value=0.0, bd_type right=second_deriv, double right_value=0.0)
 
void set_boundary (bd_type left, double left_value, bd_type right, double right_value)
 
void set_points (const std::vector< double > &x, const std::vector< double > &y, spline_type type=cspline)
 
bool make_monotonic ()
 
double operator() (double x) const
 
double deriv (int order, double x) const
 
double integrate (double x0, double x1) const
 
std::vector< double > solve (double y, bool ignore_extrapolation=true) const
 
std::vector< double > get_x () const
 
std::vector< double > get_y () const
 
double get_x_min () const
 
double get_x_max () const
 

Protected Member Functions

void set_coeffs_from_b ()
 
size_t find_closest (double x) const
 
void set_points_linear ()
 
void set_points_cspline ()
 
void set_points_cspline_hermite ()
 
void set_integral ()
 

Protected Attributes

std::vector< double > m_x
 
std::vector< double > m_y
 
std::vector< double > m_b
 
std::vector< double > m_c
 
std::vector< double > m_d
 
double m_c0
 
spline_type m_type
 
bd_type m_left
 
bd_type m_right
 
double m_left_value
 
double m_right_value
 
bool m_made_monotonic
 
std::vector< double > m_integral
 

Detailed Description

Definition at line 43 of file AtSpline.h.

Member Enumeration Documentation

◆ bd_type

Enumerator
first_deriv 
second_deriv 
not_a_knot 

Definition at line 53 of file AtSpline.h.

◆ spline_type

Enumerator
linear 
cspline 
cspline_hermite 

Definition at line 46 of file AtSpline.h.

Constructor & Destructor Documentation

◆ spline() [1/2]

tk::spline::spline ( )
inline

Definition at line 79 of file AtSpline.h.

◆ spline() [2/2]

tk::spline::spline ( const std::vector< double > &  X,
const std::vector< double > &  Y,
spline_type  type = cspline,
bool  make_monotonic = false,
bd_type  left = second_deriv,
double  left_value = 0.0,
bd_type  right = second_deriv,
double  right_value = 0.0 
)
inline

Definition at line 85 of file AtSpline.h.

Member Function Documentation

◆ deriv()

double tk::spline::deriv ( int  order,
double  x 
) const

Definition at line 336 of file AtSpline.cxx.

◆ find_closest()

size_t tk::spline::find_closest ( double  x) const
protected

Definition at line 303 of file AtSpline.cxx.

◆ get_x()

std::vector<double> tk::spline::get_x ( ) const
inline

Definition at line 121 of file AtSpline.h.

◆ get_x_max()

double tk::spline::get_x_max ( ) const
inline

Definition at line 128 of file AtSpline.h.

◆ get_x_min()

double tk::spline::get_x_min ( ) const
inline

Definition at line 123 of file AtSpline.h.

◆ get_y()

std::vector<double> tk::spline::get_y ( ) const
inline

Definition at line 122 of file AtSpline.h.

◆ integrate()

double tk::spline::integrate ( double  x0,
double  x1 
) const

Definition at line 370 of file AtSpline.cxx.

◆ make_monotonic()

bool tk::spline::make_monotonic ( )

Definition at line 251 of file AtSpline.cxx.

◆ operator()()

double tk::spline::operator() ( double  x) const

Definition at line 311 of file AtSpline.cxx.

◆ set_boundary()

void tk::spline::set_boundary ( spline::bd_type  left,
double  left_value,
spline::bd_type  right,
double  right_value 
)

Definition at line 16 of file AtSpline.cxx.

◆ set_coeffs_from_b()

void tk::spline::set_coeffs_from_b ( )
protected

Definition at line 25 of file AtSpline.cxx.

◆ set_integral()

void tk::spline::set_integral ( )
protected

Definition at line 206 of file AtSpline.cxx.

◆ set_points()

void tk::spline::set_points ( const std::vector< double > &  x,
const std::vector< double > &  y,
spline_type  type = cspline 
)

Definition at line 220 of file AtSpline.cxx.

◆ set_points_cspline()

void tk::spline::set_points_cspline ( )
protected

Definition at line 66 of file AtSpline.cxx.

◆ set_points_cspline_hermite()

void tk::spline::set_points_cspline_hermite ( )
protected

Definition at line 152 of file AtSpline.cxx.

◆ set_points_linear()

void tk::spline::set_points_linear ( )
protected

Definition at line 48 of file AtSpline.cxx.

◆ solve()

std::vector< double > tk::spline::solve ( double  y,
bool  ignore_extrapolation = true 
) const

Definition at line 395 of file AtSpline.cxx.

Member Data Documentation

◆ m_b

std::vector<double> tk::spline::m_b
protected

Definition at line 60 of file AtSpline.h.

◆ m_c

std::vector<double> tk::spline::m_c
protected

Definition at line 60 of file AtSpline.h.

◆ m_c0

double tk::spline::m_c0
protected

Definition at line 61 of file AtSpline.h.

◆ m_d

std::vector<double> tk::spline::m_d
protected

Definition at line 60 of file AtSpline.h.

◆ m_integral

std::vector<double> tk::spline::m_integral
protected

Definition at line 67 of file AtSpline.h.

◆ m_left

bd_type tk::spline::m_left
protected

Definition at line 63 of file AtSpline.h.

◆ m_left_value

double tk::spline::m_left_value
protected

Definition at line 64 of file AtSpline.h.

◆ m_made_monotonic

bool tk::spline::m_made_monotonic
protected

Definition at line 65 of file AtSpline.h.

◆ m_right

bd_type tk::spline::m_right
protected

Definition at line 63 of file AtSpline.h.

◆ m_right_value

double tk::spline::m_right_value
protected

Definition at line 64 of file AtSpline.h.

◆ m_type

spline_type tk::spline::m_type
protected

Definition at line 62 of file AtSpline.h.

◆ m_x

std::vector<double> tk::spline::m_x
protected

Definition at line 56 of file AtSpline.h.

◆ m_y

std::vector<double> tk::spline::m_y
protected

Definition at line 56 of file AtSpline.h.


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