return BranchProbability(D - N, D);
}
- void print(raw_ostream &OS) const;
+ raw_ostream &print(raw_ostream &OS) const;
void dump() const;
/// result.
///
/// \return \c Num times \c this.
- ///
- /// \note This code should be shared with (or replaced by) the implementation
- /// of \a BlockFrequency::scale(), which seems to be calculating something
- /// similar.
uint64_t scale(uint64_t Num) const;
/// \brief Scale a large integer by the inverse.
/// Returns the floor of the result.
///
/// \return \c Num divided by \c this.
- ///
- /// \note This code should be shared with (or replaced by) the implementation
- /// of \a BlockFrequency::scale(), which seems to be calculating something
- /// similar.
uint64_t scaleByInverse(uint64_t Num) const;
bool operator==(BranchProbability RHS) const {
bool operator>=(BranchProbability RHS) const { return !(*this < RHS); }
};
-raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob);
+inline raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob) {
+ return Prob.print(OS);
+}
}