Class to encapsulate a scalar value and an associated round-off error. The error is tracked through operations performed between scalarAndError variables. More...
Public Types | |
typedef scalarAndError | cmptType |
Component type. More... | |
Public Member Functions | |
scalarAndError () | |
Default construct. More... | |
scalarAndError (const zero &) | |
Construct zero. More... | |
scalarAndError (const scalar v) | |
Construct from a scalar. More... | |
scalarAndError (const scalar v, const scalar e) | |
Construct from a scalar and an error. More... | |
scalarAndError | operator- () const |
Negate. More... | |
void | operator+= (const scalarAndError &sae) |
Add another scalar-and-error to this one. More... | |
void | operator-= (const scalarAndError &sae) |
Subtract another scalar-and-error from this one. More... | |
void | operator*= (const scalarAndError &sae) |
Multiply another scalar-and-error with this one. More... | |
void | operator/= (const scalarAndError &sae) |
Divide this scalar-and-error by another. More... | |
Public Attributes | |
scalar | value |
The value. More... | |
scalar | error |
The error. More... | |
Static Public Attributes | |
static const direction | dim = 3 |
Dimensionality of space. More... | |
static const direction | rank = 0 |
Rank of scalarAndError is 0. More... | |
static const direction | nComponents = 1 |
Number of components in scalarAndError is 1. More... | |
Class to encapsulate a scalar value and an associated round-off error. The error is tracked through operations performed between scalarAndError variables.
Definition at line 52 of file scalarAndError.H.
typedef scalarAndError cmptType |
Component type.
Definition at line 57 of file scalarAndError.H.
|
inline |
Default construct.
Definition at line 84 of file scalarAndError.H.
Referenced by scalarAndError::operator-().
|
inline |
Construct zero.
Definition at line 88 of file scalarAndError.H.
|
inline |
Construct from a scalar.
Definition at line 95 of file scalarAndError.H.
|
inline |
Construct from a scalar and an error.
Definition at line 102 of file scalarAndError.H.
|
inline |
Negate.
Definition at line 112 of file scalarAndError.H.
References scalarAndError::scalarAndError(), and scalarAndError::value.
|
inline |
Add another scalar-and-error to this one.
Definition at line 118 of file scalarAndError.H.
References scalarAndError::error, Foam::mag(), and scalarAndError::value.
Referenced by scalarAndError::operator-=().
|
inline |
Subtract another scalar-and-error from this one.
Definition at line 125 of file scalarAndError.H.
References scalarAndError::operator+=().
|
inline |
Multiply another scalar-and-error with this one.
Definition at line 131 of file scalarAndError.H.
References scalarAndError::error, Foam::mag(), and scalarAndError::value.
|
inline |
Divide this scalar-and-error by another.
Definition at line 138 of file scalarAndError.H.
References scalarAndError::error, Foam::mag(), Foam::sqr(), and scalarAndError::value.
|
static |
Dimensionality of space.
Definition at line 63 of file scalarAndError.H.
|
static |
Rank of scalarAndError is 0.
Definition at line 66 of file scalarAndError.H.
|
static |
Number of components in scalarAndError is 1.
Definition at line 69 of file scalarAndError.H.
scalar value |
The value.
Definition at line 75 of file scalarAndError.H.
Referenced by face::areaAndCentreStabilised(), scalarAndError::operator*=(), scalarAndError::operator+=(), scalarAndError::operator-(), scalarAndError::operator/=(), Foam::operator<<(), Foam::operator==(), Foam::operator>>(), and Foam::sqrt().
scalar error |
The error.
Definition at line 78 of file scalarAndError.H.
Referenced by face::areaAndCentreStabilised(), scalarAndError::operator*=(), scalarAndError::operator+=(), scalarAndError::operator/=(), Foam::operator<<(), Foam::operator==(), Foam::operator>>(), and Foam::sqrt().