OpenMS
2.8.0
|
Representation of a coordinate in D-dimensional space. More...
#include <OpenMS/DATASTRUCTURES/DPosition.h>
Public Types | |
enum | { DIMENSION = D } |
Dimensions. More... | |
typedef TCoordinateType | CoordinateType |
Coordinate type. More... | |
typedef CoordinateType * | Iterator |
Mutable iterator. More... | |
typedef const CoordinateType * | ConstIterator |
Non-mutable iterator. More... | |
STL compatibility type definitions | |
typedef CoordinateType | value_type |
typedef CoordinateType & | reference |
typedef CoordinateType * | pointer |
typedef CoordinateType * | iterator |
typedef const CoordinateType * | const_iterator |
Public Member Functions | |
Constructors and Destructor | |
DPosition () | |
Default constructor. More... | |
~DPosition () | |
Destructor (not-virtual as this will save a lot of space!) More... | |
DPosition (CoordinateType x) | |
Constructor that fills all dimensions with the value x . More... | |
DPosition (const DPosition &pos) | |
Copy constructor. More... | |
DPosition (DPosition &&rhs) noexcept | |
Move constructor. More... | |
DPosition (CoordinateType x, CoordinateType y) | |
Constructor only for DPosition<2> that takes two Coordinates. More... | |
DPosition & | operator= (const DPosition &source) |
Assignment operator. More... | |
Static Public Member Functions | |
Static values | |
static const DPosition | zero () |
all zero More... | |
static const DPosition | minPositive () |
smallest positive More... | |
static const DPosition | minNegative () |
smallest negative More... | |
static const DPosition | maxPositive () |
largest positive More... | |
Iteration | |
CoordinateType | coordinate_ [D] |
ConstIterator | begin () const |
Non-mutable begin iterator. More... | |
ConstIterator | end () const |
Non-mutable end iterator. More... | |
Iterator | begin () |
Mutable begin iterator. More... | |
Iterator | end () |
Mutable end iterator. More... | |
Accessors | |
CoordinateType | operator[] (Size index) const |
Const accessor for the dimensions. More... | |
CoordinateType & | operator[] (Size index) |
Accessor for the dimensions. More... | |
CoordinateType | getX () const |
Name accessor for the first dimension. Only for DPosition<2>, for visualization. More... | |
CoordinateType | getY () const |
Name accessor for the second dimension. Only for DPosition<2>, for visualization. More... | |
void | setX (CoordinateType c) |
Name mutator for the first dimension. Only for DPosition<2>, for visualization. More... | |
void | setY (CoordinateType c) |
Name mutator for the second dimension. Only for DPosition<2>, for visualization. More... | |
bool | operator== (const DPosition &point) const |
Equality operator. More... | |
bool | operator!= (const DPosition &point) const |
Equality operator. More... | |
bool | operator< (const DPosition &point) const |
Lexicographical less than operator. Lexicographical comparison from dimension 0 to dimension D-1 is done. More... | |
bool | operator<= (const DPosition &point) const |
Lexicographical greater less or equal operator. More... | |
bool | spatiallyLessEqual (const DPosition &point) const |
Spatially (geometrically) less or equal operator. All coordinates must be "<=". More... | |
bool | spatiallyGreaterEqual (const DPosition &point) const |
Spatially (geometrically) greater or equal operator. All coordinates must be ">=". More... | |
bool | operator> (const DPosition &point) const |
Lexicographical greater than operator. More... | |
bool | operator>= (const DPosition &point) const |
Lexicographical greater or equal operator. More... | |
DPosition | operator+ (const DPosition &point) const |
Addition (a bit inefficient) More... | |
DPosition & | operator+= (const DPosition &point) |
Addition. More... | |
DPosition | operator- (const DPosition &point) const |
Subtraction (a bit inefficient) More... | |
DPosition & | operator-= (const DPosition &point) |
Subtraction. More... | |
DPosition | operator- () const |
Negation (a bit inefficient) More... | |
CoordinateType | operator* (const DPosition &point) const |
Inner product. More... | |
DPosition & | operator*= (CoordinateType scalar) |
Scalar multiplication. More... | |
DPosition & | operator/= (CoordinateType scalar) |
Scalar division. More... | |
void | clear () |
Set all dimensions to zero. More... | |
static Size | size () |
Returns the number of dimensions. More... | |
Representation of a coordinate in D-dimensional space.
typedef const CoordinateType* const_iterator |
typedef const CoordinateType* ConstIterator |
Non-mutable iterator.
typedef TCoordinateType CoordinateType |
Coordinate type.
typedef CoordinateType* Iterator |
Mutable iterator.
typedef CoordinateType* iterator |
typedef CoordinateType* pointer |
typedef CoordinateType& reference |
typedef CoordinateType value_type |
|
inline |
Default constructor.
Creates a position with all coordinates zero.
References DPosition< D, TCoordinateType >::clear().
Referenced by DPosition< D, TCoordinateType >::maxPositive(), DPosition< D, TCoordinateType >::minNegative(), DPosition< D, TCoordinateType >::minPositive(), and DPosition< D, TCoordinateType >::zero().
|
inline |
Destructor (not-virtual as this will save a lot of space!)
|
inline |
Constructor that fills all dimensions with the value x
.
References DPosition< D, TCoordinateType >::coordinate_.
Copy constructor.
References DPosition< D, TCoordinateType >::coordinate_.
Move constructor.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Constructor only for DPosition<2> that takes two Coordinates.
References DPosition< D, TCoordinateType >::coordinate_, and OPENMS_PRECONDITION.
|
inline |
Mutable begin iterator.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Non-mutable begin iterator.
References DPosition< D, TCoordinateType >::coordinate_.
Referenced by HashGrid< Cluster >::cellindexAtClustercenter_(), OpenMS::hash_value(), and HashGrid< Cluster >::updateGridDimension_().
|
inline |
Set all dimensions to zero.
References DPosition< D, TCoordinateType >::coordinate_.
Referenced by AveragePosition< D >::add(), AveragePosition< D >::clear(), and DPosition< D, TCoordinateType >::DPosition().
|
inline |
Mutable end iterator.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Non-mutable end iterator.
References DPosition< D, TCoordinateType >::coordinate_.
Referenced by HashGrid< Cluster >::cellindexAtClustercenter_(), OpenMS::hash_value(), and HashGrid< Cluster >::updateGridDimension_().
|
inline |
Name accessor for the first dimension. Only for DPosition<2>, for visualization.
References DPosition< D, TCoordinateType >::coordinate_, and OPENMS_PRECONDITION.
Referenced by GridBasedClustering< Metric >::cluster().
|
inline |
Name accessor for the second dimension. Only for DPosition<2>, for visualization.
References DPosition< D, TCoordinateType >::coordinate_, and OPENMS_PRECONDITION.
Referenced by GridBasedClustering< Metric >::cluster().
|
inlinestatic |
largest positive
References DPosition< D, TCoordinateType >::DPosition().
|
inlinestatic |
smallest negative
References DPosition< D, TCoordinateType >::DPosition().
|
inlinestatic |
smallest positive
References DPosition< D, TCoordinateType >::DPosition().
|
inline |
Equality operator.
References DPosition< D, TCoordinateType >::operator==().
|
inline |
Inner product.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Scalar multiplication.
References DPosition< D, TCoordinateType >::coordinate_.
Addition (a bit inefficient)
References DPosition< D, TCoordinateType >::coordinate_.
Addition.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Negation (a bit inefficient)
References DPosition< D, TCoordinateType >::coordinate_.
Subtraction (a bit inefficient)
References DPosition< D, TCoordinateType >::coordinate_.
Subtraction.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Scalar division.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Lexicographical less than operator. Lexicographical comparison from dimension 0 to dimension D-1 is done.
References DPosition< D, TCoordinateType >::coordinate_.
Referenced by DPosition< D, TCoordinateType >::operator>=().
|
inline |
Lexicographical greater less or equal operator.
References DPosition< D, TCoordinateType >::coordinate_.
Referenced by DPosition< D, TCoordinateType >::operator>().
Assignment operator.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Equality operator.
References DPosition< D, TCoordinateType >::coordinate_.
Referenced by DPosition< D, TCoordinateType >::operator!=().
|
inline |
Lexicographical greater than operator.
References DPosition< D, TCoordinateType >::operator<=().
|
inline |
Lexicographical greater or equal operator.
References DPosition< D, TCoordinateType >::operator<().
|
inline |
Accessor for the dimensions.
References DPosition< D, TCoordinateType >::coordinate_, and OPENMS_PRECONDITION.
|
inline |
Const accessor for the dimensions.
References DPosition< D, TCoordinateType >::coordinate_, and OPENMS_PRECONDITION.
|
inline |
Name mutator for the first dimension. Only for DPosition<2>, for visualization.
References OpenMS::Constants::c, DPosition< D, TCoordinateType >::coordinate_, and OPENMS_PRECONDITION.
|
inline |
Name mutator for the second dimension. Only for DPosition<2>, for visualization.
References OpenMS::Constants::c, DPosition< D, TCoordinateType >::coordinate_, and OPENMS_PRECONDITION.
|
inlinestatic |
Returns the number of dimensions.
|
inline |
Spatially (geometrically) greater or equal operator. All coordinates must be ">=".
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Spatially (geometrically) less or equal operator. All coordinates must be "<=".
References DPosition< D, TCoordinateType >::coordinate_.
|
inlinestatic |
all zero
References DPosition< D, TCoordinateType >::DPosition().
|
protected |
Referenced by DPosition< D, TCoordinateType >::begin(), DPosition< D, TCoordinateType >::clear(), DPosition< D, TCoordinateType >::DPosition(), DPosition< D, TCoordinateType >::end(), DPosition< D, TCoordinateType >::getX(), DPosition< D, TCoordinateType >::getY(), DPosition< D, TCoordinateType >::operator*(), DPosition< D, TCoordinateType >::operator*=(), DPosition< D, TCoordinateType >::operator+(), DPosition< D, TCoordinateType >::operator+=(), DPosition< D, TCoordinateType >::operator-(), DPosition< D, TCoordinateType >::operator-=(), DPosition< D, TCoordinateType >::operator/=(), DPosition< D, TCoordinateType >::operator<(), DPosition< D, TCoordinateType >::operator<=(), DPosition< D, TCoordinateType >::operator=(), DPosition< D, TCoordinateType >::operator==(), DPosition< D, TCoordinateType >::operator[](), DPosition< D, TCoordinateType >::setX(), DPosition< D, TCoordinateType >::setY(), DPosition< D, TCoordinateType >::spatiallyGreaterEqual(), and DPosition< D, TCoordinateType >::spatiallyLessEqual().