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)
Representation of a coordinate in D-dimensional space.
Definition: DPosition.h:54
@ DIMENSION
Definition: DPosition.h:66
CoordinateType & operator[](Size index)
Accessor for the dimensions.
Definition: DPosition.h:150
CoordinateType value_type
Definition: DPosition.h:72
bool operator==(const DPosition &point) const
Equality operator.
Definition: DPosition.h:185
Iterator begin()
Mutable begin iterator.
Definition: DPosition.h:407
DPosition operator+(const DPosition &point) const
Addition (a bit inefficient)
Definition: DPosition.h:264
static const DPosition zero()
all zero
Definition: DPosition.h:367
const CoordinateType * ConstIterator
Non-mutable iterator.
Definition: DPosition.h:62
bool operator<=(const DPosition &point) const
Lexicographical greater less or equal operator.
Definition: DPosition.h:220
DPosition()
Default constructor.
Definition: DPosition.h:88
static const DPosition maxPositive()
largest positive
Definition: DPosition.h:385
DPosition(CoordinateType x)
Constructor that fills all dimensions with the value x.
Definition: DPosition.h:99
DPosition & operator*=(CoordinateType scalar)
Scalar multiplication.
Definition: DPosition.h:328
DPosition(CoordinateType x, CoordinateType y)
Constructor only for DPosition<2> that takes two Coordinates.
Definition: DPosition.h:119
CoordinateType & reference
Definition: DPosition.h:73
CoordinateType operator[](Size index) const
Const accessor for the dimensions.
Definition: DPosition.h:143
bool spatiallyLessEqual(const DPosition &point) const
Spatially (geometrically) less or equal operator. All coordinates must be "<=".
Definition: DPosition.h:232
ConstIterator end() const
Non-mutable end iterator.
Definition: DPosition.h:401
static const DPosition minPositive()
smallest positive
Definition: DPosition.h:373
CoordinateType * iterator
Definition: DPosition.h:75
void setX(CoordinateType c)
Name mutator for the first dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:171
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
CoordinateType getY() const
Name accessor for the second dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:164
bool operator>=(const DPosition &point) const
Lexicographical greater or equal operator.
Definition: DPosition.h:258
bool operator!=(const DPosition &point) const
Equality operator.
Definition: DPosition.h:199
bool operator>(const DPosition &point) const
Lexicographical greater than operator.
Definition: DPosition.h:252
DPosition operator-(const DPosition &point) const
Subtraction (a bit inefficient)
Definition: DPosition.h:285
static const DPosition minNegative()
smallest negative
Definition: DPosition.h:379
CoordinateType getX() const
Name accessor for the first dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:157
const CoordinateType * const_iterator
Definition: DPosition.h:76
Iterator end()
Mutable end iterator.
Definition: DPosition.h:413
CoordinateType operator*(const DPosition &point) const
Inner product.
Definition: DPosition.h:317
static Size size()
Returns the number of dimensions.
Definition: DPosition.h:348
TCoordinateType CoordinateType
Coordinate type.
Definition: DPosition.h:58
DPosition & operator-=(const DPosition &point)
Subtraction.
Definition: DPosition.h:296
~DPosition()
Destructor (not-virtual as this will save a lot of space!)
Definition: DPosition.h:94
CoordinateType coordinate_[D]
Definition: DPosition.h:421
void clear()
Set all dimensions to zero.
Definition: DPosition.h:354
ConstIterator begin() const
Non-mutable begin iterator.
Definition: DPosition.h:395
bool spatiallyGreaterEqual(const DPosition &point) const
Spatially (geometrically) greater or equal operator. All coordinates must be ">=".
Definition: DPosition.h:242
CoordinateType * pointer
Definition: DPosition.h:74
CoordinateType * Iterator
Mutable iterator.
Definition: DPosition.h:60
DPosition & operator+=(const DPosition &point)
Addition.
Definition: DPosition.h:275
DPosition(DPosition &&rhs) noexcept
Move constructor.
Definition: DPosition.h:112
DPosition(const DPosition &pos)
Copy constructor.
Definition: DPosition.h:105
DPosition & operator=(const DPosition &source)
Assignment operator.
Definition: DPosition.h:127
DPosition & operator/=(CoordinateType scalar)
Scalar division.
Definition: DPosition.h:338
void setY(CoordinateType c)
Name mutator for the second dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:178
DPosition operator-() const
Negation (a bit inefficient)
Definition: DPosition.h:306
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:120
const double c
Definition: Constants.h:209
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
DPosition< D, TCoordinateType > operator*(DPosition< D, TCoordinateType > position, typename DPosition< D, TCoordinateType >::CoordinateType scalar)
Scalar multiplication (a bit inefficient)
Definition: DPosition.h:427
DPosition< D, TCoordinateType > operator/(DPosition< D, TCoordinateType > position, typename DPosition< D, TCoordinateType >::CoordinateType scalar)
Scalar multiplication (a bit inefficient)
Definition: DPosition.h:449
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
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:563