37 #ifndef PROBLIB_MIXTUREPDF_H_ 38 #define PROBLIB_MIXTUREPDF_H_ 140 std::string
toString(
const std::string& indent =
"")
const;
159 weights_total_(orig.weights_total_), n_ptrs_(1) {
162 components_.push_back((*it_pdf)->clone());
Mixture * clone() const
Creates a clone of the object. The clone method is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified.
This class represents the weighted sum of a finite set of probability density functions.
std::vector< double > weights_
void normalizeWeights()
Normalizes the weights of all components.
int components() const
Returns the number of components.
void clear()
Removes all components.
Mixture & operator=(const Mixture &other)
Assignment operator. The operation is cheap since it only copies a pointer. A deep clone will only be...
double getMaxDensity() const
NOT IMPLEMENTED FOR MIXTURE.
void addComponent(const PDF &pdf, double w)
Adds a component pdf with given weight.
const PDF & getComponent(int i) const
Returns a reference to the i'th component.
const_iterator(const field< oT > &in_M, const bool at_end=false)
double getLikelihood(const PDF &pdf) const
MixtureStruct(const MixtureStruct &orig)
virtual ~Mixture()
Destructor.
std::vector< PDF * > components_
Mixture()
Constructs a mixture pdf with no initial components.
double getWeight(int i) const
Returns the weight of the i'th component.
std::string toString(const std::string &indent="") const
Represents the Mixture as a string for easier console output.