#include <OpenMS/MATH/MISC/BilinearInterpolation.h>
The input is just a vector of values ("Data"). These are interpreted as the y-coordinates at the x-coordinate positions 0,...,data_.size-1.
The interpolated data can also be scaled and shifted in the x-dimension by an affine mapping. That is, we have "inside" and "outside" x-coordinates. The affine mapping can be specified in two ways:
Using the value() and derivative() methods you can sample bilinearly interpolated values for a given x-coordinate position of the data and the derivative of the data.
Public Types | |
Typedefs | |
typedef Value | value_type |
typedef Key | key_type |
typedef Matrix< value_type > | container_type |
typedef value_type | ValueType |
typedef key_type | KeyType |
typedef container_type | ContainerType |
Public Member Functions | |
BilinearInterpolation () | |
Constructors and destructor. | |
BilinearInterpolation (BilinearInterpolation const &arg) | |
Copy constructor. | |
BilinearInterpolation & | operator= (BilinearInterpolation const &arg) |
Assignment operator. | |
~BilinearInterpolation () | |
Destructor. | |
Interpolated data | |
ValueType | value (KeyType arg_pos_0, KeyType arg_pos_1) const |
Returns the interpolated value ("backward resampling"). | |
void | addValue (KeyType arg_pos_0, KeyType arg_pos_1, ValueType arg_value) |
Performs bilinear resampling. The arg_value is split up and added to the data points around arg_pos. ("forward resampling"). | |
Discrete (non-interpolated) data | |
ContainerType & | getData () |
Returns the internal random access container storing the data. | |
ContainerType const & | getData () const |
Returns the internal random access container storing the data. | |
template<typename SourceContainer> | |
void | setData (SourceContainer const &data) |
Assigns data to the internal random access container storing the data. | |
bool | empty () const |
Returns true if getData() is empty. | |
Transformation | |
KeyType | key2index_0 (KeyType pos) const |
The transformation from "outside" to "inside" coordinates. | |
KeyType | index2key_0 (KeyType pos) const |
The transformation from "inside" to "outside" coordinates. | |
KeyType | key2index_1 (KeyType pos) const |
The transformation from "outside" to "inside" coordinates. | |
KeyType | index2key_1 (KeyType pos) const |
The transformation from "inside" to "outside" coordinates. | |
KeyType const & | getScale_0 () const |
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data". | |
KeyType const & | getScale_1 () const |
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data". | |
void | setScale_0 (KeyType const &scale) |
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data". | |
void | setScale_1 (KeyType const &scale) |
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data". | |
KeyType const & | getOffset_0 () const |
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)". | |
KeyType const & | getOffset_1 () const |
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)". | |
void | setOffset_0 (KeyType const &offset) |
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)". | |
void | setOffset_1 (KeyType const &offset) |
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)". | |
void | setMapping_0 (KeyType const &scale, KeyType const &inside_low, KeyType const &outside_low) |
Specifies the mapping from "outside" to "inside" coordinates by the following data:
| |
void | setMapping_0 (KeyType const &inside_low, KeyType const &outside_low, KeyType const &inside_high, KeyType const &outside_high) |
Specifies the mapping from "outside" to "inside" coordinates by the following data:
| |
void | setMapping_1 (KeyType const &scale, KeyType const &inside_low, KeyType const &outside_low) |
Specifies the mapping from "outside" to "inside" coordinates by the following data:
| |
void | setMapping_1 (KeyType const &inside_low, KeyType const &outside_low, KeyType const &inside_high, KeyType const &outside_high) |
Specifies the mapping from "outside" to "inside" coordinates by the following data:
| |
KeyType const & | getInsideReferencePoint_0 () const |
Accessor. See setMapping(). | |
KeyType const & | getInsideReferencePoint_1 () const |
Accessor. See setMapping(). | |
KeyType const & | getOutsideReferencePoint_0 () const |
Accessor. See setMapping(). | |
KeyType const & | getOutsideReferencePoint_1 () const |
Accessor. See setMapping(). | |
KeyType | supportMin_0 () const |
Lower boundary of the support, in "outside" coordinates. | |
KeyType | supportMin_1 () const |
Lower boundary of the support, in "outside" coordinates. | |
KeyType | supportMax_0 () const |
Upper boundary of the support, in "outside" coordinates. | |
KeyType | supportMax_1 () const |
Upper boundary of the support, in "outside" coordinates. | |
Protected Attributes | |
KeyType | scale_0_ |
Data members. | |
KeyType | offset_0_ |
KeyType | scale_1_ |
KeyType | offset_1_ |
KeyType | inside_0_ |
KeyType | outside_0_ |
KeyType | inside_1_ |
KeyType | outside_1_ |
ContainerType | data_ |
typedef Value value_type |
typedef Key key_type |
typedef Matrix< value_type > container_type |
typedef value_type ValueType |
typedef container_type ContainerType |
BilinearInterpolation | ( | ) | [inline] |
Constructors and destructor.
Default constructor
BilinearInterpolation | ( | BilinearInterpolation< Key, Value > const & | arg | ) | [inline] |
Copy constructor.
~BilinearInterpolation | ( | ) | [inline] |
Destructor.
BilinearInterpolation& operator= | ( | BilinearInterpolation< Key, Value > const & | arg | ) | [inline] |
Assignment operator.
Returns the interpolated value ("backward resampling").
Performs bilinear resampling. The arg_value is split up and added to the data points around arg_pos. ("forward resampling").
ContainerType& getData | ( | ) | [inline] |
Returns the internal random access container storing the data.
ContainerType const& getData | ( | ) | const [inline] |
Returns the internal random access container storing the data.
void setData | ( | SourceContainer const & | data | ) | [inline] |
Assigns data to the internal random access container storing the data.
SourceContainer must be assignable to ContainerType.
bool empty | ( | ) | const [inline] |
Returns true
if getData() is empty.
The transformation from "outside" to "inside" coordinates.
The transformation from "inside" to "outside" coordinates.
The transformation from "outside" to "inside" coordinates.
The transformation from "inside" to "outside" coordinates.
KeyType const& getScale_0 | ( | ) | const [inline] |
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
KeyType const& getScale_1 | ( | ) | const [inline] |
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
void setScale_0 | ( | KeyType const & | scale | ) | [inline] |
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Note: Using this invalidates the inside and outside reference points.
void setScale_1 | ( | KeyType const & | scale | ) | [inline] |
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Note: Using this invalidates the inside and outside reference points.
KeyType const& getOffset_0 | ( | ) | const [inline] |
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)".
KeyType const& getOffset_1 | ( | ) | const [inline] |
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)".
void setOffset_0 | ( | KeyType const & | offset | ) | [inline] |
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)".
Note: Using this invalidates the inside and outside reference points.
void setOffset_1 | ( | KeyType const & | offset | ) | [inline] |
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,0)".
Note: Using this invalidates the inside and outside reference points.
void setMapping_0 | ( | KeyType const & | scale, | |
KeyType const & | inside_low, | |||
KeyType const & | outside_low | |||
) | [inline] |
Specifies the mapping from "outside" to "inside" coordinates by the following data:
scale
: the difference in outside coordinates between consecutive values in the data vector.inside
and outside
: these axis positions are mapped onto each other. For example, when you have a complicated probability distribution which is in fact centered around zero (but you cannot have negative indices in the data vector), then you can arrange things such that inside is the mean of the pre-computed, shifted density values of that distribution and outside is the centroid position of, say, a peak in the real world which you want to model by a scaled and shifted version of the probability distribution.
void setMapping_0 | ( | KeyType const & | inside_low, | |
KeyType const & | outside_low, | |||
KeyType const & | inside_high, | |||
KeyType const & | outside_high | |||
) | [inline] |
Specifies the mapping from "outside" to "inside" coordinates by the following data:
inside_low
and outside_low
: these axis positions are mapped onto each other.inside_high
and outside_high
: these axis positions are mapped onto each other. This four argument version is just a convenience overload for the three argument version, which see.
void setMapping_1 | ( | KeyType const & | scale, | |
KeyType const & | inside_low, | |||
KeyType const & | outside_low | |||
) | [inline] |
Specifies the mapping from "outside" to "inside" coordinates by the following data:
scale
: the difference in outside coordinates between consecutive values in the data vector.inside
and outside
: these axis positions are mapped onto each other. For example, when you have a complicated probability distribution which is in fact centered around zero (but you cannot have negative indices in the data vector), then you can arrange things such that inside is the mean of the pre-computed, shifted density values of that distribution and outside is the centroid position of, say, a peak in the real world which you want to model by a scaled and shifted version of the probability distribution.
void setMapping_1 | ( | KeyType const & | inside_low, | |
KeyType const & | outside_low, | |||
KeyType const & | inside_high, | |||
KeyType const & | outside_high | |||
) | [inline] |
Specifies the mapping from "outside" to "inside" coordinates by the following data:
inside_low
and outside_low
: these axis positions are mapped onto each other.inside_high
and outside_high
: these axis positions are mapped onto each other. This four argument version is just a convenience overload for the three argument version, which see.
KeyType const& getInsideReferencePoint_0 | ( | ) | const [inline] |
Accessor. See setMapping().
KeyType const& getInsideReferencePoint_1 | ( | ) | const [inline] |
Accessor. See setMapping().
KeyType const& getOutsideReferencePoint_0 | ( | ) | const [inline] |
Accessor. See setMapping().
KeyType const& getOutsideReferencePoint_1 | ( | ) | const [inline] |
Accessor. See setMapping().
KeyType supportMin_0 | ( | ) | const [inline] |
Lower boundary of the support, in "outside" coordinates.
KeyType supportMin_1 | ( | ) | const [inline] |
Lower boundary of the support, in "outside" coordinates.
KeyType supportMax_0 | ( | ) | const [inline] |
Upper boundary of the support, in "outside" coordinates.
KeyType supportMax_1 | ( | ) | const [inline] |
Upper boundary of the support, in "outside" coordinates.
KeyType outside_0_ [protected] |
KeyType outside_1_ [protected] |
ContainerType data_ [protected] |
Generated Tue Apr 1 15:36:49 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |