|
OpenMS
2.6.0
|
Go to the documentation of this file.
71 template <
typename Key =
double,
typename Value = Key>
181 return data_(0, 0) * (1. + pos_0) * (1. + pos_1);
186 if (lower_1 >= size_1 - 1)
188 if (lower_1 != size_1 - 1)
194 return data_(0, lower_1) * (1. + pos_0) * (size_1 - pos_1);
202 data_(0, lower_1 + 1) * factor_1 +
203 data_(0, lower_1) * factor_1_complement
209 if (lower_0 >= size_0 - 1)
211 if (lower_0 != size_0 - 1)
225 return data_(lower_0, 0) * (size_0 - pos_0) * (1. + pos_1);
230 if (lower_1 >= size_1 - 1)
232 if (lower_1 != size_1 - 1)
238 return data_(lower_0, lower_1) * (size_0 - pos_0) * (size_1 - pos_1);
246 data_(lower_0, lower_1 + 1) * factor_1 +
247 data_(lower_0, lower_1) * factor_1_complement
268 data_(lower_0 + 1, 0) * factor_0
270 data_(lower_0, 0) * factor_0_complement
277 if (lower_1 >= size_1 - 1)
279 if (lower_1 != size_1 - 1)
286 data_(lower_0 + 1, lower_1) * factor_0
288 data_(lower_0, lower_1) * factor_0_complement
298 data_(lower_0 + 1, lower_1 + 1) * factor_0
300 data_(lower_0, lower_1 + 1) * factor_0_complement
305 data_(lower_0 + 1, lower_1) * factor_0
307 data_(lower_0, lower_1) * factor_0_complement
309 * factor_1_complement;
324 KeyType const frac_0 = std::modf(pos_0, &lower_0_key);
325 DiffType
const lower_0 = DiffType(lower_0_key);
338 KeyType const frac_1 = std::modf(pos_1, &lower_1_key);
339 DiffType
const lower_1 = DiffType(lower_1_key);
350 data_(0, 0) += arg_value * (1 + frac_0) * (1 + frac_1);
356 DiffType
const back_1 =
data_.
cols() - 1;
358 if (lower_1 >= back_1)
360 if (lower_1 != back_1)
366 data_(0, lower_1) += arg_value * (1 + frac_0) * (1 - frac_1);
374 data_(0, lower_1 + 1) += tmp_prod * frac_1;
375 data_(0, lower_1) += tmp_prod * (1. - frac_1);
383 DiffType
const back_0 =
data_.
rows() - 1;
384 if (lower_0 >= back_0)
386 if (lower_0 != back_0)
398 KeyType const frac_1 = std::modf(pos_1, &lower_1_key);
399 DiffType
const lower_1 = DiffType(lower_1_key);
410 data_(lower_0, 0) += tmp_prod * (1 + frac_1);
416 DiffType
const back_1 =
data_.
cols() - 1;
418 if (lower_1 >= back_1)
420 if (lower_1 != back_1)
426 data_(lower_0, lower_1) += tmp_prod * (1 - frac_1);
433 data_(lower_0, lower_1 + 1) += tmp_prod * frac_1;
434 data_(lower_0, lower_1) += tmp_prod * (1 - frac_1);
448 KeyType const frac_1 = std::modf(pos_1, &lower_1_key);
449 DiffType
const lower_1 = DiffType(lower_1_key);
461 data_(lower_0 + 1, 0) += tmp_prod * frac_0;
462 data_(lower_0, 0) += tmp_prod * (1 - frac_0);
468 DiffType
const back_1 =
data_.
cols() - 1;
470 if (lower_1 >= back_1)
472 if (lower_1 != back_1)
479 data_(lower_0 + 1, lower_1) += tmp_prod * frac_0;
480 data_(lower_0, lower_1) += tmp_prod * (1 - frac_0);
490 data_(lower_0 + 1, lower_1 + 1) += tmp_prod * frac_1;
491 data_(lower_0 + 1, lower_1) += tmp_prod * (1 - frac_1);
492 tmp_prod =
KeyType(arg_value * (1 - frac_0));
493 data_(lower_0, lower_1 + 1) += tmp_prod * frac_1;
494 data_(lower_0, lower_1) += tmp_prod * (1 - frac_1);
526 template <
typename SourceContainer>
535 return data_.empty();
675 offset_0_ = outside_low - scale * inside_low;
688 if (inside_high != inside_low)
690 setMapping_0((outside_high - outside_low) / (inside_high - inside_low),
691 inside_low, outside_low);
718 offset_1_ = outside_low - scale * inside_low;
731 if (inside_high != inside_low)
733 setMapping_1((outside_high - outside_low) / (inside_high - inside_low),
734 inside_low, outside_low);
KeyType supportMin_0() const
Lower boundary of the support, in "outside" coordinates.
Definition: BilinearInterpolation.h:768
KeyType outside_1_
Definition: BilinearInterpolation.h:804
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:
Definition: BilinearInterpolation.h:685
KeyType key2index_1(KeyType pos) const
The transformation from "outside" to "inside" coordinates.
Definition: BilinearInterpolation.h:569
ContainerType data_
Definition: BilinearInterpolation.h:805
KeyType scale_1_
Definition: BilinearInterpolation.h:799
KeyType offset_1_
Definition: BilinearInterpolation.h:800
BilinearInterpolation(BilinearInterpolation const &arg)
Copy constructor.
Definition: BilinearInterpolation.h:109
void setData(SourceContainer const &data)
Assigns data to the internal random access container storing the data.
Definition: BilinearInterpolation.h:527
KeyType scale_0_
Data members.
Definition: BilinearInterpolation.h:797
KeyType supportMax_1() const
Upper boundary of the support, in "outside" coordinates.
Definition: BilinearInterpolation.h:786
KeyType offset_0_
Definition: BilinearInterpolation.h:798
const KeyType & getInsideReferencePoint_1() const
Accessor. See setMapping().
Definition: BilinearInterpolation.h:750
bool empty() const
Returns true if getData() is empty.
Definition: BilinearInterpolation.h:533
KeyType supportMax_0() const
Upper boundary of the support, in "outside" coordinates.
Definition: BilinearInterpolation.h:780
BilinearInterpolation()
Constructors and destructor.
Definition: BilinearInterpolation.h:96
KeyType index2key_1(KeyType pos) const
The transformation from "inside" to "outside" coordinates.
Definition: BilinearInterpolation.h:584
Value value_type
Definition: BilinearInterpolation.h:79
Key key_type
Definition: BilinearInterpolation.h:81
void setOffset_0(KeyType const &offset)
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,...
Definition: BilinearInterpolation.h:641
Provides access to bilinearly interpolated values (and derivatives) from discrete data points....
Definition: BilinearInterpolation.h:72
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
SizeType cols() const
Number of columns.
Definition: Matrix.h:264
A two-dimensional matrix. Similar to std::vector, but uses a binary operator(,) for element access.
Definition: IsobaricQuantitationMethod.h:49
BilinearInterpolation & operator=(BilinearInterpolation const &arg)
Assignment operator.
Definition: BilinearInterpolation.h:122
const KeyType & getOutsideReferencePoint_1() const
Accessor. See setMapping().
Definition: BilinearInterpolation.h:762
SizeType rows() const
Number of rows.
Definition: Matrix.h:258
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:
Definition: BilinearInterpolation.h:728
const KeyType & getScale_0() const
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Definition: BilinearInterpolation.h:592
void setOffset_1(KeyType const &offset)
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,...
Definition: BilinearInterpolation.h:652
ContainerType & getData()
Returns the internal random access container storing the data.
Definition: BilinearInterpolation.h:510
const KeyType & getScale_1() const
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Definition: BilinearInterpolation.h:598
key_type KeyType
Definition: BilinearInterpolation.h:85
value_type ValueType
Definition: BilinearInterpolation.h:84
const ContainerType & getData() const
Returns the internal random access container storing the data.
Definition: BilinearInterpolation.h:516
const KeyType & getOffset_0() const
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,...
Definition: BilinearInterpolation.h:624
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:
Definition: BilinearInterpolation.h:713
const KeyType & getOffset_1() const
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,...
Definition: BilinearInterpolation.h:630
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....
Definition: BilinearInterpolation.h:316
container_type ContainerType
Definition: BilinearInterpolation.h:86
KeyType inside_0_
Definition: BilinearInterpolation.h:801
const KeyType & getInsideReferencePoint_0() const
Accessor. See setMapping().
Definition: BilinearInterpolation.h:744
KeyType inside_1_
Definition: BilinearInterpolation.h:803
KeyType key2index_0(KeyType pos) const
The transformation from "outside" to "inside" coordinates.
Definition: BilinearInterpolation.h:546
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
ValueType value(KeyType arg_pos_0, KeyType arg_pos_1) const
Returns the interpolated value ("backward resampling")
Definition: BilinearInterpolation.h:151
const KeyType & getOutsideReferencePoint_0() const
Accessor. See setMapping().
Definition: BilinearInterpolation.h:756
KeyType index2key_0(KeyType pos) const
The transformation from "inside" to "outside" coordinates.
Definition: BilinearInterpolation.h:561
Base::difference_type difference_type
Definition: Matrix.h:87
~BilinearInterpolation()
Destructor.
Definition: BilinearInterpolation.h:140
Matrix< value_type > container_type
Definition: BilinearInterpolation.h:82
void setScale_0(KeyType const &scale)
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Definition: BilinearInterpolation.h:608
KeyType supportMin_1() const
Lower boundary of the support, in "outside" coordinates.
Definition: BilinearInterpolation.h:774
KeyType outside_0_
Definition: BilinearInterpolation.h:802
void setScale_1(KeyType const &scale)
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Definition: BilinearInterpolation.h:618
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:
Definition: BilinearInterpolation.h:670