base: add some mathematical operators to Cycles class
This commit is contained in:
parent
bc1daae7fd
commit
affd77ea77
1 changed files with 12 additions and 0 deletions
|
@ -113,6 +113,18 @@ class Cycles
|
|||
bool operator>(const Cycles& cc) const
|
||||
{ return c > cc.c; }
|
||||
|
||||
const Cycles operator +(const Cycles& b) const
|
||||
{ return Cycles(c + b.c); }
|
||||
|
||||
const Cycles operator -(const Cycles& b) const
|
||||
{ assert(c >= b.c); return Cycles(c - b.c); }
|
||||
|
||||
const Cycles operator <<(const int32_t shift)
|
||||
{ return Cycles(c << shift); }
|
||||
|
||||
const Cycles operator >>(const int32_t shift)
|
||||
{ return Cycles(c >> shift); }
|
||||
|
||||
#endif // SWIG not touching operators
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue