Defines a space-time point. More...
Public Member Functions | |
SpaceTime () | |
Default constructor. | |
SpaceTime (real_t a, real_t b, real_t c, real_t d) | |
Constructor that assigns a , b , c and d to first, second, third coordinates and time respectively. | |
SpaceTime (const SpaceTime &p) | |
Copy constructor. | |
real_t & | operator() (size_t i) |
Operator () : Non constant version. More... | |
const real_t & | operator() (size_t i) const |
Operator () : Constant version. More... | |
real_t & | operator[] (size_t i) |
Operator [] : Non constant version. More... | |
const real_t & | operator[] (size_t i) const |
Operator [] : Constant version. More... | |
SpaceTime & | operator+= (const SpaceTime &p) |
Operator += More... | |
SpaceTime & | operator-= (const SpaceTime &p) |
Operator -= More... | |
SpaceTime & | operator+= (const real_t &a) |
Operator += More... | |
SpaceTime & | operator-= (const real_t &a) |
Operator -= More... | |
SpaceTime & | operator*= (const real_t &a) |
Operator *= More... | |
SpaceTime & | operator/= (const real_t &a) |
Operator /= More... | |
bool | operator== (const SpaceTime &p) |
Operator == More... | |
bool | operator!= (const SpaceTime &p) |
Operator != More... | |
real_t | NNorm () const |
Return squared euclidean norm of vector. | |
real_t | Norm () const |
Return norm (length) of vector. | |
void | Normalize () |
Normalize vector. More... | |
SpaceTime | Director (const SpaceTime &p) const |
Return Director (Normalized vector) | |
bool | isCloseTo (const SpaceTime &a, real_t toler=OFELI_TOLERANCE) const |
Return true if current point is close to instance a (up to tolerance toler ) More... | |
real_t | operator, (const SpaceTime &p) const |
Return Dot (scalar) product of two vectors. More... | |
Public Attributes | |
real_t | x |
Coordinates. | |
Defines a space-time point.
Operators =
and ()
are overloaded.
bool isCloseTo | ( | const SpaceTime & | a, |
real_t | toler = OFELI_TOLERANCE |
||
) | const |
Return true
if current point is close to instance a
(up to tolerance toler
)
Default value for toler
is the OFELI_TOLERANCE
constant.
void Normalize | ( | ) |
Normalize vector.
Divide vector components by its 2-norm
bool operator!= | ( | const SpaceTime & | p | ) |
Operator !=
Return false
if current instance is equal to p
, true
otherwise.
real_t& operator() | ( | size_t | i | ) |
Operator ()
: Non constant version.
Values i = 1, 2, 3, 4
correspond to x
, y
, z
and t
respectively
const real_t& operator() | ( | size_t | i | ) | const |
Operator ()
: Constant version.
Values i = 1, 2, 3, 4
correspond to x
, y
, z
and t
respectively
Operator *=
Multiply constant a
by current instance coordinates
Operator +=
Add constant a
to current instance coordinates
Operator -=
Subtract constant a
from current instance coordinates
bool operator== | ( | const SpaceTime & | p | ) |
Operator ==
Return true
if current instance is equal to p
, false
otherwise.
real_t& operator[] | ( | size_t | i | ) |
Operator []
: Non constant version.
Values i = 0, 1, 2, 3
correspond to x
, y
, z
and t
respectively
const real_t& operator[] | ( | size_t | i | ) | const |
Operator []
: Constant version.
Values i = 0, 1, 2
correspond to x
, y
, z
and t
respectively