13 bool recomputeHeights =
false;
14 for (
unsigned int i = 0; i < pl.
size(); ++i)
16 if (pl[i].getName().substr(0, 7) ==
"HeightP" || pl[i].getName() ==
"TotalHeight")
17 recomputeHeights =
true;
26 tl_->setParameters(pl2);
36 if (p.
getName().substr(0, 7) ==
"HeightP" || p.
getName() ==
"TotalHeight")
47 throw Exception(
"GlobalClockTreeLikelihoodFunctionWrapper::initParameters_(). Tree is unrooted!");
49 throw Exception(
"GlobalClockTreeLikelihoodFunctionWrapper::initParameters_(). Tree is multifurcating.");
50 std::map<const Node*, double> heights;
54 for (std::map<const Node*, double>::iterator it = heights.begin(); it != heights.end(); it++)
56 if (!it->first->isLeaf() && it->first->hasFather())
58 double fatherHeight = heights[it->first->getFather()];
64 for (
unsigned int i = 0; i < pl.
size(); ++i)
66 if (pl[i].getName().substr(0, 5) !=
"BrLen")
85 double sonHeight = sonHeightP * height;
const Parameter & parameter(const std::string &name) const override
virtual void addParameter_(Parameter *parameter)
size_t getNumberOfParameters() const override
const ParameterList & getParameters() const override
Parameter & getParameter_(const std::string &name)
void computeBranchLengthsFromHeights_(const Node *node, double height, ParameterList &brlenPl)
void fireParameterChanged(const bpp::ParameterList &pl)
GlobalClockTreeLikelihoodFunctionWrapper * clone() const
ParameterList getHeightParameters() const
std::shared_ptr< TreeLikelihoodInterface > tl_
The phylogenetic node class.
virtual int getId() const
Get the node's id.
virtual const Node * getSon(size_t pos) const
virtual bool isLeaf() const
virtual size_t getNumberOfSons() const
virtual void addParameter(const Parameter ¶m)
static const std::shared_ptr< IntervalConstraint > PROP_CONSTRAINT_IN
virtual double getValue() const
static const std::shared_ptr< IntervalConstraint > R_PLUS_STAR
virtual const std::string & getName() const
The phylogenetic tree class.
bool isRooted() const
Tell if the tree is rooted.
virtual N * getRootNode()
std::string toString(T t)
Defines the basic types of data flow nodes.