OpenMS
MassDecomposer< ValueType, DecompositionValueType > Class Template Referenceabstract

An interface to handle decomposing of integer values/masses over a set of integer weights (alphabet). More...

#include <OpenMS/CHEMISTRY/MASSDECOMPOSITION/IMS/MassDecomposer.h>

Inheritance diagram for MassDecomposer< ValueType, DecompositionValueType >:
[legend]

Public Types

typedef ValueType value_type
 
typedef DecompositionValueType decomposition_value_type
 
typedef std::vector< decomposition_value_typedecomposition_type
 
typedef std::vector< decomposition_typedecompositions_type
 

Public Member Functions

virtual ~MassDecomposer ()
 
virtual bool exist (value_type mass)=0
 
virtual decomposition_type getDecomposition (value_type mass)=0
 
virtual decompositions_type getAllDecompositions (value_type mass)=0
 
virtual decomposition_value_type getNumberOfDecompositions (value_type mass)=0
 

Detailed Description

template<typename ValueType, typename DecompositionValueType>
class OpenMS::ims::MassDecomposer< ValueType, DecompositionValueType >

An interface to handle decomposing of integer values/masses over a set of integer weights (alphabet).

An interface that addresses the following "mass decomposition" problems:

  • Existence Problem (whether the decomposition of the given mass exists),
  • One Decomposition Problem (returns one possible decomposition),
  • All Decompositions Problem (returns all possible decompositions),
  • Number of Decompositions Problem (returns the number of possible decompositions).

Those problems are solved in integer arithmetic, i.e. only exact solutions are found with no error allowed.

Parameters
ValueTypeType of values to be decomposed.
DecompositionValueTypeType of decomposition elements.
Author
Anton Pervukhin Anton.nosp@m..Per.nosp@m.vukhi.nosp@m.n@Ce.nosp@m.BiTec.nosp@m..Uni.nosp@m.-Biel.nosp@m.efel.nosp@m.d.DE

Member Typedef Documentation

◆ decomposition_type

Type of decomposition container.

◆ decomposition_value_type

typedef DecompositionValueType decomposition_value_type

Type of decomposition value.

◆ decompositions_type

Type of container for many decompositions.

◆ value_type

typedef ValueType value_type

Type of value to be decomposed.

Constructor & Destructor Documentation

◆ ~MassDecomposer()

virtual ~MassDecomposer ( )
inlinevirtual

A virtual destructor.

Member Function Documentation

◆ exist()

virtual bool exist ( value_type  mass)
pure virtual

Returns true if the decomposition for the given mass exists, otherwise - false.

Parameters
massMass to be checked on decomposing.
Returns
true, if the decomposition for mass exist, otherwise - false.

◆ getAllDecompositions()

virtual decompositions_type getAllDecompositions ( value_type  mass)
pure virtual

Returns all possible decompositions for the given mass.

Parameters
massMass to be decomposed.
Returns
All possible decompositions of the mass, if there are any exist, otherwise - an empty container.

◆ getDecomposition()

virtual decomposition_type getDecomposition ( value_type  mass)
pure virtual

Returns one possible decomposition of the given mass.

Parameters
massMass to be decomposed.
Returns
The decomposition of the mass, if one exists, otherwise - an empty container.

◆ getNumberOfDecompositions()

virtual decomposition_value_type getNumberOfDecompositions ( value_type  mass)
pure virtual

Returns the number of possible decompositions for the given mass.

Parameters
massMass to be decomposed.
Returns
The number of possible decompositions for the mass.