Commit f389bd2e authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

add operator == in Bernstein struct

parent c80dd0c7
......@@ -45,6 +45,17 @@ struct Bern {
return bin_m_i_ * (pow(u, i_)) * pow((1 - u), m_minus_i);
}
virtual bool operator== (const Bern& other) const{
return m_minus_i == other.m_minus_i
&& i_ == other.i_
&& bin_m_i_ == other.bin_m_i_;
}
virtual bool operator!=(const Bern& other) const {
return !(*this == other);
}
/* Attributes */
Numeric m_minus_i;
Numeric i_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment