Version: SMASH-3.1
smash::Test::Position Struct Reference

#include <setup.h>

A FourVector that is marked as a position vector.

Definition at line 86 of file setup.h.

Inheritance diagram for smash::Test::Position:
smash::FourVector

Public Member Functions

 FourVector ()
 default constructor nulls the fourvector components More...
 
 FourVector (double y0, double y1, double y2, double y3)
 copy constructor More...
 
 FourVector (double y0, ThreeVector vec)
 construct from time-like component and a ThreeVector. More...
 
- Public Member Functions inherited from smash::FourVector
 FourVector ()
 default constructor nulls the fourvector components More...
 
 FourVector (double y0, double y1, double y2, double y3)
 copy constructor More...
 
 FourVector (double y0, ThreeVector vec)
 construct from time-like component and a ThreeVector. More...
 
double & operator[] (std::size_t i)
 access the component at offset i. More...
 
double operator[] (std::size_t i) const
 const overload of the [] operator More...
 
double x0 () const
 
void set_x0 (double t)
 
double x1 () const
 
void set_x1 (double x)
 
double x2 () const
 
void set_x2 (double y)
 
double x3 () const
 
void set_x3 (double z)
 
ThreeVector threevec () const
 
void reset ()
 Set all the 4-vector components to 0. More...
 
ThreeVector velocity () const
 Get the velocity (3-vector divided by zero component). More...
 
double Dot (const FourVector &a) const
 calculate the scalar product with another four-vector More...
 
double sqr () const
 calculate the square of the vector (which is a scalar) More...
 
double abs () const
 calculate the lorentz invariant absolute value More...
 
double sqr3 () const
 calculate the square of the spatial three-vector More...
 
double abs3 () const
 calculate the absolute value of the spatial three-vector More...
 
double tau () const
 calculate the proper time from the given four vector More...
 
double eta () const
 calculate the space-time rapidity from the given four vector More...
 
FourVector lorentz_boost (const ThreeVector &v) const
 Returns the FourVector boosted with velocity v. More...
 
bool operator== (const FourVector &a) const
 Check if all four vector components are almost equal (accuracy \(10^{-4}\)). More...
 
bool operator!= (const FourVector &a) const
 checks inequality (logical complement to FourVector::operator==(const FourVector&) const) More...
 
bool operator< (const FourVector &a) const
 checks if \(x^\mu < a^\mu\) for all \(\mu\) (all four vector components are below comparison vector) More...
 
bool operator> (const FourVector &a) const
 checks if \(x^\mu > a^\mu\) for all \(\mu\) (all four vector components are above comparison vector) More...
 
bool operator<= (const FourVector &a) const
 logical complement to FourVector::operator>(const FourVector&) const More...
 
bool operator>= (const FourVector &a) const
 logical complement to FourVector::operator<(const FourVector&) const More...
 
FourVector operator+= (const FourVector &a)
 adds \(a_\mu: x_\mu^\prime = x_\mu + a_\mu\) More...
 
FourVector operator-= (const FourVector &a)
 subtracts \(a_\mu: x_\mu^\prime = x_\mu - a_\mu\) More...
 
FourVector operator*= (const double &a)
 multiplies by \(a: x_\mu^\prime = a \cdot x_\mu\) More...
 
FourVector operator/= (const double &a)
 divides by \(a: x_\mu^\prime = \frac{1}{a} \cdot x_\mu\) More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 

Additional Inherited Members

- Public Types inherited from smash::FourVector
using iterator = std::array< double, 4 >::iterator
 iterates over the components More...
 
using const_iterator = std::array< double, 4 >::const_iterator
 iterates over the components More...
 

Member Function Documentation

◆ FourVector() [1/3]

smash::FourVector::FourVector
inline

default constructor nulls the fourvector components

Definition at line 36 of file fourvector.h.

36 : x_({0., 0., 0., 0.}) {}
std::array< double, 4 > x_
internal storage of this vector's components
Definition: fourvector.h:308

◆ FourVector() [2/3]

smash::FourVector::FourVector
inline

copy constructor

Parameters
[in]y0The time component to be copied
[in]y1The x component to be copied
[in]y2The y component to be copied
[in]y3the z component to be copied

Definition at line 46 of file fourvector.h.

47  : x_({y0, y1, y2, y3}) {}

◆ FourVector() [3/3]

smash::FourVector::FourVector
inline

construct from time-like component and a ThreeVector.

Parameters
[in]y0The time component to be used
[in]vecA ThreeVector (x,y,z) to be used

Definition at line 55 of file fourvector.h.

56  : x_({y0, vec.x1(), vec.x2(), vec.x3()}) {}

The documentation for this struct was generated from the following file: