5 #ifndef BPP_NUMERIC_PROB_SIMPLEX_H 6 #define BPP_NUMERIC_PROB_SIMPLEX_H 12 #include "../AbstractParameterAliasable.h" 108 Simplex(
size_t dim,
unsigned short method = 0,
bool allowNull =
false,
const std::string& name =
"Simplex.");
123 Simplex(
const std::vector<double>& probas,
unsigned short method = 0,
bool allowNull =
false,
const std::string& name =
"Simplex.");
140 double prob(
size_t i)
const {
return vProb_[i]; }
184 OrderedSimplex(
size_t dim,
unsigned short method = 0,
bool allowNull =
false,
const std::string& name =
"Simplex.") :
185 Simplex(dim, method, allowNull, name),
191 for (
auto i = dim; i > 0; i--)
193 x += probs[i - 1] / (int)i;
213 OrderedSimplex(
const std::vector<double>& probas,
unsigned short method = 0,
bool allowNull =
false,
const std::string& name =
"Simplex.");
223 #endif // BPP_NUMERIC_PROB_SIMPLEX_H std::vector< double > & getFrequencies()
void setFrequencies(const std::vector< double > &)
const std::vector< double > & getFrequencies() const
Simplex where all values are in decreasing order.
void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
unsigned short getMethod() const
const std::vector< double > & getFrequencies() const
std::vector< double > vProb_
std::vector< double > vValues_
size_t dim_
The dimension+1 of the space simplex (ie the number of probabilities).
double prob(size_t i) const
OrderedSimplex(size_t dim, unsigned short method=0, bool allowNull=false, const std::string &name="Simplex.")
Builds a new Simplex object from a number of probabilities. They are initialized equal.
A Simplex object, used to define sets of probabilities that sum 1.
The parameter list object.
A partial implementation of the Parametrizable interface.
std::vector< double > valpha_
just used with local ratio (method 2)
Simplex(size_t dim, unsigned short method=0, bool allowNull=false, const std::string &name="Simplex.")
Builds a new Simplex object from a number of probabilities. They are initialized equal.
unsigned short method_
the method of parametrization.
Simplex * clone() const
Create a copy of this object and send a pointer to it.