#include <Interpol2D.h>
Public Member Functions | |
Interpol2D () | |
Interpol2D (unsigned int xdivs, double xmin, double xmax, unsigned int ydivs, double ymin, double ymax) | |
void | setXmin (double value) |
double | getXmin () const |
void | setXmax (double value) |
double | getXmax () const |
void | setXdivs (unsigned int value) |
unsigned int | getXdivs () const |
void | setDx (double value) |
double | getDx () const |
void | setYmin (double value) |
double | getYmin () const |
void | setYmax (double value) |
double | getYmax () const |
void | setYdivs (unsigned int value) |
unsigned int | getYdivs () const |
void | setDy (double value) |
double | getDy () const |
void | setSy (double value) |
double | getSy () const |
double | getInterpolatedValue (vector< double > xy) const |
void | lookupReturn (const Eref &e, double v1, double v2) |
void | lookup (double v1, double v2) |
void | appendTableVector (vector< vector< double > > value) |
double | interpolate (double x, double y) const |
double | indexWithoutCheck (double x, double y) const |
double | innerLookup (double x, double y) const |
bool | operator== (const Interpol2D &other) const |
bool | operator< (const Interpol2D &other) const |
double | invDy () const |
void | setTableValue (vector< unsigned int > index, double value) |
double | getTableValue (vector< unsigned int > index) const |
void | setTableVector (vector< vector< double > > value) |
vector< vector< double > > | getTableVector () const |
void | appendTableVector (const vector< vector< double > > &value) |
void | resize (unsigned int xsize, unsigned int ysize, double init=0.0) |
unsigned int | xdivs () const |
unsigned int | ydivs () const |
void | print (const string &fname, bool doAppend) const |
void | load (const string &fname, unsigned int skiplines) |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
Static Public Attributes | |
static const unsigned int | MAX_DIVS = 100000 |
Friends | |
istream & | operator>> (istream &, Interpol2D &) |
2 Dimensional table, with interpolation. The internal vector is accessed like this: table_[ xIndex ][ yIndex ], with the x- and y-coordinates used as the first and second indices respectively.
Interpol2D::Interpol2D | ( | ) |
Interpol2D::Interpol2D | ( | unsigned int | xdivs, | |
double | xmin, | |||
double | xmax, | |||
unsigned int | ydivs, | |||
double | ymin, | |||
double | ymax | |||
) |
void Interpol2D::appendTableVector | ( | const vector< vector< double > > & | value | ) |
void Interpol2D::appendTableVector | ( | vector< vector< double > > | value | ) |
double Interpol2D::getDx | ( | ) | const |
double Interpol2D::getDy | ( | ) | const |
double Interpol2D::getInterpolatedValue | ( | vector< double > | xy | ) | const |
Referenced by initCinfo().
double Interpol2D::getSy | ( | ) | const |
double Interpol2D::getTableValue | ( | vector< unsigned int > | index | ) | const |
Referenced by initCinfo().
vector< vector< double > > Interpol2D::getTableVector | ( | ) | const |
Referenced by HHGate2D::getTableA(), HHGate2D::getTableB(), and initCinfo().
unsigned int Interpol2D::getXdivs | ( | ) | const |
Referenced by HHGate2D::getXdivsA(), HHGate2D::getXdivsB(), and initCinfo().
double Interpol2D::getXmax | ( | ) | const |
Referenced by HHGate2D::getXmaxA(), HHGate2D::getXmaxB(), and initCinfo().
double Interpol2D::getXmin | ( | ) | const |
Referenced by HHGate2D::getXminA(), HHGate2D::getXminB(), and initCinfo().
unsigned int Interpol2D::getYdivs | ( | ) | const |
Referenced by HHGate2D::getYdivsA(), HHGate2D::getYdivsB(), and initCinfo().
double Interpol2D::getYmax | ( | ) | const |
Referenced by HHGate2D::getYmaxA(), HHGate2D::getYmaxB(), and initCinfo().
double Interpol2D::getYmin | ( | ) | const |
Referenced by HHGate2D::getYminA(), HHGate2D::getYminB(), and initCinfo().
double Interpol2D::indexWithoutCheck | ( | double | x, | |
double | y | |||
) | const |
const Cinfo * Interpol2D::initCinfo | ( | ) | [static] |
References getDx(), getDy(), getInterpolatedValue(), getTableValue(), getTableVector(), getXdivs(), getXmax(), getXmin(), getYdivs(), getYmax(), getYmin(), Neutral::initCinfo(), lookup(), lookupReturn(), setDx(), setDy(), setTableValue(), setTableVector(), setXdivs(), setXmax(), setXmin(), setYdivs(), setYmax(), setYmin(), xdivs(), and ydivs().
double Interpol2D::innerLookup | ( | double | x, | |
double | y | |||
) | const |
References interpolate().
Referenced by HHGate2D::lookupBoth(), and lookupReturn().
double Interpol2D::interpolate | ( | double | x, | |
double | y | |||
) | const |
Performs bi-linear interpolation.
Modified by Vishaka Datta S, 2011, NCBS. Interpolation now performs bounds checking.
Referenced by innerLookup().
double Interpol2D::invDy | ( | ) | const [inline] |
void Interpol2D::load | ( | const string & | fname, | |
unsigned int | skiplines | |||
) |
void Interpol2D::lookup | ( | double | v1, | |
double | v2 | |||
) |
Referenced by initCinfo().
void Interpol2D::lookupReturn | ( | const Eref & | e, | |
double | v1, | |||
double | v2 | |||
) |
Looks up table value based on indices v1 and v2, and sends value back on the 'lookupOut' message.
lookupReturn uses its argument to do an interpolating lookup of the table. It sends a return message to the originating object with the looked up value. This should be avoided, instead use the fastGet function.
References innerLookup().
Referenced by initCinfo().
bool Interpol2D::operator< | ( | const Interpol2D & | other | ) | const |
bool Interpol2D::operator== | ( | const Interpol2D & | other | ) | const |
void Interpol2D::print | ( | const string & | fname, | |
bool | doAppend | |||
) | const |
void Interpol2D::resize | ( | unsigned int | xsize, | |
unsigned int | ysize, | |||
double | init = 0.0 | |||
) |
Resizes 2-D vector. If either argument is zero, it remains unchanged
References xdivs(), and ydivs().
Referenced by Interpol2D(), setDx(), setXdivs(), and setYdivs().
void Interpol2D::setDx | ( | double | value | ) |
References doubleEq(), MAX_DIVS, resize(), and xdivs().
Referenced by initCinfo().
void Interpol2D::setDy | ( | double | value | ) |
Later do interpolation etc to preserve contents.
Later also check that it is OK for xmax_ < xmin_
References doubleEq(), MAX_DIVS, setYdivs(), and ydivs().
Referenced by initCinfo().
void Interpol2D::setSy | ( | double | value | ) |
void Interpol2D::setTableValue | ( | vector< unsigned int > | index, | |
double | value | |||
) |
Referenced by initCinfo().
void Interpol2D::setTableVector | ( | vector< vector< double > > | value | ) |
Referenced by initCinfo().
void Interpol2D::setXdivs | ( | unsigned int | value | ) |
References resize().
Referenced by initCinfo(), HHGate2D::setXdivsA(), and HHGate2D::setXdivsB().
void Interpol2D::setXmax | ( | double | value | ) |
References doubleApprox(), and xdivs().
Referenced by initCinfo(), HHGate2D::setXmaxA(), and HHGate2D::setXmaxB().
void Interpol2D::setXmin | ( | double | value | ) |
References doubleApprox(), and xdivs().
Referenced by initCinfo(), HHGate2D::setXminA(), and HHGate2D::setXminB().
void Interpol2D::setYdivs | ( | unsigned int | value | ) |
References resize().
Referenced by initCinfo(), setDy(), HHGate2D::setYdivsA(), and HHGate2D::setYdivsB().
void Interpol2D::setYmax | ( | double | value | ) |
References doubleApprox(), and ydivs().
Referenced by initCinfo(), HHGate2D::setYmaxA(), and HHGate2D::setYmaxB().
void Interpol2D::setYmin | ( | double | value | ) |
References doubleApprox(), and ydivs().
Referenced by initCinfo(), HHGate2D::setYminA(), and HHGate2D::setYminB().
unsigned int Interpol2D::xdivs | ( | ) | const |
unsigned int Interpol2D::ydivs | ( | ) | const |
istream& operator>> | ( | istream & | , | |
Interpol2D & | ||||
) | [friend] |
const unsigned int Interpol2D::MAX_DIVS = 100000 [static] |