SpECTRE
v2024.09.29
|
Represents an interval of time within a single slab. More...
#include <Time.hpp>
Public Types | |
using | rational_t = Time::rational_t |
Public Member Functions | |
TimeDelta ()=default | |
Default constructor gives an invalid TimeDelta. | |
TimeDelta (Slab slab, rational_t fraction) | |
An interval covering a given fraction of the slab. | |
TimeDelta | with_slab (const Slab &new_slab) const |
Move the interval to a different slab. The resulting interval will in general not be the same length, but will take up the same fraction of its slab. | |
Slab | slab () const |
rational_t | fraction () const |
double | value () const |
Approximate numerical length of the interval. | |
bool | is_positive () const |
Test if the interval is oriented towards larger time. | |
TimeDelta & | operator+= (const TimeDelta &other) |
TimeDelta & | operator-= (const TimeDelta &other) |
TimeDelta | operator+ () const |
TimeDelta | operator- () const |
TimeDelta & | operator*= (const rational_t &mult) |
TimeDelta & | operator/= (const rational_t &div) |
void | pup (PUP::er &p) |
Friends | |
class | Time |
Represents an interval of time within a single slab.