![]() |
User Manual, Developers Guide and API Documentation |
![]() |
#include <NLinear.hpp>


Public Types | |
| typedef const HyperplaneType & | ConstReference |
| Constant reference to hyperplanes. | |
| typedef std::list< CoordType > | CoordList |
| List of coordinates. | |
| typedef SuperType::CoordType | CoordType |
| Type of coordinates used in this class. | |
| typedef SuperType::DiscreteContainer | DiscreteContainer |
| Type of the container that contains the discrete (uninterpolated) values. | |
| typedef const NLinear< T, N-1, M > | HyperplaneType |
| Type of the hyperplanes. | |
| typedef SuperType::InitType | InitType |
| Type to be used in constructor. | |
Public Member Functions | |
| NLinear (const DiscreteContainer &discreteValues, const void *const universe=0, CoordList *const coords=0) | |
| Construct a NLinear interpolation object that interpolates over discreteValues. | |
| virtual ConstReference | operator[] (const CoordType &coord) const |
| Specify a coordinate to be interpolated. | |
| virtual | ~NLinear () |
| Destructor. | |
Private Types | |
| typedef Interpolation< T, N > | SuperType |
| We inherit from this class. | |
Private Attributes | |
| CoordList *const | coords |
| List of the coordinates we need to interpolate with. | |
| const bool | deleteCoords |
| Does our constructor need to destroy coords. | |
| HyperplaneType | hyperplane |
| the hyperplanes. | |
| T | Type of the values to interpolate over. | |
| N | Number of dimensions. |
Linear interpolation can easily be extended to multiple dimensions, which will be demonstrated by explaining how bilinear interpolation works:
Bilinear interpolation interpolates over two dimensions. So you get two coordinates, e.g. x=3.4 and y=2.5. Then you have to interpolate between the points Q11=(3,2), Q12=(4,2), Q21=(3,3) and Q22=(4,3) somehow. You can do this by first doing a linear interpolation between Q11 and Q12 and then Q21 and Q22, which gives you the values for two new points. Then you can do a linear interpolation between these points and here you are.
So - generally - n-linear interpolation can be done by successive linear interpolation in all dimension.
See also http://en.wikipedia.org/wiki/Bilinear_interpolation for more details.
For internal use only.
| M | Original number of dimensions. |
Definition at line 71 of file NLinear.hpp.
| typedef const HyperplaneType& wns::NLinear< T, N, M >::ConstReference |
Reimplemented from wns::container::MultiReadAccessible< T, N, R, I >.
Definition at line 101 of file NLinear.hpp.
| typedef std::list<CoordType> wns::NLinear< T, N, M >::CoordList |
Definition at line 106 of file NLinear.hpp.
| typedef SuperType::CoordType wns::NLinear< T, N, M >::CoordType |
| typedef SuperType::DiscreteContainer wns::NLinear< T, N, M >::DiscreteContainer |
| typedef const NLinear<T, N-1, M> wns::NLinear< T, N, M >::HyperplaneType |
Definition at line 96 of file NLinear.hpp.
| typedef SuperType::InitType wns::NLinear< T, N, M >::InitType |
typedef Interpolation<T, N> wns::NLinear< T, N, M >::SuperType [private] |
| wns::NLinear< T, N, M >::NLinear | ( | const DiscreteContainer & | discreteValues, | |
| const void *const | universe = 0, |
|||
| CoordList *const | coords = 0 | |||
| ) | [inline] |
| discreteValues | (in) Container that contains the values which we interpolate over. |
For internal use only.
| universe | Pointer to the discrete container specified at template recursion level M. | |
| coords | Pointer to the shared CoordList that gets constructed by operator[]. |
discreteValues is used only in the top template recursion level (M) to set universe. If universe is set to non-zero its value is passed down up to the N == 1 template.
Definition at line 133 of file NLinear.hpp.
| virtual wns::NLinear< T, N, M >::~NLinear | ( | ) | [inline, virtual] |
Definition at line 148 of file NLinear.hpp.
| virtual ConstReference wns::NLinear< T, N, M >::operator[] | ( | const CoordType & | coord | ) | const [inline, virtual] |
Interpolate with the coordinate specified by coord.
For internal use only.
We only want to create a CoordList. The real calculation and DiscreteContainer access happens at N == 1 with the help of the CoordList. This is also why we pass the original value of N (M) down to the N == 1 template, because it needs to know what type the DiscreteContainer is.
Definition at line 164 of file NLinear.hpp.
CoordList* const wns::NLinear< T, N, M >::coords [private] |
For internal use only.
This list is shared with all hyperplanes.
Definition at line 177 of file NLinear.hpp.
const bool wns::NLinear< T, N, M >::deleteCoords [private] |
HyperplaneType wns::NLinear< T, N, M >::hyperplane [private] |
1.5.5