OpenMS
RealMassDecomposer.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Anton Pervukhin <Anton.Pervukhin@CeBiTec.Uni-Bielefeld.DE> $
7 // --------------------------------------------------------------------------
8 //
9 
10 #pragma once
11 
12 #include <utility>
13 #include <map>
14 #include <memory>
15 
17 
18 namespace OpenMS
19 {
20  namespace ims
21  {
22 
41  class OPENMS_DLLAPI RealMassDecomposer
42  {
43 public:
44 
47 
50 
53 
55  typedef unsigned long long number_of_decompositions_type;
56 
57  typedef std::map<unsigned int, std::pair<unsigned int, unsigned int> > constraints_type;
58 
64  explicit RealMassDecomposer(const Weights & weights);
65 
73  decompositions_type getDecompositions(double mass, double error);
74 
75  decompositions_type getDecompositions(double mass, double error, const constraints_type & constraints);
76 
87 
88 private:
91 
93  std::pair<double, double> rounding_errors_;
94 
96  double precision_;
97 
102  std::shared_ptr<integer_decomposer_type> decomposer_;
103  };
104 
105  } // namespace ims
106 } // namespace OpenMS
107 
Implements MassDecomposer interface using algorithm and data structures described in paper "Efficient...
Definition: IntegerMassDecomposer.h:46
MassDecomposer< ValueType, DecompositionValueType >::decompositions_type decompositions_type
Type of container for many decompositions.
Definition: IntegerMassDecomposer.h:58
MassDecomposer< ValueType, DecompositionValueType >::value_type value_type
Type of value to be decomposed.
Definition: IntegerMassDecomposer.h:49
Handles decomposing of non-integer values/masses over a set of non-integer weights with an error allo...
Definition: RealMassDecomposer.h:42
std::pair< double, double > rounding_errors_
Minimal and maximal rounding errors.
Definition: RealMassDecomposer.h:93
std::map< unsigned int, std::pair< unsigned int, unsigned int > > constraints_type
Definition: RealMassDecomposer.h:57
Weights weights_
Weights over which values/masses to be decomposed.
Definition: RealMassDecomposer.h:90
integer_decomposer_type::decompositions_type decompositions_type
Type of result decompositions from integer decomposer.
Definition: RealMassDecomposer.h:52
unsigned long long number_of_decompositions_type
Type of the number of decompositions.
Definition: RealMassDecomposer.h:55
std::shared_ptr< integer_decomposer_type > decomposer_
Definition: RealMassDecomposer.h:102
double precision_
Precision to scale double values to integer.
Definition: RealMassDecomposer.h:96
decompositions_type getDecompositions(double mass, double error)
integer_decomposer_type::value_type integer_value_type
Type of integer values that are decomposed.
Definition: RealMassDecomposer.h:49
decompositions_type getDecompositions(double mass, double error, const constraints_type &constraints)
number_of_decompositions_type getNumberOfDecompositions(double mass, double error)
RealMassDecomposer(const Weights &weights)
IntegerMassDecomposer integer_decomposer_type
Type of integer decomposer.
Definition: RealMassDecomposer.h:46
Represents a set of weights (double values and scaled with a certain precision their integer counterp...
Definition: Weights.h:42
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22