CSol
|
Series implementation.
#include <series/csol_series.h>
Public Member Functions | |
Series () | |
Series constructor. More... | |
Series (const Series &) | |
Series copy constructor. More... | |
~Series () | |
void | addValue (double, double) |
Adds a value to a series and re-calculates gradients. More... | |
double | dv (const double, const double) |
Series derivative. More... | |
double | get_xMax () |
double | get_xMin () |
double | get_yMax () |
double | get_yMin () |
bool | getIndex (int, double &, double &) |
Return values at series index. More... | |
int | getN () |
QString | getName () |
void | init (double &) |
Create Series from constant value. More... | |
void | init (QVector< double > &, const double, const double) |
Create Series with equal spacing. More... | |
void | init (QVector< double > &, QVector< double > &, const double) |
Create Series for non-equally spaced steps for monotone cubic hermite interpolation. More... | |
bool | inRange (const double) |
Find if a value is within the range of a series. More... | |
bool | isConstant () |
bool | isInitialised () const |
Series & | operator= (const Series &) |
Series assignment operator. More... | |
void | setBounds (double y_upperBound_, double y_lowerBound_) |
void | setIndex (int, double) |
Sets a value associated with a series index and re-calculates gradients. More... | |
void | setInterpolation (SeriesInterpolation::Type interpolation_) |
void | setName (QString &name_) |
void | update () |
Calculate gradients for monotone cubic hermite interpolation. More... | |
void | updateLimits () |
Find maximum and minimum values in series. More... | |
double | v (const double) |
Series interpolation. More... | |
double | vBoundedLinear (const double) |
Bounded linear series interpolation. More... | |
double | vLinear (const double) |
Linear series interpolation. More... | |
double | vMonotoneCubic (const double) |
Monotone cubic series interpolation. More... | |
Protected Attributes | |
SeriesInterpolation::Type | interpolation |
Interpolation type. More... | |
QString | name |
Series name. More... | |
QVector< double > | slopes |
Slope tangents for non-constant series. More... | |
QVector< QPair< double, double > > | values |
Values stores as x, y pair. More... | |
double | x_max |
Abscissa limits. More... | |
double | x_min |
double | y_lowerBound |
Interpolation bounds. More... | |
double | y_max |
Ordinate limits. More... | |
double | y_min |
double | y_upperBound |
Series | ( | ) |
|
inline |
void addValue | ( | double | y, |
double | x | ||
) |
y | ordinate value |
x | abscissa value |
double dv | ( | const double | x, |
const double | dx | ||
) |
x | abscissa value. |
dx | sampling size. |
|
inline |
|
inline |
|
inline |
|
inline |
bool getIndex | ( | int | i, |
double & | y, | ||
double & | x | ||
) |
i | index. |
y | ordinate value at index i. |
x | abscissa value at index i. |
|
inline |
|
inline |
void init | ( | double & | val | ) |
val | initialisation value. |
void init | ( | QVector< double > & | py, |
const double | dx, | ||
const double | xOffset | ||
) |
py | vector of ordinate values. |
dx | abscissa value spacing. |
xOffset | offset added to x-values. |
void init | ( | QVector< double > & | py, |
QVector< double > & | px, | ||
const double | xOffset | ||
) |
py | vector of ordinate values |
px | vector of abscissa values |
xOffset | offset added to x-values. See: Monotone Piecewise Cubic Interpolation, Fritsch and Carlson, SIAM Journal Numerical Analysis 17 (1980). or Wikipedia article. |
bool inRange | ( | const double | x | ) |
x | abscissa value to check. |
|
inline |
|
inline |
|
inline |
void setIndex | ( | int | i, |
double | y | ||
) |
i | index. |
y | ordinate value to set for index i. |
|
inline |
|
inline |
void update | ( | ) |
Derivatives are limited using Fritsch-Carlson method.
void updateLimits | ( | ) |
double v | ( | const double | x | ) |
x | abscissa value. |
double vBoundedLinear | ( | const double | x | ) |
x | abscissa value. |
double vLinear | ( | const double | x | ) |
x | abscissa value. |
double vMonotoneCubic | ( | const double | x | ) |
x | abscissa value. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |