MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <Interpol2D.h>
Public Member Functions | |
void | appendTableVector (vector< vector< double > > value) |
void | appendTableVector (const vector< vector< double > > &value) |
double | getDx () const |
double | getDy () const |
double | getInterpolatedValue (vector< double > xy) const |
double | getSy () const |
double | getTableValue (vector< unsigned int > index) const |
vector< vector< double > > | getTableVector () const |
unsigned int | getXdivs () const |
double | getXmax () const |
double | getXmin () const |
unsigned int | getYdivs () const |
double | getYmax () const |
double | getYmin () const |
double | indexWithoutCheck (double x, double y) const |
double | innerLookup (double x, double y) const |
Interpol2D () | |
Interpol2D (unsigned int xdivs, double xmin, double xmax, unsigned int ydivs, double ymin, double ymax) | |
double | interpolate (double x, double y) const |
double | invDy () const |
void | load (const string &fname, unsigned int skiplines) |
void | lookup (double v1, double v2) |
void | lookupReturn (const Eref &e, double v1, double v2) |
bool | operator< (const Interpol2D &other) const |
bool | operator== (const Interpol2D &other) const |
void | print (const string &fname, bool doAppend) const |
void | resize (unsigned int xsize, unsigned int ysize, double init=0.0) |
void | setDx (double value) |
void | setDy (double value) |
void | setSy (double value) |
void | setTableValue (vector< unsigned int > index, double value) |
void | setTableVector (vector< vector< double > > value) |
void | setXdivs (unsigned int value) |
void | setXmax (double value) |
void | setXmin (double value) |
void | setYdivs (unsigned int value) |
void | setYmax (double value) |
void | setYmin (double value) |
unsigned int | xdivs () const |
unsigned int | ydivs () const |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
Static Public Attributes | |
static const unsigned int | MAX_DIVS = 100000 |
Private Attributes | |
double | invDx_ |
double | invDy_ |
double | sy_ |
vector< vector< double > > | table_ |
double | xmax_ |
double | xmin_ |
double | ymax_ |
double | ymin_ |
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.
Definition at line 18 of file Interpol2D.h.
Interpol2D::Interpol2D | ( | ) |
Interpol2D::Interpol2D | ( | unsigned int | xdivs, |
double | xmin, | ||
double | xmax, | ||
unsigned int | ydivs, | ||
double | ymin, | ||
double | ymax | ||
) |
Definition at line 173 of file Interpol2D.cpp.
References doubleEq(), invDx_, invDy_, resize(), xmax_, xmin_, ymax_, and ymin_.
void Interpol2D::appendTableVector | ( | vector< vector< double > > | value | ) |
void Interpol2D::appendTableVector | ( | const vector< vector< double > > & | value | ) |
double Interpol2D::getDx | ( | ) | const |
Definition at line 282 of file Interpol2D.cpp.
References xdivs(), xmax_, and xmin_.
Referenced by initCinfo().
double Interpol2D::getDy | ( | ) | const |
Definition at line 352 of file Interpol2D.cpp.
References ydivs(), ymax_, and ymin_.
Referenced by initCinfo().
double Interpol2D::getInterpolatedValue | ( | vector< double > | xy | ) | const |
Definition at line 443 of file Interpol2D.cpp.
References interpolate(), xmax_, xmin_, ymax_, and ymin_.
Referenced by initCinfo().
double Interpol2D::getSy | ( | ) | const |
Definition at line 359 of file Interpol2D.cpp.
References sy_.
double Interpol2D::getTableValue | ( | vector< unsigned int > | index | ) | const |
Definition at line 402 of file Interpol2D.cpp.
References table_.
Referenced by initCinfo().
vector< vector< double > > Interpol2D::getTableVector | ( | ) | const |
Definition at line 379 of file Interpol2D.cpp.
References table_.
Referenced by HHGate2D::getTableA(), HHGate2D::getTableB(), and initCinfo().
unsigned int Interpol2D::getXdivs | ( | ) | const |
Definition at line 262 of file Interpol2D.cpp.
References table_.
Referenced by HHGate2D::getXdivsA(), HHGate2D::getXdivsB(), initCinfo(), and MarkovSolverBase::setLookupParams().
double Interpol2D::getXmax | ( | ) | const |
Definition at line 252 of file Interpol2D.cpp.
References xmax_.
Referenced by HHGate2D::getXmaxA(), HHGate2D::getXmaxB(), initCinfo(), and MarkovSolverBase::setLookupParams().
double Interpol2D::getXmin | ( | ) | const |
Definition at line 238 of file Interpol2D.cpp.
References xmin_.
Referenced by HHGate2D::getXminA(), HHGate2D::getXminB(), initCinfo(), and MarkovSolverBase::setLookupParams().
unsigned int Interpol2D::getYdivs | ( | ) | const |
Definition at line 325 of file Interpol2D.cpp.
References table_.
Referenced by HHGate2D::getYdivsA(), HHGate2D::getYdivsB(), initCinfo(), and MarkovSolverBase::setLookupParams().
double Interpol2D::getYmax | ( | ) | const |
Definition at line 316 of file Interpol2D.cpp.
References ymax_.
Referenced by HHGate2D::getYmaxA(), HHGate2D::getYmaxB(), initCinfo(), and MarkovSolverBase::setLookupParams().
double Interpol2D::getYmin | ( | ) | const |
Definition at line 302 of file Interpol2D.cpp.
References ymin_.
Referenced by HHGate2D::getYminA(), HHGate2D::getYminB(), initCinfo(), and MarkovSolverBase::setLookupParams().
double Interpol2D::indexWithoutCheck | ( | double | x, |
double | y | ||
) | const |
|
static |
Definition at line 25 of file Interpol2D.cpp.
References getDx(), getDy(), getInterpolatedValue(), getTableValue(), getTableVector(), getXdivs(), getXmax(), getXmin(), getYdivs(), getYmax(), getYmin(), Neutral::initCinfo(), interpol2DCinfo, lookup(), lookupOut(), lookupReturn(), setDx(), setDy(), setTableValue(), setTableVector(), setXdivs(), setXmax(), setXmin(), setYdivs(), setYmax(), setYmin(), xdivs(), and ydivs().
double Interpol2D::innerLookup | ( | double | x, |
double | y | ||
) | const |
Definition at line 574 of file Interpol2D.cpp.
References interpolate(), table_, xmax_, xmin_, ymax_, and ymin_.
Referenced by HHGate2D::lookupA(), HHGate2D::lookupB(), 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.
Definition at line 508 of file Interpol2D.cpp.
References invDx_, invDy_, table_, xmin_, and ymin_.
Referenced by getInterpolatedValue(), and innerLookup().
|
inline |
Definition at line 76 of file Interpol2D.h.
References invDy_.
void Interpol2D::load | ( | const string & | fname, |
unsigned int | skiplines | ||
) |
Definition at line 699 of file Interpol2D.cpp.
References invDx_, invDy_, table_, moose::trim(), xdivs(), xmax_, xmin_, ydivs(), ymax_, and ymin_.
void Interpol2D::lookup | ( | double | v1, |
double | v2 | ||
) |
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.
Definition at line 478 of file Interpol2D.cpp.
References innerLookup(), and lookupOut().
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
Definition at line 200 of file Interpol2D.cpp.
References invDx_, invDy_, table_, xdivs(), xmax_, xmin_, ydivs(), ymax_, and ymin_.
Referenced by Interpol2D(), setDx(), setXdivs(), and setYdivs().
void Interpol2D::setDx | ( | double | value | ) |
Definition at line 268 of file Interpol2D.cpp.
References doubleEq(), MAX_DIVS, resize(), value, xdivs(), xmax_, and xmin_.
Referenced by initCinfo().
void Interpol2D::setDy | ( | double | value | ) |
Definition at line 336 of file Interpol2D.cpp.
References doubleEq(), invDy_, MAX_DIVS, setYdivs(), value, ydivs(), ymax_, and ymin_.
Referenced by initCinfo().
void Interpol2D::setSy | ( | double | value | ) |
Definition at line 364 of file Interpol2D.cpp.
References doubleEq(), sy_, table_, and value.
void Interpol2D::setTableValue | ( | vector< unsigned int > | index, |
double | value | ||
) |
Definition at line 384 of file Interpol2D.cpp.
References table_.
Referenced by initCinfo().
void Interpol2D::setTableVector | ( | vector< vector< double > > | value | ) |
Definition at line 420 of file Interpol2D.cpp.
References invDx_, invDy_, table_, value, xdivs(), xmax_, xmin_, ydivs(), ymax_, and ymin_.
Referenced by initCinfo(), HHGate2D::setTableA(), and HHGate2D::setTableB().
void Interpol2D::setXdivs | ( | unsigned int | value | ) |
Definition at line 257 of file Interpol2D.cpp.
References resize().
Referenced by initCinfo(), HHGate2D::setXdivsA(), and HHGate2D::setXdivsB().
void Interpol2D::setXmax | ( | double | value | ) |
Definition at line 243 of file Interpol2D.cpp.
References doubleApprox(), invDx_, value, xdivs(), xmax_, and xmin_.
Referenced by initCinfo(), HHGate2D::setXmaxA(), and HHGate2D::setXmaxB().
void Interpol2D::setXmin | ( | double | value | ) |
Definition at line 229 of file Interpol2D.cpp.
References doubleApprox(), invDx_, value, xdivs(), xmax_, and xmin_.
Referenced by initCinfo(), HHGate2D::setXminA(), and HHGate2D::setXminB().
void Interpol2D::setYdivs | ( | unsigned int | value | ) |
Definition at line 321 of file Interpol2D.cpp.
References resize().
Referenced by initCinfo(), setDy(), HHGate2D::setYdivsA(), and HHGate2D::setYdivsB().
void Interpol2D::setYmax | ( | double | value | ) |
Definition at line 307 of file Interpol2D.cpp.
References doubleApprox(), invDy_, value, ydivs(), ymax_, and ymin_.
Referenced by initCinfo(), HHGate2D::setYmaxA(), and HHGate2D::setYmaxB().
void Interpol2D::setYmin | ( | double | value | ) |
Definition at line 293 of file Interpol2D.cpp.
References doubleApprox(), invDy_, value, ydivs(), ymax_, and ymin_.
Referenced by initCinfo(), HHGate2D::setYminA(), and HHGate2D::setYminB().
unsigned int Interpol2D::xdivs | ( | ) | const |
Definition at line 427 of file Interpol2D.cpp.
References table_.
Referenced by getDx(), initCinfo(), load(), resize(), setDx(), setTableVector(), setXmax(), and setXmin().
unsigned int Interpol2D::ydivs | ( | ) | const |
Definition at line 434 of file Interpol2D.cpp.
References table_.
Referenced by getDy(), initCinfo(), load(), resize(), setDy(), setTableVector(), setYmax(), and setYmin().
|
friend |
|
private |
Definition at line 105 of file Interpol2D.h.
Referenced by indexWithoutCheck(), Interpol2D(), interpolate(), load(), operator>>(), resize(), setTableVector(), setXmax(), and setXmin().
|
private |
Definition at line 108 of file Interpol2D.h.
Referenced by indexWithoutCheck(), Interpol2D(), interpolate(), invDy(), load(), operator>>(), resize(), setDy(), setTableVector(), setYmax(), and setYmin().
|
static |
Definition at line 101 of file Interpol2D.h.
|
private |
Definition at line 109 of file Interpol2D.h.
|
private |
Definition at line 110 of file Interpol2D.h.
Referenced by getTableValue(), getTableVector(), getXdivs(), getYdivs(), indexWithoutCheck(), innerLookup(), Interpol2D(), interpolate(), load(), operator<(), operator==(), operator>>(), print(), resize(), setSy(), setTableValue(), setTableVector(), xdivs(), and ydivs().
|
private |
Definition at line 104 of file Interpol2D.h.
Referenced by getDx(), getInterpolatedValue(), getXmax(), innerLookup(), Interpol2D(), load(), operator==(), operator>>(), resize(), setDx(), setTableVector(), setXmax(), and setXmin().
|
private |
Definition at line 103 of file Interpol2D.h.
Referenced by getDx(), getInterpolatedValue(), getXmin(), indexWithoutCheck(), innerLookup(), Interpol2D(), interpolate(), load(), operator==(), operator>>(), resize(), setDx(), setTableVector(), setXmax(), and setXmin().
|
private |
Definition at line 107 of file Interpol2D.h.
Referenced by getDy(), getInterpolatedValue(), getYmax(), innerLookup(), Interpol2D(), load(), operator==(), operator>>(), resize(), setDy(), setTableVector(), setYmax(), and setYmin().
|
private |
Definition at line 106 of file Interpol2D.h.
Referenced by getDy(), getInterpolatedValue(), getYmin(), indexWithoutCheck(), innerLookup(), Interpol2D(), interpolate(), load(), operator==(), operator>>(), resize(), setDy(), setTableVector(), setYmax(), and setYmin().