|
OpenMS
2.6.0
|
Go to the documentation of this file.
52 template <UInt D,
typename TCoordinateType =
double>
115 std::move(std::begin(rhs.coordinate_), std::end(rhs.coordinate_), &
coordinate_[0]);
121 OPENMS_PRECONDITION(D == 2,
"DPosition<D, TCoordinateType>:DPosition(x,y): index overflow!");
129 if (&source ==
this)
return *
this;
145 OPENMS_PRECONDITION(index < D,
"DPosition<D,TCoordinateType>:operator [] (Position): index overflow!");
152 OPENMS_PRECONDITION(index < D,
"DPosition<D,TCoordinateType>:operator [] (Position): index overflow!");
187 for (
Size i = 0; i < D; i++)
189 #pragma clang diagnostic push
190 #pragma clang diagnostic ignored "-Wfloat-equal"
193 #pragma clang diagnostic pop
210 for (
Size i = 0; i < D; i++)
222 for (
Size i = 0; i < D; i++)
234 for (
Size i = 0; i < D; i++)
244 for (
Size i = 0; i < D; i++)
267 for (
Size i = 0; i < D; ++i)
277 for (
Size i = 0; i < D; ++i)
288 for (
Size i = 0; i < D; ++i)
298 for (
Size i = 0; i < D; ++i)
309 for (
Size i = 0; i < D; ++i)
320 for (
Size i = 0; i < D; ++i)
330 for (
Size i = 0; i < D; ++i)
340 for (
Size i = 0; i < D; ++i)
356 for (
Size i = 0; i < D; ++i)
375 return DPosition((std::numeric_limits<typename DPosition::CoordinateType>::min)());
381 return DPosition(-(std::numeric_limits<typename DPosition::CoordinateType>::max)());
387 return DPosition((std::numeric_limits<typename DPosition::CoordinateType>::max)());
426 template <UInt D,
typename TCoordinateType>
429 for (
Size i = 0; i < D; ++i)
437 template <UInt D,
typename TCoordinateType>
440 for (
Size i = 0; i < D; ++i)
448 template <UInt D,
typename TCoordinateType>
451 for (
Size i = 0; i < D; ++i)
459 template <UInt D,
typename TCoordinateType>
463 for (
UInt i = 1; i < D; ++i)
void clear()
Set all dimensions to zero.
Definition: DPosition.h:354
TCoordinateType CoordinateType
Coordinate type.
Definition: DPosition.h:58
CoordinateType getY() const
Name accessor for the second dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:164
void setX(CoordinateType c)
Name mutator for the first dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:171
bool spatiallyGreaterEqual(const DPosition &point) const
Spatially (geometrically) greater or equal operator. All coordinates must be ">=".
Definition: DPosition.h:242
DPosition(DPosition &&rhs) noexcept
Move constructor.
Definition: DPosition.h:112
DPosition< D, TCoordinateType > operator*(DPosition< D, TCoordinateType > position, typename DPosition< D, TCoordinateType >::CoordinateType scalar)
Scalar multiplication (a bit inefficient)
Definition: DPosition.h:427
bool operator==(const DPosition &point) const
Equality operator.
Definition: DPosition.h:185
CoordinateType * Iterator
Mutable iterator.
Definition: DPosition.h:60
DPosition(CoordinateType x, CoordinateType y)
Constructor only for DPosition<2> that takes two Coordinates.
Definition: DPosition.h:119
static Size size()
Returns the number of dimensions.
Definition: DPosition.h:348
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
CoordinateType getX() const
Name accessor for the first dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:157
DPosition< D, TCoordinateType > operator/(DPosition< D, TCoordinateType > position, typename DPosition< D, TCoordinateType >::CoordinateType scalar)
Scalar multiplication (a bit inefficient)
Definition: DPosition.h:449
CoordinateType * iterator
Definition: DPosition.h:75
Iterator end()
Mutable end iterator.
Definition: DPosition.h:413
DPosition & operator-=(const DPosition &point)
Subtraction.
Definition: DPosition.h:296
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:136
ConstIterator end() const
Non-mutable end iterator.
Definition: DPosition.h:401
CoordinateType * pointer
Definition: DPosition.h:74
bool spatiallyLessEqual(const DPosition &point) const
Spatially (geometrically) less or equal operator. All coordinates must be "<=".
Definition: DPosition.h:232
CoordinateType & reference
Definition: DPosition.h:73
static const DPosition minPositive()
smallest positive
Definition: DPosition.h:373
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
~DPosition()
Destructor (not-virtual as this will save a lot of space!)
Definition: DPosition.h:94
static const DPosition zero()
all zero
Definition: DPosition.h:367
bool operator>(const DPosition &point) const
Lexicographical greater than operator.
Definition: DPosition.h:252
DPosition & operator=(const DPosition &source)
Assignment operator.
Definition: DPosition.h:127
const PrecisionWrapper< FloatingPointType > precisionWrapper(const FloatingPointType rhs)
Wrapper function that sets the appropriate precision for output temporarily. The original precision i...
Definition: PrecisionWrapper.h:95
CoordinateType coordinate_[D]
Definition: DPosition.h:421
bool operator!=(const DPosition &point) const
Equality operator.
Definition: DPosition.h:199
DPosition()
Default constructor.
Definition: DPosition.h:88
const typedef CoordinateType * const_iterator
Definition: DPosition.h:76
DPosition & operator*=(CoordinateType scalar)
Scalar multiplication.
Definition: DPosition.h:328
Iterator begin()
Mutable begin iterator.
Definition: DPosition.h:407
CoordinateType value_type
Definition: DPosition.h:72
void setY(CoordinateType c)
Name mutator for the second dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:178
static const DPosition minNegative()
smallest negative
Definition: DPosition.h:379
CoordinateType operator[](Size index) const
Const accessor for the dimensions.
Definition: DPosition.h:143
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
Representation of a coordinate in D-dimensional space.
Definition: DPosition.h:53
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
DPosition(CoordinateType x)
Constructor that fills all dimensions with the value x.
Definition: DPosition.h:99
static const DPosition maxPositive()
largest positive
Definition: DPosition.h:385
DPosition operator+(const DPosition &point) const
Addition (a bit inefficient)
Definition: DPosition.h:264
Definition: DPosition.h:66
DPosition(const DPosition &pos)
Copy constructor.
Definition: DPosition.h:105
DPosition & operator+=(const DPosition &point)
Addition.
Definition: DPosition.h:275
DPosition operator-(const DPosition &point) const
Subtraction (a bit inefficient)
Definition: DPosition.h:285
ConstIterator begin() const
Non-mutable begin iterator.
Definition: DPosition.h:395
CoordinateType & operator[](Size index)
Accessor for the dimensions.
Definition: DPosition.h:150
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:561
bool operator<=(const DPosition &point) const
Lexicographical greater less or equal operator.
Definition: DPosition.h:220
bool operator>=(const DPosition &point) const
Lexicographical greater or equal operator.
Definition: DPosition.h:258
const typedef CoordinateType * ConstIterator
Non-mutable iterator.
Definition: DPosition.h:62
bool operator<(const DPosition &point) const
Lexicographical less than operator. Lexicographical comparison from dimension 0 to dimension D-1 is d...
Definition: DPosition.h:208
DPosition operator-() const
Negation (a bit inefficient)
Definition: DPosition.h:306
DPosition & operator/=(CoordinateType scalar)
Scalar division.
Definition: DPosition.h:338
CoordinateType operator*(const DPosition &point) const
Inner product.
Definition: DPosition.h:317