15#include <OpenMS/config.h>
82 alphabet_masses_(masses),
85 setPrecision(precision);
94 alphabet_masses_(other.alphabet_masses_),
95 precision_(other.precision_),
96 weights_(other.weights_) {}
113 return weights_.size();
166 return weights_.back();
177 return alphabet_masses_[i];
Pairs an alphabet of double-valued masses with the scaled integer weights derived from them.
Definition Weights.h:44
void swap(size_type index1, size_type index2)
Exchange the alphabet mass and the integer weight at index1 with those at index2.
alphabet_mass_type getMinRoundingError() const
Largest negative relative rounding error introduced by the current precision.
weights_type weights_
Definition Weights.h:251
alphabet_masses_type alphabet_masses_
Definition Weights.h:241
alphabet_mass_type precision_
Definition Weights.h:246
void setPrecision(alphabet_mass_type precision)
Replace the precision and recompute the integer weights from the stored alphabet masses.
alphabet_mass_type getMaxRoundingError() const
Largest positive relative rounding error introduced by the current precision.
Weights(const Weights &other)
Definition Weights.h:93
size_type size() const
Definition Weights.h:111
Weights(const alphabet_masses_type &masses, alphabet_mass_type precision)
Construct from a set of masses and a precision.
Definition Weights.h:81
weight_type back() const
Definition Weights.h:164
alphabet_mass_type getParentMass(const std::vector< unsigned int > &decomposition) const
Reconstruct a parent mass from a decomposition expressed as multiplicities of the alphabet.
weight_type operator[](size_type i) const
Definition Weights.h:154
Weights & operator=(const Weights &other)
double alphabet_mass_type
Type of double values to be used.
Definition Weights.h:50
bool divideByGCD()
Divide every integer weight by the greatest common divisor of all weights and scale the precision acc...
weight_type getWeight(size_type i) const
Definition Weights.h:122
std::vector< alphabet_mass_type > alphabet_masses_type
Type of container to store double values.
Definition Weights.h:56
long unsigned int weight_type
Type of integer values to be used.
Definition Weights.h:47
std::vector< weight_type > weights_type
Type of container to store integer values.
Definition Weights.h:53
Weights()
Default constructor.
Definition Weights.h:67
weights_type::size_type size_type
Type of container's size.
Definition Weights.h:59
alphabet_mass_type getPrecision() const
Definition Weights.h:141
alphabet_mass_type getAlphabetMass(size_type i) const
Definition Weights.h:175
std::ostream & operator<<(std::ostream &os, const IMSAlphabet &alphabet)
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19