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);
Provides access to bilinearly interpolated values (and derivatives) from discrete data points....
Definition: BilinearInterpolation.h:73
KeyType const & getOffset_1() const
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,...
Definition: BilinearInterpolation.h:630
ContainerType const & getData() const
Returns the internal random access container storing the data.
Definition: BilinearInterpolation.h:516
Value value_type
Definition: BilinearInterpolation.h:79
KeyType supportMin_1() const
Lower boundary of the support, in "outside" coordinates.
Definition: BilinearInterpolation.h:774
ValueType value(KeyType arg_pos_0, KeyType arg_pos_1) const
Returns the interpolated value ("backward resampling")
Definition: BilinearInterpolation.h:151
KeyType const & getOffset_0() const
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,...
Definition: BilinearInterpolation.h:624
Key key_type
Definition: BilinearInterpolation.h:81
Matrix< value_type > container_type
Definition: BilinearInterpolation.h:82
ContainerType data_
Definition: BilinearInterpolation.h:805
container_type ContainerType
Definition: BilinearInterpolation.h:86
void setData(SourceContainer const &data)
Assigns data to the internal random access container storing the data.
Definition: BilinearInterpolation.h:527
KeyType outside_0_
Definition: BilinearInterpolation.h:802
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
KeyType supportMax_1() const
Upper boundary of the support, in "outside" coordinates.
Definition: BilinearInterpolation.h:786
BilinearInterpolation & operator=(BilinearInterpolation const &arg)
Assignment operator.
Definition: BilinearInterpolation.h:122
KeyType inside_1_
Definition: BilinearInterpolation.h:803
BilinearInterpolation(BilinearInterpolation const &arg)
Copy constructor.
Definition: BilinearInterpolation.h:109
KeyType const & getScale_1() const
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Definition: BilinearInterpolation.h:598
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
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
KeyType const & getOutsideReferencePoint_1() const
Accessor. See setMapping().
Definition: BilinearInterpolation.h:762
void setOffset_1(KeyType const &offset)
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,...
Definition: BilinearInterpolation.h:652
KeyType const & getOutsideReferencePoint_0() const
Accessor. See setMapping().
Definition: BilinearInterpolation.h:756
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
KeyType const & getInsideReferencePoint_1() const
Accessor. See setMapping().
Definition: BilinearInterpolation.h:750
value_type ValueType
Definition: BilinearInterpolation.h:84
KeyType scale_1_
Definition: BilinearInterpolation.h:799
BilinearInterpolation()
Constructors and destructor.
Definition: BilinearInterpolation.h:96
KeyType const & getInsideReferencePoint_0() const
Accessor. See setMapping().
Definition: BilinearInterpolation.h:744
KeyType index2key_0(KeyType pos) const
The transformation from "inside" to "outside" coordinates.
Definition: BilinearInterpolation.h:561
KeyType offset_0_
Definition: BilinearInterpolation.h:798
KeyType scale_0_
Data members.
Definition: BilinearInterpolation.h:797
KeyType inside_0_
Definition: BilinearInterpolation.h:801
ContainerType & getData()
Returns the internal random access container storing the data.
Definition: BilinearInterpolation.h:510
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
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
key_type KeyType
Definition: BilinearInterpolation.h:85
KeyType offset_1_
Definition: BilinearInterpolation.h:800
~BilinearInterpolation()
Destructor.
Definition: BilinearInterpolation.h:140
KeyType outside_1_
Definition: BilinearInterpolation.h:804
void setScale_1(KeyType const &scale)
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Definition: BilinearInterpolation.h:618
KeyType key2index_1(KeyType pos) const
The transformation from "outside" to "inside" coordinates.
Definition: BilinearInterpolation.h:569
void setOffset_0(KeyType const &offset)
Accessor. "Offset" is the point (in "outside" units) which corresponds to "Data(0,...
Definition: BilinearInterpolation.h:641
KeyType index2key_1(KeyType pos) const
The transformation from "inside" to "outside" coordinates.
Definition: BilinearInterpolation.h:584
KeyType const & getScale_0() const
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Definition: BilinearInterpolation.h:592
KeyType supportMin_0() const
Lower boundary of the support, in "outside" coordinates.
Definition: BilinearInterpolation.h:768
KeyType key2index_0(KeyType pos) const
The transformation from "outside" to "inside" coordinates.
Definition: BilinearInterpolation.h:546
void setScale_0(KeyType const &scale)
Accessor. "Scale" is the difference (in "outside" units) between consecutive entries in "Data".
Definition: BilinearInterpolation.h:608
A two-dimensional matrix. Similar to std::vector, but uses a binary operator(,) for element access.
Definition: Matrix.h:77
SizeType rows() const
Number of rows.
Definition: Matrix.h:258
Base::difference_type difference_type
Definition: Matrix.h:87
SizeType cols() const
Number of columns.
Definition: Matrix.h:264
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:134
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48