#include <mcdistribution.h>
Public Member Functions | |
IrregularFunction1D (float *aX, float *aFx, int aN) | |
~IrregularFunction1D () | |
float | Eval (float x) const |
int | IndexOf (float x, float *d) const |
Private Attributes | |
float * | xFunc |
float * | yFunc |
int | count |
A utility class for evaluating an irregularly sampled 1D function.
Definition at line 144 of file mcdistribution.h.
lux::IrregularFunction1D::IrregularFunction1D | ( | float * | aX, | |
float * | aFx, | |||
int | aN | |||
) | [inline] |
Creates a 1D function from the given data. It is assumed that the given x values are ordered, starting with the smallest value. The function value is clamped at the edges. It is assumed there are no duplicate sample locations.
aX | The sample locations of the function. | |
aFx | The values of the function. | |
aN | The number of samples. |
Definition at line 156 of file mcdistribution.h.
lux::IrregularFunction1D::~IrregularFunction1D | ( | ) | [inline] |
Definition at line 164 of file mcdistribution.h.
float lux::IrregularFunction1D::Eval | ( | float | x | ) | const [inline] |
Evaluates the function at the given position.
x | The x value to evaluate the function at. |
Definition at line 176 of file mcdistribution.h.
References count, cimg_library::cimg::max(), xFunc, and yFunc.
Referenced by lux::IESSphericalFunction::IESSphericalFunction().
int lux::IrregularFunction1D::IndexOf | ( | float | x, | |
float * | d | |||
) | const [inline] |
Returns the index of the given position.
x | The x value to get the index of. | |
d | The address to store the offset from the index in. |
Definition at line 198 of file mcdistribution.h.
Referenced by lux::IESSphericalFunction::IESSphericalFunction().
int lux::IrregularFunction1D::count [private] |
Definition at line 224 of file mcdistribution.h.
Referenced by Eval(), IndexOf(), and IrregularFunction1D().
float* lux::IrregularFunction1D::xFunc [private] |
Definition at line 220 of file mcdistribution.h.
Referenced by Eval(), IndexOf(), IrregularFunction1D(), and ~IrregularFunction1D().
float * lux::IrregularFunction1D::yFunc [private] |
Definition at line 220 of file mcdistribution.h.
Referenced by Eval(), IrregularFunction1D(), and ~IrregularFunction1D().