52 template <UInt D,
typename TCoordinateType =
double>
114 OPENMS_PRECONDITION(D == 2,
"DPosition<D, TCoordinateType>:DPosition(x,y): index overflow!");
122 if (&source ==
this)
return *
this;
138 OPENMS_PRECONDITION(index < D,
"DPosition<D,TCoordinateType>:operator [] (Position): index overflow!");
145 OPENMS_PRECONDITION(index < D,
"DPosition<D,TCoordinateType>:operator [] (Position): index overflow!");
180 for (
Size i = 0; i < D; i++)
182 #pragma clang diagnostic push 183 #pragma clang diagnostic ignored "-Wfloat-equal" 186 #pragma clang diagnostic pop 203 for (
Size i = 0; i < D; i++)
215 for (
Size i = 0; i < D; i++)
227 for (
Size i = 0; i < D; i++)
237 for (
Size i = 0; i < D; i++)
260 for (
Size i = 0; i < D; ++i)
270 for (
Size i = 0; i < D; ++i)
281 for (
Size i = 0; i < D; ++i)
291 for (
Size i = 0; i < D; ++i)
302 for (
Size i = 0; i < D; ++i)
313 for (
Size i = 0; i < D; ++i)
323 for (
Size i = 0; i < D; ++i)
333 for (
Size i = 0; i < D; ++i)
349 for (
Size i = 0; i < D; ++i)
368 return DPosition((std::numeric_limits<typename DPosition::CoordinateType>::min)());
374 return DPosition(-(std::numeric_limits<typename DPosition::CoordinateType>::max)());
380 return DPosition((std::numeric_limits<typename DPosition::CoordinateType>::max)());
419 template <UInt D,
typename TCoordinateType>
422 for (
Size i = 0; i < D; ++i)
430 template <UInt D,
typename TCoordinateType>
433 for (
Size i = 0; i < D; ++i)
441 template <UInt D,
typename TCoordinateType>
444 for (
Size i = 0; i < D; ++i)
452 template <UInt D,
typename TCoordinateType>
453 std::ostream& operator<<(std::ostream& os, const DPosition<D, TCoordinateType>& pos)
456 for (
UInt i = 1; i < D; ++i)
const CoordinateType * const_iterator
Definition: DPosition.h:76
CoordinateType operator*(const DPosition &point) const
Inner product.
Definition: DPosition.h:310
DPosition operator+(const DPosition &point) const
Addition (a bit inefficient)
Definition: DPosition.h:257
bool operator!=(const DPosition &point) const
Equality operator.
Definition: DPosition.h:192
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:561
Iterator begin()
Mutable begin iterator.
Definition: DPosition.h:400
#define OPENMS_PRECONDITION(condition, message)
Precondition macro.
Definition: openms/include/OpenMS/CONCEPT/Macros.h:106
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
bool operator<(const DPosition &point) const
Lexicographical less than operator. Lexicographical comparison from dimension 0 to dimension D-1 is d...
Definition: DPosition.h:201
Definition: DPosition.h:66
DPosition(CoordinateType x, CoordinateType y)
Constructor only for DPosition<2> that takes two Coordinates.
Definition: DPosition.h:112
DPosition & operator*=(CoordinateType scalar)
Scalar multiplication.
Definition: DPosition.h:321
DPosition operator-() const
Negation (a bit inefficient)
Definition: DPosition.h:299
CoordinateType * Iterator
Mutable iterator.
Definition: DPosition.h:60
void clear()
Set all dimensions to zero.
Definition: DPosition.h:347
DPosition< D, TCoordinateType > operator/(DPosition< D, TCoordinateType > position, typename DPosition< D, TCoordinateType >::CoordinateType scalar)
Scalar multiplication (a bit inefficient)
Definition: DPosition.h:442
const CoordinateType * ConstIterator
Non-mutable iterator.
Definition: DPosition.h:62
CoordinateType getY() const
Name accessor for the second dimension. Only for DPosition<2>, for visualization. ...
Definition: DPosition.h:157
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
void setY(CoordinateType c)
Name mutator for the second dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:171
DPosition & operator+=(const DPosition &point)
Addition.
Definition: DPosition.h:268
static Size size()
Returns the number of dimensions.
Definition: DPosition.h:341
static const DPosition minPositive()
smallest positive
Definition: DPosition.h:366
DPosition(const DPosition &pos)
Copy constructor.
Definition: DPosition.h:105
CoordinateType * pointer
Definition: DPosition.h:74
DPosition operator-(const DPosition &point) const
Subtraction (a bit inefficient)
Definition: DPosition.h:278
bool spatiallyLessEqual(const DPosition &point) const
Spatially (geometrically) less or equal operator. All coordinates must be "<=".
Definition: DPosition.h:225
CoordinateType getX() const
Name accessor for the first dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:150
CoordinateType & operator[](Size index)
Accessor for the dimensions.
Definition: DPosition.h:143
bool spatiallyGreaterEqual(const DPosition &point) const
Spatially (geometrically) greater or equal operator. All coordinates must be ">=".
Definition: DPosition.h:235
CoordinateType * iterator
Definition: DPosition.h:75
CoordinateType coordinate_[D]
Definition: DPosition.h:414
const PrecisionWrapper< FloatingPointType > precisionWrapper(const FloatingPointType rhs)
Wrapper function that sets the appropriate precision for output temporarily. The original precision i...
Definition: PrecisionWrapper.h:96
void setX(CoordinateType c)
Name mutator for the first dimension. Only for DPosition<2>, for visualization.
Definition: DPosition.h:164
Representation of a coordinate in D-dimensional space.
Definition: DPosition.h:53
static const DPosition zero()
all zero
Definition: DPosition.h:360
DPosition< D, TCoordinateType > operator*(DPosition< D, TCoordinateType > position, typename DPosition< D, TCoordinateType >::CoordinateType scalar)
Scalar multiplication (a bit inefficient)
Definition: DPosition.h:420
bool operator>=(const DPosition &point) const
Lexicographical greater or equal operator.
Definition: DPosition.h:251
~DPosition()
Destructor (not-virtual as this will save a lot of space!)
Definition: DPosition.h:94
DPosition & operator/=(CoordinateType scalar)
Scalar division.
Definition: DPosition.h:331
bool operator==(const DPosition &point) const
Equality operator.
Definition: DPosition.h:178
DPosition & operator-=(const DPosition &point)
Subtraction.
Definition: DPosition.h:289
DPosition()
Default constructor.
Definition: DPosition.h:88
CoordinateType value_type
Definition: DPosition.h:72
ConstIterator begin() const
Non-mutable begin iterator.
Definition: DPosition.h:388
static const DPosition maxPositive()
largest positive
Definition: DPosition.h:378
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
DPosition & operator=(const DPosition &source)
Assignment operator.
Definition: DPosition.h:120
Iterator end()
Mutable end iterator.
Definition: DPosition.h:406
static const DPosition minNegative()
smallest negative
Definition: DPosition.h:372
CoordinateType & reference
Definition: DPosition.h:73
bool operator<=(const DPosition &point) const
Lexicographical greater less or equal operator.
Definition: DPosition.h:213
DPosition(CoordinateType x)
Constructor that fills all dimensions with the value x.
Definition: DPosition.h:99
TCoordinateType CoordinateType
Coordinate type.
Definition: DPosition.h:58
bool operator>(const DPosition &point) const
Lexicographical greater than operator.
Definition: DPosition.h:245
CoordinateType operator[](Size index) const
Const accessor for the dimensions.
Definition: DPosition.h:136
ConstIterator end() const
Non-mutable end iterator.
Definition: DPosition.h:394