#include <OpenMS/KERNEL/DPeakArray.h>
This class represents an array of D-dimensional peaks. The peak type must provide an enum DIMENSION (values 1, 2, and 3 are supported). The container is based on the STL vector class, but provides more a more convenient interface to manipulate these vectors, sort with respect to specific dimensions or intensity and a convenient interface to the other OpenMS classes.
Note that this is a non-polymorphic container, i.e. you cannot store objects of different types in it.
Public Types | |
enum | { DIMENSION = PeakType::DIMENSION } |
Dimensionality of the peaks. More... | |
typedef PeakT | PeakType |
Peak type. | |
typedef AllocT | AllocType |
Allocator type. | |
typedef std::vector< PeakType, AllocT > | Base |
Base class type. | |
typedef std::vector< PeakType, AllocT >::iterator | Iterator |
Mutable iterator. | |
typedef std::vector< PeakType, AllocT >::const_iterator | ConstIterator |
Non-mutable iterator. | |
typedef std::vector< PeakType, AllocT >::reverse_iterator | ReverseIterator |
Mutable reverse iterator. | |
typedef std::vector< PeakType, AllocT > ::const_reverse_iterator | ConstReverseIterator |
Non-mutable reverse iterator. | |
Public Member Functions | |
DPeakArray & | operator= (const DPeakArray &rhs) |
See std::vector documentation. | |
bool | operator== (const DPeakArray &array) const |
See std::vector documentation. | |
bool | operator!= (const DPeakArray &array) const |
See std::vector documentation. | |
template<typename AllocT2> | |
bool | operator< (const DPeakArray< PeakT, AllocT2 > &array) const |
Comparison of container sizes. | |
template<typename AllocT2> | |
bool | operator> (const DPeakArray< PeakT, AllocT2 > &array) const |
Comparison of container sizes. | |
bool | operator<= (const DPeakArray &array) const |
Comparison of container sizes. | |
bool | operator>= (const DPeakArray &array) const |
Comparison of container sizes. | |
Constructors and Destructor | |
DPeakArray () | |
See std::vector documentation. | |
DPeakArray (const DPeakArray &p) | |
See std::vector documentation. | |
template<typename AllocT2> | |
DPeakArray (const DPeakArray< PeakT, AllocT2 > &p) | |
See std::vector documentation. (different allocator). | |
template<typename AllocT2> | |
DPeakArray (const DPeakArray< PeakT, AllocT2 > &p, const AllocT &alloc) | |
Constructor, using a given DPeakArray (with other alloc?) p and the allocator instance that shall be used. | |
~DPeakArray () | |
See std::vector documentation. | |
DPeakArray (typename std::vector< PeakType, AllocT >::size_type n) | |
See std::vector documentation. | |
DPeakArray (typename std::vector< PeakType, AllocT >::size_type n, const PeakType &peak) | |
See std::vector documentation. | |
DPeakArray (const AllocT &a) | |
See std::vector documentation. | |
DPeakArray (typename std::vector< PeakType >::size_type n, const PeakType &peak, const AllocT &a) | |
See std::vector documentation. | |
template<class InputIterator> | |
DPeakArray (InputIterator f, InputIterator l) | |
See std::vector documentation. | |
Sorting. | |
See std::vector documentation. (different allocator)
These simplified sorting methods are supported in addition to the standard sorting methods of std::vector. | |
void | sortByIntensity (bool reverse=false) |
Sorts the peaks according to ascending intensity. | |
void | sortByPosition () |
Lexicographically sorts the peaks by their position. | |
void | sortByNthPosition (UInt i) throw (Exception::NotImplemented) |
Sorts the peaks by one dimension of their position. | |
Generic sorting function templates. | |
Any peak comparator can be given as template argument.
Thus your can e.g. write | |
template<typename ComparatorType> | |
void | sortByComparator (ComparatorType const &comparator) |
template<typename ComparatorType> | |
void | sortByComparator () |
Protected Member Functions | |
virtual void | clearChildIds_ () |
Clears the persistence id of all sub-objects. | |
Friends | |
class | DPeakArray |
typedef PeakT PeakType |
Peak type.
typedef AllocT AllocType |
Allocator type.
Base class type.
Reimplemented in ConsensusMap, ConsensusMap< AlignmentT::ConsensusElementType >, and ConsensusMap< ConsensusElementType >.
Mutable iterator.
Reimplemented in ConsensusMap, ConsensusMap< AlignmentT::ConsensusElementType >, and ConsensusMap< ConsensusElementType >.
typedef std::vector<PeakType, AllocT>::const_iterator ConstIterator |
Non-mutable iterator.
Reimplemented in ConsensusMap, ConsensusMap< AlignmentT::ConsensusElementType >, and ConsensusMap< ConsensusElementType >.
typedef std::vector<PeakType, AllocT>::reverse_iterator ReverseIterator |
Mutable reverse iterator.
Reimplemented in ConsensusMap, ConsensusMap< AlignmentT::ConsensusElementType >, and ConsensusMap< ConsensusElementType >.
typedef std::vector<PeakType, AllocT>::const_reverse_iterator ConstReverseIterator |
Non-mutable reverse iterator.
Reimplemented in ConsensusMap, ConsensusMap< AlignmentT::ConsensusElementType >, and ConsensusMap< ConsensusElementType >.
DPeakArray | ( | ) | [inline] |
See std::vector documentation.
DPeakArray | ( | const DPeakArray< PeakT, AllocT > & | p | ) | [inline] |
See std::vector documentation.
DPeakArray | ( | const DPeakArray< PeakT, AllocT2 > & | p | ) | [inline] |
See std::vector documentation. (different allocator).
DPeakArray | ( | const DPeakArray< PeakT, AllocT2 > & | p, | |
const AllocT & | alloc | |||
) | [inline] |
Constructor, using a given DPeakArray (with other alloc?) p
and the allocator instance that shall be used.
~DPeakArray | ( | ) | [inline] |
See std::vector documentation.
DPeakArray | ( | typename std::vector< PeakType, AllocT >::size_type | n | ) | [inline] |
See std::vector documentation.
DPeakArray | ( | typename std::vector< PeakType, AllocT >::size_type | n, | |
const PeakType & | peak | |||
) | [inline] |
See std::vector documentation.
DPeakArray | ( | const AllocT & | a | ) | [inline] |
See std::vector documentation.
DPeakArray | ( | typename std::vector< PeakType >::size_type | n, | |
const PeakType & | peak, | |||
const AllocT & | a | |||
) | [inline] |
See std::vector documentation.
DPeakArray | ( | InputIterator | f, | |
InputIterator | l | |||
) | [inline] |
See std::vector documentation.
DPeakArray& operator= | ( | const DPeakArray< PeakT, AllocT > & | rhs | ) | [inline] |
See std::vector documentation.
void sortByIntensity | ( | bool | reverse = false |
) | [inline] |
Sorts the peaks according to ascending intensity.
void sortByPosition | ( | ) | [inline] |
Lexicographically sorts the peaks by their position.
void sortByNthPosition | ( | UInt | i | ) | throw (Exception::NotImplemented) [inline] |
Sorts the peaks by one dimension of their position.
It is only sorted according to dimentsion i
.
void sortByComparator | ( | ComparatorType const & | comparator | ) | [inline] |
void sortByComparator | ( | ) | [inline] |
bool operator== | ( | const DPeakArray< PeakT, AllocT > & | array | ) | const [inline] |
See std::vector documentation.
bool operator!= | ( | const DPeakArray< PeakT, AllocT > & | array | ) | const [inline] |
See std::vector documentation.
bool operator< | ( | const DPeakArray< PeakT, AllocT2 > & | array | ) | const [inline] |
Comparison of container sizes.
bool operator> | ( | const DPeakArray< PeakT, AllocT2 > & | array | ) | const [inline] |
Comparison of container sizes.
bool operator<= | ( | const DPeakArray< PeakT, AllocT > & | array | ) | const [inline] |
Comparison of container sizes.
bool operator>= | ( | const DPeakArray< PeakT, AllocT > & | array | ) | const [inline] |
Comparison of container sizes.
virtual void clearChildIds_ | ( | ) | [inline, protected, virtual] |
friend class DPeakArray [friend] |
Generated Tue Apr 1 15:36:45 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |