OpenMS
Loading...
Searching...
No Matches
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
[in]ValueTypeType of values to be decomposed.
[in]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

template<typename ValueType , typename DecompositionValueType >
typedef std::vector<decomposition_value_type> decomposition_type

Type of decomposition container.

◆ decomposition_value_type

template<typename ValueType , typename DecompositionValueType >
typedef DecompositionValueType decomposition_value_type

Type of decomposition value.

◆ decompositions_type

template<typename ValueType , typename DecompositionValueType >
typedef std::vector<decomposition_type> decompositions_type

Type of container for many decompositions.

◆ value_type

template<typename ValueType , typename DecompositionValueType >
typedef ValueType value_type

Type of value to be decomposed.

Constructor & Destructor Documentation

◆ ~MassDecomposer()

template<typename ValueType , typename DecompositionValueType >
virtual ~MassDecomposer ( )
inlinevirtual

A virtual destructor.

Member Function Documentation

◆ exist()

template<typename ValueType , typename DecompositionValueType >
virtual bool exist ( value_type  mass)
pure virtual

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

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

Implemented in IntegerMassDecomposer< ValueType, DecompositionValueType >.

◆ getAllDecompositions()

template<typename ValueType , typename DecompositionValueType >
virtual decompositions_type getAllDecompositions ( value_type  mass)
pure virtual

Returns all possible decompositions for the given mass.

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

Implemented in IntegerMassDecomposer< ValueType, DecompositionValueType >.

◆ getDecomposition()

template<typename ValueType , typename DecompositionValueType >
virtual decomposition_type getDecomposition ( value_type  mass)
pure virtual

Returns one possible decomposition of the given mass.

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

Implemented in IntegerMassDecomposer< ValueType, DecompositionValueType >.

◆ getNumberOfDecompositions()

template<typename ValueType , typename DecompositionValueType >
virtual decomposition_value_type getNumberOfDecompositions ( value_type  mass)
pure virtual

Returns the number of possible decompositions for the given mass.

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

Implemented in IntegerMassDecomposer< ValueType, DecompositionValueType >.