My Project
|
Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y grid. More...
#include <UniformTabulated2DFunction.hpp>
Public Member Functions | |
UniformTabulated2DFunction (Scalar minX, Scalar maxX, unsigned m, Scalar minY, Scalar maxY, unsigned n) | |
Constructor where the tabulation parameters are already provided. | |
UniformTabulated2DFunction (Scalar minX, Scalar maxX, unsigned m, Scalar minY, Scalar maxY, unsigned n, const std::vector< std::vector< Scalar >> &vals) | |
void | resize (Scalar minX, Scalar maxX, unsigned m, Scalar minY, Scalar maxY, unsigned n) |
Resize the tabulation to a new range. | |
Scalar | xMin () const |
Returns the minimum of the X coordinate of the sampling points. | |
Scalar | xMax () const |
Returns the maximum of the X coordinate of the sampling points. | |
Scalar | yMin () const |
Returns the minimum of the Y coordinate of the sampling points. | |
Scalar | yMax () const |
Returns the maximum of the Y coordinate of the sampling points. | |
unsigned | numX () const |
Returns the number of sampling points in X direction. | |
unsigned | numY () const |
Returns the number of sampling points in Y direction. | |
Scalar | iToX (unsigned i) const |
Return the position on the x-axis of the i-th interval. | |
Scalar | jToY (unsigned j) const |
Return the position on the y-axis of the j-th interval. | |
template<class Evaluation > | |
Evaluation | xToI (const Evaluation &x) const |
Return the interval index of a given position on the x-axis. More... | |
template<class Evaluation > | |
Evaluation | yToJ (const Evaluation &y) const |
Return the interval index of a given position on the y-axis. More... | |
template<class Evaluation > | |
bool | applies (const Evaluation &x, const Evaluation &y) const |
Returns true iff a coordinate lies in the tabulated range. | |
template<class Evaluation > | |
Evaluation | eval (const Evaluation &x, const Evaluation &y, bool extrapolate) const |
Evaluate the function at a given (x,y) position. More... | |
Scalar | getSamplePoint (unsigned i, unsigned j) const |
Get the value of the sample point which is at the intersection of the ![]() ![]() | |
void | setSamplePoint (unsigned i, unsigned j, Scalar value) |
Set the value of the sample point which is at the intersection of the ![]() ![]() | |
bool | operator== (const UniformTabulated2DFunction< Scalar > &data) const |
Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y grid.
This class can be used when the sampling points are calculated at run time.
|
inline |
Evaluate the function at a given (x,y) position.
x | x-position |
y | y-position |
extrapolate | Whether to extrapolate for untabulated values. If false then an exception might be thrown. |
|
inline |
Return the interval index of a given position on the x-axis.
This method returns a floating point number. The integer part should be interpreted as interval, the decimal places are the position of the x value between the i-th and the (i+1)-th sample point.
|
inline |
Return the interval index of a given position on the y-axis.
This method returns a floating point number. The integer part should be interpreted as interval, the decimal places are the position of the y value between the j-th and the (j+1)-th sample point.