OpenMS
|
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 | |
Default constructor. More... | |
DPosition (CoordinateType x) | |
Constructor that fills all dimensions with the value x . More... | |
DPosition (CoordinateType x, CoordinateType y) | |
Constructor only for DPosition<2> that takes two Coordinates. More... | |
DPosition (CoordinateType x, CoordinateType y, CoordinateType z) | |
Constructor only for DPosition<3> that takes three Coordinates. More... | |
DPosition (const DPosition &pos)=default | |
Copy constructor. More... | |
DPosition (DPosition &&rhs) noexcept=default | |
Move constructor. More... | |
DPosition & | operator= (const DPosition &source)=default |
Assignment operator. More... | |
DPosition & | operator= (DPosition &&source) noexcept=default |
Move Assignment operator. More... | |
~DPosition () noexcept=default | |
Destructor (not-virtual as this will save a lot of space!) More... | |
void | swap (DPosition &rhs) noexcept |
Swap the two objects. More... | |
DPosition & | abs () noexcept |
Make all dimension values positive. More... | |
Static Public Member Functions | |
Static values | |
static constexpr DPosition | zero () |
all zero More... | |
static constexpr DPosition | minPositive () |
smallest positive More... | |
static constexpr DPosition | minNegative () |
smallest negative More... | |
static constexpr 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 |
|
default |
Default constructor.
Creates a position with all coordinates zero.
Referenced by DPosition< D, TCoordinateType >::maxPositive(), DPosition< D, TCoordinateType >::minNegative(), DPosition< D, TCoordinateType >::minPositive(), and DPosition< D, TCoordinateType >::zero().
|
inline |
Constructor that fills all dimensions with the value x
.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Constructor only for DPosition<2> that takes two Coordinates.
References DPosition< D, TCoordinateType >::coordinate_.
|
inline |
Constructor only for DPosition<3> that takes three Coordinates.
References DPosition< D, TCoordinateType >::coordinate_.
|
defaultnoexcept |
Destructor (not-virtual as this will save a lot of space!)
|
inlinenoexcept |
Make all dimension values positive.
References DPosition< D, TCoordinateType >::coordinate_.
Referenced by Annotation1DPeakItem< DataPoint >::draw().
|
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(), and AveragePosition< D >::clear().
|
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(), Plot2DCanvas::dataToWidget_(), and Plot1DCanvas::dataToWidget_().
|
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(), Plot2DCanvas::dataToWidget_(), and Plot1DCanvas::dataToWidget_().
|
inlinestaticconstexpr |
largest positive
References DPosition< D, TCoordinateType >::DPosition().
|
inlinestaticconstexpr |
smallest negative
References DPosition< D, TCoordinateType >::DPosition().
|
inlinestaticconstexpr |
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>().
Move Assignment operator.
|
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_.
|
inlinenoexcept |
Swap the two objects.
References DPosition< D, TCoordinateType >::coordinate_.
|
inlinestaticconstexpr |
all zero
References DPosition< D, TCoordinateType >::DPosition().
|
protected |
Referenced by DPosition< D, TCoordinateType >::abs(), 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 >::setX(), DPosition< D, TCoordinateType >::setY(), DPosition< D, TCoordinateType >::spatiallyGreaterEqual(), DPosition< D, TCoordinateType >::spatiallyLessEqual(), and DPosition< D, TCoordinateType >::swap().