OpenMS
Peak1D Class Reference

A 1-dimensional raw data point or peak. More...

#include <OpenMS/KERNEL/Peak1D.h>

Inheritance diagram for Peak1D:
[legend]
Collaboration diagram for Peak1D:
[legend]

Classes

struct  IntensityLess
 
struct  MZLess
 Comparator by m/z position. More...
 
struct  PositionLess
 Comparator by position. As this class has dimension 1, this is basically an alias for MZLess. More...
 

Public Types

Type definitions

Dimension

enum  { DIMENSION = 1 }
 
using IntensityType = float
 Intensity type. More...
 
using PositionType = DPosition< 1 >
 Position type. More...
 
using CoordinateType = double
 Coordinate type. More...
 

Public Member Functions

bool operator== (const Peak1D &rhs) const
 Equality operator. More...
 
bool operator!= (const Peak1D &rhs) const
 Equality operator. More...
 
Constructors and Destructor

Default constructor

 Peak1D ()=default
 
 Peak1D (PositionType a, IntensityType b)
 construct with position and intensity More...
 
 Peak1D (const Peak1D &p)=default
 Copy constructor. More...
 
 Peak1D (Peak1D &&) noexcept=default
 
Peak1Doperator= (const Peak1D &rhs)=default
 Assignment operator. More...
 
Peak1Doperator= (Peak1D &&) noexcept=default
 Move assignment operator. More...
 
 ~Peak1D ()=default
 Destructor. More...
 
Accessors
IntensityType getIntensity () const
 
void setIntensity (IntensityType intensity)
 Mutable access to the data point intensity (height) More...
 
CoordinateType getMZ () const
 Non-mutable access to m/z. More...
 
void setMZ (CoordinateType mz)
 Mutable access to m/z. More...
 
CoordinateType getPos () const
 Alias for getMZ() More...
 
void setPos (CoordinateType pos)
 Alias for setMZ() More...
 
PositionType const & getPosition () const
 Non-mutable access to the position. More...
 
PositionTypegetPosition ()
 Mutable access to the position. More...
 
void setPosition (PositionType const &position)
 Mutable access to the position. More...
 

Protected Attributes

PositionType position_
 The data point position. More...
 
IntensityType intensity_ = 0.0
 The data point intensity. More...
 

Detailed Description

A 1-dimensional raw data point or peak.

This data structure is intended for continuous data or peak data. If you want to annotated single peaks with meta data, use RichPeak1D instead.

Member Typedef Documentation

◆ CoordinateType

using CoordinateType = double

Coordinate type.

◆ IntensityType

using IntensityType = float

Intensity type.

◆ PositionType

using PositionType = DPosition<1>

Position type.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DIMENSION 

Constructor & Destructor Documentation

◆ Peak1D() [1/4]

Peak1D ( )
inlinedefault

◆ Peak1D() [2/4]

Peak1D ( PositionType  a,
IntensityType  b 
)
inline

construct with position and intensity

◆ Peak1D() [3/4]

Peak1D ( const Peak1D p)
default

Copy constructor.

◆ Peak1D() [4/4]

Peak1D ( Peak1D &&  )
defaultnoexcept

◆ ~Peak1D()

~Peak1D ( )
default

Destructor.

Note
The destructor is non-virtual although many classes are derived from Peak1D. This is intentional, since otherwise we would "waste" space for a vtable pointer in each instance. Normally you should not derive other classes from Peak1D (unless you know what you are doing, of course).

Member Function Documentation

◆ getIntensity()

IntensityType getIntensity ( ) const
inline

◆ getMZ()

◆ getPos()

CoordinateType getPos ( ) const
inline

Alias for getMZ()

◆ getPosition() [1/2]

PositionType& getPosition ( )
inline

Mutable access to the position.

◆ getPosition() [2/2]

PositionType const& getPosition ( ) const
inline

Non-mutable access to the position.

Referenced by Peak1D::PositionLess::operator()().

◆ operator!=()

bool operator!= ( const Peak1D rhs) const
inline

Equality operator.

References OpenMS::Internal::operator==().

◆ operator=() [1/2]

Peak1D& operator= ( const Peak1D rhs)
default

Assignment operator.

◆ operator=() [2/2]

Peak1D& operator= ( Peak1D &&  )
defaultnoexcept

Move assignment operator.

◆ operator==()

bool operator== ( const Peak1D rhs) const
inline

Equality operator.

References Peak1D::intensity_, and Peak1D::position_.

◆ setIntensity()

◆ setMZ()

◆ setPos()

void setPos ( CoordinateType  pos)
inline

Alias for setMZ()

◆ setPosition()

void setPosition ( PositionType const &  position)
inline

Member Data Documentation

◆ intensity_

IntensityType intensity_ = 0.0
protected

The data point intensity.

Referenced by Peak1D::operator==().

◆ position_

PositionType position_
protected

The data point position.

Referenced by Peak1D::operator==().