Implements MassDecomposer interface using algorithm and data structures described in paper "Efficient Mass Decomposition" S. Bcker, Zs. Liptk, ACM SAC-BIO, 2004.
More...
#include <OpenMS/CHEMISTRY/MASSDECOMPOSITION/IMS/IntegerMassDecomposer.h>
Implements MassDecomposer interface using algorithm and data structures described in paper "Efficient Mass Decomposition" S. Bcker, Zs. Liptk, ACM SAC-BIO, 2004.
The main idea is instead of using the classical dynamic programming algorithm, store the residues of the smallest decomposable numbers for every modulo of the smallest alphabet mass.
| ValueType | Type of values to be decomposed. | |
| DecompositionValueType | Type of decomposition elements. |
| typedef MassDecomposer<ValueType, DecompositionValueType>::decomposition_type decomposition_type |
Type of decomposition.
Reimplemented from MassDecomposer< ValueType, DecompositionValueType >.
| typedef MassDecomposer<ValueType, DecompositionValueType>::decomposition_value_type decomposition_value_type |
Type of decomposition value.
Reimplemented from MassDecomposer< ValueType, DecompositionValueType >.
| typedef MassDecomposer<ValueType, DecompositionValueType>::decompositions_type decompositions_type |
Type of container for many decompositions.
Reimplemented from MassDecomposer< ValueType, DecompositionValueType >.
typedef std::vector<value_type> residues_table_row_type [private] |
Type of rows of residues table.
typedef std::vector<residues_table_row_type> residues_table_type [private] |
Type of the residues table.
| typedef decomposition_type::size_type size_type |
Type of decomposition's size.
| typedef MassDecomposer<ValueType, DecompositionValueType>::value_type value_type |
Type of value to be decomposed.
Reimplemented from MassDecomposer< ValueType, DecompositionValueType >.
typedef std::vector<std::pair<size_type, decomposition_value_type> > witness_vector_type [private] |
Type of witness vector.
| IntegerMassDecomposer | ( | const Weights & | alphabet | ) | [explicit] |
Constructor with weights.
| alphabet | Weights over which masses to be decomposed. |
References IntegerMassDecomposer< ValueType, DecompositionValueType >::ertable_, IntegerMassDecomposer< ValueType, DecompositionValueType >::fillExtendedResidueTable_(), Weights::getWeight(), IntegerMassDecomposer< ValueType, DecompositionValueType >::infty_, IntegerMassDecomposer< ValueType, DecompositionValueType >::lcms_, IntegerMassDecomposer< ValueType, DecompositionValueType >::mass_in_lcms_, Weights::size(), and IntegerMassDecomposer< ValueType, DecompositionValueType >::witness_vector_.
| void collectDecompositionsRecursively_ | ( | value_type | mass, | |
| size_type | alphabetMassIndex, | |||
| decomposition_type | decomposition, | |||
| decompositions_type & | decompositionsStore | |||
| ) | [private] |
Collects decompositions for mass by recursion.
| mass | Mass to be decomposed. | |
| alphabetMassIndex | An index of the mass in alphabet that is used on this step of recursion. | |
| decomposition | Decomposition which is calculated on this step of recursion. | |
| decompositionsStore | Container where decompositions are collected. |
References IntegerMassDecomposer< ValueType, DecompositionValueType >::alphabet_, IntegerMassDecomposer< ValueType, DecompositionValueType >::ertable_, Weights::getWeight(), IntegerMassDecomposer< ValueType, DecompositionValueType >::infty_, IntegerMassDecomposer< ValueType, DecompositionValueType >::lcms_, and IntegerMassDecomposer< ValueType, DecompositionValueType >::mass_in_lcms_.
Referenced by IntegerMassDecomposer< ValueType, DecompositionValueType >::getAllDecompositions().
| bool exist | ( | value_type | mass | ) | [virtual] |
Returns true if decomposition over the mass exists, otherwise - false.
| mass | Mass to be decomposed. |
References IntegerMassDecomposer< ValueType, DecompositionValueType >::alphabet_, IntegerMassDecomposer< ValueType, DecompositionValueType >::ertable_, Weights::getWeight(), and IntegerMassDecomposer< ValueType, DecompositionValueType >::infty_.
Referenced by IntegerMassDecomposer< ValueType, DecompositionValueType >::getDecomposition().
| void fillExtendedResidueTable_ | ( | const Weights & | _alphabet, | |
| residues_table_row_type & | _lcms, | |||
| residues_table_row_type & | _mass_in_lcms, | |||
| const value_type | _infty, | |||
| witness_vector_type & | _witness_vector, | |||
| residues_table_type & | _ertable | |||
| ) | [private] |
Fills the extended residues table.
References OpenMS::Math::gcd(), Weights::getWeight(), and Weights::size().
Referenced by IntegerMassDecomposer< ValueType, DecompositionValueType >::IntegerMassDecomposer().
| IntegerMassDecomposer< ValueType, DecompositionValueType >::decompositions_type getAllDecompositions | ( | value_type | mass | ) | [virtual] |
Gets all possible decompositions for mass.
| mass | Mass to be decomposed. |
References IntegerMassDecomposer< ValueType, DecompositionValueType >::alphabet_, IntegerMassDecomposer< ValueType, DecompositionValueType >::collectDecompositionsRecursively_(), and Weights::size().
| IntegerMassDecomposer< ValueType, DecompositionValueType >::decomposition_type getDecomposition | ( | value_type | mass | ) | [virtual] |
Gets one possible decomposition for mass.
| mass | Mass to be decomposed. |
References IntegerMassDecomposer< ValueType, DecompositionValueType >::alphabet_, IntegerMassDecomposer< ValueType, DecompositionValueType >::ertable_, IntegerMassDecomposer< ValueType, DecompositionValueType >::exist(), Weights::getWeight(), Weights::size(), and IntegerMassDecomposer< ValueType, DecompositionValueType >::witness_vector_.
| IntegerMassDecomposer< ValueType, DecompositionValueType >::decomposition_value_type getNumberOfDecompositions | ( | value_type | mass | ) | [virtual] |
Gets number of all possible decompositions for a given mass. Since using getAllDecomposition() the usage of this function could be consuming.
| mass | Mass to be decomposed |
Gets number of all possible decompositions for a given mass. Since using getAllDecomposition() the usage of this function could be consuming.
| mass | Mass to be decomposed |
Weights over which the mass is to be decomposed.
Referenced by IntegerMassDecomposer< ValueType, DecompositionValueType >::collectDecompositionsRecursively_(), IntegerMassDecomposer< ValueType, DecompositionValueType >::exist(), IntegerMassDecomposer< ValueType, DecompositionValueType >::getAllDecompositions(), and IntegerMassDecomposer< ValueType, DecompositionValueType >::getDecomposition().
residues_table_type ertable_ [private] |
Table with the residues of the smallest decomposable numbers over every modulo of the smallest alphabet mass are stored. Corresponds to the Extended Residue Table in the paper.
Referenced by IntegerMassDecomposer< ValueType, DecompositionValueType >::collectDecompositionsRecursively_(), IntegerMassDecomposer< ValueType, DecompositionValueType >::exist(), IntegerMassDecomposer< ValueType, DecompositionValueType >::getDecomposition(), and IntegerMassDecomposer< ValueType, DecompositionValueType >::IntegerMassDecomposer().
value_type infty_ [private] |
residues_table_row_type lcms_ [private] |
List of the least common multiples. Corresponds to the lcm data structure in the paper.
Referenced by IntegerMassDecomposer< ValueType, DecompositionValueType >::collectDecompositionsRecursively_(), and IntegerMassDecomposer< ValueType, DecompositionValueType >::IntegerMassDecomposer().
residues_table_row_type mass_in_lcms_ [private] |
List of the counters for the least common multiples that store the number how often the smallest alphabet mass fits into the correcponding least common multiple(lcm).
Referenced by IntegerMassDecomposer< ValueType, DecompositionValueType >::collectDecompositionsRecursively_(), and IntegerMassDecomposer< ValueType, DecompositionValueType >::IntegerMassDecomposer().
witness_vector_type witness_vector_ [private] |
List of the witnesses that is used to find one mass decomposition. Corresponds to the witness vector w in the paper.
Referenced by IntegerMassDecomposer< ValueType, DecompositionValueType >::getDecomposition(), and IntegerMassDecomposer< ValueType, DecompositionValueType >::IntegerMassDecomposer().
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:59 using doxygen 1.7.1 |