5 #include "../../Utils/MapTools.h" 14 unique_ptr<DiscreteDistributionInterface> dist,
double p,
double invariant) :
16 dist_(
std::move(dist)),
17 invariant_(invariant),
19 nestedPrefix_(dist_->getNamespace())
35 dist_->matchParametersValues(parameters);
47 size_t distNCat =
dist_->getNumberOfCategories();
48 vector<double> probs =
dist_->getProbabilities();
49 vector<double> cats =
dist_->getCategories();
52 for (
size_t i = 0; i < distNCat; i++)
77 double a =
dist_->getCategory(0), b;
84 for (
size_t i = 1; i < distNCat; i++)
86 b =
dist_->getCategory(i);
118 dist_->restrictToConstraint(c);
InvariantMixedDiscreteDistribution(std::unique_ptr< DiscreteDistributionInterface > dist, double p, double invariant=0.)
Build a new InvariantMixedDiscreteDistribution object.
Partial implementation of the DiscreteDistribution interface.
The constraint interface.
This class is designed to facilitate the manipulation of parameters.
void addParameter_(Parameter *parameter)
void setNamespace(const std::string &prefix)
Set the namespace for the parameter names.
std::unique_ptr< DiscreteDistributionInterface > dist_
double getParameterValue(const std::string &name) const override
Get the value for parameter of name 'name'.
The parameter list object.
virtual void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
virtual bool isCorrect(double value) const =0
Tell if a given value is correct.
std::shared_ptr< IntervalConstraint > intMinMax_
the interval where the distribution is defined/restricted.
void addParameters_(const ParameterList ¶meters)
void restrictToConstraint(const ConstraintInterface &c)
Restricts the distribution to the domain where the constraint is respected, in addition of other pred...
void fireParameterChanged(const ParameterList ¶meters)
Notify the class when one or several parameters have changed.
double getLowerBound() const
methods about the range of the definition
std::map< double, double, Order > distribution_
static const std::shared_ptr< IntervalConstraint > PROP_CONSTRAINT_IN
void updateDistribution()
void setNamespace(const std::string &prefix)
Set the namespace for the parameter names.
Exception thrown when a value do not match a given constraint.
Parameter & getParameter_(const std::string &name)
std::string nestedPrefix_
size_t numberOfCategories_
std::vector< double > bounds_