stats: adds a Formula operator for division

This commit is contained in:
Nilay Vaish 2013-09-06 16:21:29 -05:00
parent c0a8ad0a35
commit 47d113696d
2 changed files with 18 additions and 0 deletions

View file

@ -387,6 +387,16 @@ Formula::operator+=(Temp r)
return *this;
}
const Formula &
Formula::operator/=(Temp r)
{
assert (root);
root = NodePtr(new BinaryNode<std::divides<Result> >(root, r));
assert(size());
return *this;
}
void
Formula::result(VResult &vec) const
{

View file

@ -2856,6 +2856,14 @@ class Formula : public DataWrapVec<Formula, FormulaInfoProxy>
* @return a reference to this formula.
*/
const Formula &operator+=(Temp r);
/**
* Divide the existing tree by the given one.
* @param r The root of the expression tree.
* @return a reference to this formula.
*/
const Formula &operator/=(Temp r);
/**
* Return the result of the Fomula in a vector. If there were no Vector
* components to the Formula, then the vector is size 1. If there were,