(9)

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_toperator() (size_t i)
 Operator (): Non constant version. More...
 
const real_toperator() (size_t i) const
 Operator (): Constant version. More...
 
real_toperator[] (size_t i)
 Operator []: Non constant version. More...
 
const real_toperator[] (size_t i) const
 Operator []: Constant version. More...
 
SpaceTimeoperator+= (const SpaceTime &p)
 Operator += More...
 
SpaceTimeoperator-= (const SpaceTime &p)
 Operator -= More...
 
SpaceTimeoperator+= (const real_t &a)
 Operator += More...
 
SpaceTimeoperator-= (const real_t &a)
 Operator -= More...
 
SpaceTimeoperator*= (const real_t &a)
 Operator *= More...
 
SpaceTimeoperator/= (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.
 

Detailed Description

Defines a space-time point.

Operators = and () are overloaded.

Author
Rachid Touzani

Member Function Documentation

◆ isCloseTo()

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.

◆ Normalize()

void Normalize ( )

Normalize vector.

Divide vector components by its 2-norm

◆ operator!=()

bool operator!= ( const SpaceTime p)

Operator !=

Return false if current instance is equal to p, true otherwise.

◆ operator()() [1/2]

real_t& operator() ( size_t  i)

Operator (): Non constant version.

Values i = 1, 2, 3, 4 correspond to x, y, z and t respectively

◆ operator()() [2/2]

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*=()

SpaceTime& operator*= ( const real_t a)

Operator *=

Multiply constant a by current instance coordinates

◆ operator+=() [1/2]

SpaceTime& operator+= ( const SpaceTime p)

Operator +=

Add point p to current instance

◆ operator+=() [2/2]

SpaceTime& operator+= ( const real_t a)

Operator +=

Add constant a to current instance coordinates

◆ operator,()

real_t operator, ( const SpaceTime p) const

Return Dot (scalar) product of two vectors.

A typical use of this operator is double a = (p,q) where p and q are 2 instances of SpaceTime

Parameters
[in]pPoint instance by which the current instance is multiplied

◆ operator-=() [1/2]

SpaceTime& operator-= ( const SpaceTime p)

Operator -=

Subtract point p from current instance

◆ operator-=() [2/2]

SpaceTime& operator-= ( const real_t a)

Operator -=

Subtract constant a from current instance coordinates

◆ operator/=()

SpaceTime& operator/= ( const real_t a)

Operator /=

Divide current instance coordinates by a

◆ operator==()

bool operator== ( const SpaceTime p)

Operator ==

Return true if current instance is equal to p, false otherwise.

◆ operator[]() [1/2]

real_t& operator[] ( size_t  i)

Operator []: Non constant version.

Values i = 0, 1, 2, 3 correspond to x, y, z and t respectively

◆ operator[]() [2/2]

const real_t& operator[] ( size_t  i) const

Operator []: Constant version.

Values i = 0, 1, 2 correspond to x, y, z and t respectively