A simple class for cubic splines. More...
#include <Spline.h>
Classes | |
struct | Segment |
internal class describing a "segment" (between two x points) More... | |
Public Member Functions | |
float | deriv (float x) const |
compute the derivate at x coordinate x More... | |
float | eval (float x) const |
compute y coordinate at x coordinate x More... | |
float | getArea () const |
total area (integral between 0 and 1) under curve More... | |
float | integral (float x) const |
compute integral under curve between 0 and x More... | |
unsigned int | numberOfEntries () const |
return the number of entries More... | |
Spline & | operator= (const Spline &orig) |
void | set (unsigned int n, const double *vals) |
initialize spline from n y coordinates in array vals More... | |
Spline () | |
Spline (const Spline &orig) | |
Spline (unsigned int n, const double *vals) | |
construct spline from n y coordinates in array vals More... | |
~Spline () | |
Private Attributes | |
float | area |
unsigned int | n |
Segment * | segments |
A simple class for cubic splines.
This class implements cubic splines for n equidistant points in x between 0 and 1. It is constructed from an array of n y coordinates and can compute the interpolated y coordinate for a given x.
PhysicsTools::Spline::Spline | ( | unsigned int | n, |
const double * | vals | ||
) |
float PhysicsTools::Spline::deriv | ( | float | x | ) | const |
compute the derivate at x coordinate x
Definition at line 139 of file Spline.cc.
References PhysicsTools::Spline::Segment::deriv(), createfilelist::int, n, mergeAndRegister::rest, segments, dqmMemoryStats::total, and x.
float PhysicsTools::Spline::eval | ( | float | x | ) | const |
compute y coordinate at x coordinate x
Definition at line 127 of file Spline.cc.
References PhysicsTools::Spline::Segment::eval(), createfilelist::int, n, mergeAndRegister::rest, segments, dqmMemoryStats::total, and x.
|
inline |
float PhysicsTools::Spline::integral | ( | float | x | ) | const |
compute integral under curve between 0 and x
Definition at line 153 of file Spline.cc.
References area, MillePedeFileConverter_cfg::e, createfilelist::int, n, mergeAndRegister::rest, segments, dqmMemoryStats::total, and x.
|
inline |
void PhysicsTools::Spline::set | ( | unsigned int | n, |
const double * | vals | ||
) |
initialize spline from n y coordinates in array vals
Definition at line 67 of file Spline.cc.
References PhysicsTools::Spline::Segment::area, area, PhysicsTools::Spline::Segment::coeffs, mps_fire::i, PhysicsTools::Spline::Segment::integral(), n, and segments.
|
private |
Definition at line 67 of file Spline.h.
Referenced by getArea(), integral(), PhysicsTools::Spline::Segment::integral(), operator=(), and set().
|
private |
Definition at line 65 of file Spline.h.
Referenced by deriv(), eval(), output.OutputBranch::fill(), integral(), numberOfEntries(), operator=(), set(), and Spline().
|
private |
Definition at line 66 of file Spline.h.
Referenced by deriv(), eval(), integral(), operator=(), set(), Spline(), and ~Spline().