OpenMS
2.8.0
|
Handles decomposing of non-integer values/masses over a set of non-integer weights with an error allowed. More...
#include <OpenMS/CHEMISTRY/MASSDECOMPOSITION/IMS/RealMassDecomposer.h>
Public Types | |
typedef IntegerMassDecomposer | integer_decomposer_type |
Type of integer decomposer. More... | |
typedef integer_decomposer_type::value_type | integer_value_type |
Type of integer values that are decomposed. More... | |
typedef integer_decomposer_type::decompositions_type | decompositions_type |
Type of result decompositions from integer decomposer. More... | |
typedef unsigned long long | number_of_decompositions_type |
Type of the number of decompositions. More... | |
typedef std::map< unsigned int, std::pair< unsigned int, unsigned int > > | constraints_type |
Public Member Functions | |
RealMassDecomposer (const Weights &weights) | |
decompositions_type | getDecompositions (double mass, double error) |
decompositions_type | getDecompositions (double mass, double error, const constraints_type &constraints) |
number_of_decompositions_type | getNumberOfDecompositions (double mass, double error) |
Private Attributes | |
Weights | weights_ |
Weights over which values/masses to be decomposed. More... | |
std::pair< double, double > | rounding_errors_ |
Minimal and maximal rounding errors. More... | |
double | precision_ |
Precision to scale double values to integer. More... | |
std::shared_ptr< integer_decomposer_type > | decomposer_ |
Handles decomposing of non-integer values/masses over a set of non-integer weights with an error allowed.
Implements a decomposition of non-integer values with a certain error allowed. Exactness of decomposition can also be tuned by setting a precision factor for weights defining their scaling magnitude.
Works in fact as a wrapper for classes that handle exact mass decomposing using integer arithmetics. Instead of decomposing a single value as done by integer mass decomposers, RealMassDecomposer
defines a set of values that lie in the allowed range (defined by error and false negatives appeared due to rounding), scales those to integers, decomposes them using IntegerMassDecomposer
, does some checks (i.e. on false positives appeared due to rounding) and collects decompositions together.
typedef std::map<unsigned int, std::pair<unsigned int, unsigned int> > constraints_type |
Type of result decompositions from integer decomposer.
Type of integer decomposer.
Type of integer values that are decomposed.
typedef unsigned long long number_of_decompositions_type |
Type of the number of decompositions.
|
explicit |
Constructor with weights.
weights | Weights over which values/masses to be decomposed. |
decompositions_type getDecompositions | ( | double | mass, |
double | error | ||
) |
Gets all decompositions for a mass
with an error
allowed.
mass | Mass to be decomposed. |
error | Error allowed between given and result decomposition. |
decompositions_type getDecompositions | ( | double | mass, |
double | error, | ||
const constraints_type & | constraints | ||
) |
number_of_decompositions_type getNumberOfDecompositions | ( | double | mass, |
double | error | ||
) |
Gets a number of all decompositions for a mass
with an error
allowed. It's similar to the getDecompositions(double,double)
function but less space consuming, since doesn't use container to store decompositions.
mass | Mass to be decomposed. |
error | Error allowed between given and result decomposition. |
|
private |
Decomposer to be used for exact decomposing using integer arithmetic.
|
private |
Precision to scale double values to integer.
|
private |
Minimal and maximal rounding errors.