| OpenMS 2.5.0

Public Types | Public Member Functions | List of all members
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 >:

## Public Types

typedef ValueType | value_type
typedef DecompositionValueType | decomposition_value_type
typedef std::vector< decomposition_value_type > | decomposition_type
typedef std::vector< decomposition_type > | decompositions_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

  ValueType | Type of values to be decomposed.
  DecompositionValueType | Type 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

typedef std::vector<decomposition_value_type> decomposition_type

Type of decomposition container.

## ◆ decomposition_value_type

typedef DecompositionValueType decomposition_value_type

Type of decomposition value.

## ◆ decompositions_type

typedef std::vector<decomposition_type> 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 | ( |  | ) |

inline virtual

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

  mass | Mass to be checked on decomposing.

Returns
  true, if the decomposition for `mass` exist, otherwise - false.

Implemented in IntegerMassDecomposer< ValueType, DecompositionValueType >.

## ◆ getAllDecompositions()

virtual decompositions_type getAllDecompositions | ( | value_type | mass | ) |

pure virtual

Returns all possible decompositions for the given `mass`.

Parameters

  mass | Mass 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()

virtual decomposition_type getDecomposition | ( | value_type | mass | ) |

pure virtual

Returns one possible decomposition of the given `mass`.

Parameters

  mass | Mass to be decomposed.

Returns
  The decomposition of the `mass`, if one exists, otherwise - an empty container.

Implemented in IntegerMassDecomposer< ValueType, DecompositionValueType >.

## ◆ getNumberOfDecompositions()

virtual decomposition_value_type getNumberOfDecompositions | ( | value_type | mass | ) |

pure virtual

Returns the number of possible decompositions for the given `mass`.

Parameters

  mass | Mass to be decomposed.

Returns
  The number of possible decompositions for the `mass`.

Implemented in IntegerMassDecomposer< ValueType, DecompositionValueType >.