|
Storm 1.14.0.1
A Modern Probabilistic Model Checker
|
A value of ValueType extended with the two infinities -infinity and +infinity. More...
#include <ExtendedNumber.h>
Public Types | |
| enum class | Kind { NegativeInfinity , Finite , PositiveInfinity } |
Public Member Functions | |
| ExtendedNumber () | |
| Creates a finite value that is zero. | |
| ExtendedNumber (ValueType const &value) | |
| Creates a finite value. | |
| ExtendedNumber (ValueType &&value) | |
| ExtendedNumber (ExtendedNumber const &)=default | |
| ExtendedNumber (ExtendedNumber &&)=default | |
| ExtendedNumber & | operator= (ExtendedNumber const &)=default |
| ExtendedNumber & | operator= (ExtendedNumber &&)=default |
| ~ExtendedNumber ()=default | |
| bool | isFinite () const |
| bool | isInfinite () const |
| bool | isPositiveInfinity () const |
| bool | isNegativeInfinity () const |
| ValueType const & | getFinite () const |
| ValueType & | getFinite () |
| ExtendedNumber | operator- () const |
| ExtendedNumber const & | operator+ () const |
| ExtendedNumber & | operator+= (ExtendedNumber const &other) |
| ExtendedNumber & | operator-= (ExtendedNumber const &other) |
| ExtendedNumber & | operator*= (ExtendedNumber const &other) |
| ExtendedNumber & | operator/= (ExtendedNumber const &other) |
Static Public Member Functions | |
| static ExtendedNumber | infinity () |
| static ExtendedNumber | negativeInfinity () |
Friends | |
| bool | operator== (ExtendedNumber const &first, ExtendedNumber const &second) |
| bool | operator!= (ExtendedNumber const &first, ExtendedNumber const &second) |
| bool | operator< (ExtendedNumber const &first, ExtendedNumber const &second) |
| bool | operator<= (ExtendedNumber const &first, ExtendedNumber const &second) |
| bool | operator> (ExtendedNumber const &first, ExtendedNumber const &second) |
| bool | operator>= (ExtendedNumber const &first, ExtendedNumber const &second) |
| bool | operator== (ExtendedNumber const &first, ValueType const &second) |
| The comparisons against a plain value. | |
| bool | operator== (ValueType const &first, ExtendedNumber const &second) |
| bool | operator!= (ExtendedNumber const &first, ValueType const &second) |
| bool | operator!= (ValueType const &first, ExtendedNumber const &second) |
| bool | operator< (ExtendedNumber const &first, ValueType const &second) |
| bool | operator< (ValueType const &first, ExtendedNumber const &second) |
| bool | operator<= (ExtendedNumber const &first, ValueType const &second) |
| bool | operator<= (ValueType const &first, ExtendedNumber const &second) |
| bool | operator> (ExtendedNumber const &first, ValueType const &second) |
| bool | operator> (ValueType const &first, ExtendedNumber const &second) |
| bool | operator>= (ExtendedNumber const &first, ValueType const &second) |
| bool | operator>= (ValueType const &first, ExtendedNumber const &second) |
| ExtendedNumber | operator+ (ExtendedNumber const &first, ExtendedNumber const &second) |
| ExtendedNumber | operator- (ExtendedNumber const &first, ExtendedNumber const &second) |
| ExtendedNumber | operator* (ExtendedNumber const &first, ExtendedNumber const &second) |
| ExtendedNumber | operator/ (ExtendedNumber const &first, ExtendedNumber const &second) |
| std::ostream & | operator<< (std::ostream &out, ExtendedNumber const &number) |
A value of ValueType extended with the two infinities -infinity and +infinity.
This is intended for value types that cannot represent infinity themselves, i.e., those for which NumberTraits<ValueType>::HasInfinity is false. Types that do have their own infinity (such as double) should be used directly instead; the ExtendedValueType alias below picks the right one.
The arithmetic follows the usual conventions for the extended reals. The forms that are not defined there (infinity - infinity, 0 * infinity, and infinity / infinity) throw an InvalidOperationException rather than yielding a NaN, since the exact value types have no NaN to yield.
ExtendedNumber is meant for the boundaries of a computation: check results, bounds that are handed around as scalars, and values that are converted between value types. It is deliberately not meant to be used as the value type of a transition matrix or of a solver, where the tag would be paid for in the innermost loops.
The operators are hidden friends so that a finite ValueType converts implicitly on either side of them, which lets code that mixes extended and plain values read the way it did before.
Definition at line 37 of file ExtendedNumber.h.
|
strong |
| Enumerator | |
|---|---|
| NegativeInfinity | |
| Finite | |
| PositiveInfinity | |
Definition at line 39 of file ExtendedNumber.h.
|
inline |
Creates a finite value that is zero.
Definition at line 44 of file ExtendedNumber.h.
|
inline |
Creates a finite value.
This conversion is deliberately implicit so that finite values can be used where an extended value is expected.
Definition at line 52 of file ExtendedNumber.h.
|
inline |
Definition at line 56 of file ExtendedNumber.h.
|
default |
|
default |
|
default |
|
inline |
|
inline |
|
inlinestatic |
Definition at line 69 of file ExtendedNumber.h.
|
inline |
Definition at line 83 of file ExtendedNumber.h.
|
inline |
Definition at line 90 of file ExtendedNumber.h.
|
inline |
Definition at line 104 of file ExtendedNumber.h.
|
inline |
Definition at line 97 of file ExtendedNumber.h.
|
inlinestatic |
Definition at line 76 of file ExtendedNumber.h.
|
inline |
Definition at line 274 of file ExtendedNumber.h.
|
inline |
Definition at line 222 of file ExtendedNumber.h.
|
inline |
Definition at line 266 of file ExtendedNumber.h.
|
inline |
Definition at line 211 of file ExtendedNumber.h.
|
inline |
Definition at line 270 of file ExtendedNumber.h.
|
inline |
Definition at line 278 of file ExtendedNumber.h.
|
default |
|
default |
|
friend |
Definition at line 133 of file ExtendedNumber.h.
|
friend |
Definition at line 170 of file ExtendedNumber.h.
|
friend |
Definition at line 174 of file ExtendedNumber.h.
|
friend |
Definition at line 241 of file ExtendedNumber.h.
|
friend |
Definition at line 226 of file ExtendedNumber.h.
|
friend |
Definition at line 237 of file ExtendedNumber.h.
|
friend |
Definition at line 251 of file ExtendedNumber.h.
|
friend |
Definition at line 137 of file ExtendedNumber.h.
|
friend |
Definition at line 178 of file ExtendedNumber.h.
|
friend |
Definition at line 183 of file ExtendedNumber.h.
|
friend |
Definition at line 282 of file ExtendedNumber.h.
|
friend |
Definition at line 144 of file ExtendedNumber.h.
|
friend |
Definition at line 187 of file ExtendedNumber.h.
|
friend |
Definition at line 191 of file ExtendedNumber.h.
|
friend |
Definition at line 126 of file ExtendedNumber.h.
|
friend |
The comparisons against a plain value.
Without these the plain operand is converted to an ExtendedNumber first, which copies it – and for a value type whose copy allocates, such as a GMP rational, that is a heap allocation per comparison. These read the payload directly instead. They are an exact match where the converting ones need a user defined conversion, so they are preferred wherever they apply and change the meaning of nothing.
Definition at line 162 of file ExtendedNumber.h.
|
friend |
Definition at line 166 of file ExtendedNumber.h.
|
friend |
Definition at line 148 of file ExtendedNumber.h.
|
friend |
Definition at line 195 of file ExtendedNumber.h.
|
friend |
Definition at line 199 of file ExtendedNumber.h.
|
friend |
Definition at line 152 of file ExtendedNumber.h.
|
friend |
Definition at line 203 of file ExtendedNumber.h.
|
friend |
Definition at line 207 of file ExtendedNumber.h.