10 #ifndef SRC_INCLUDE_SMASH_THREEVECTOR_H_ 
   11 #define SRC_INCLUDE_SMASH_THREEVECTOR_H_ 
   52   double inline x1() 
const;
 
   54   void inline set_x1(
double x);
 
   56   double inline x2() 
const;
 
   58   void inline set_x2(
double y);
 
   60   double inline x3() 
const;
 
   62   void inline set_x3(
double z);
 
   64   double inline sqr() 
const;
 
   66   double inline abs() 
const;
 
   91   void inline rotate(
double phi, 
double theta, 
double psi);
 
  156   std::array<double, 3> 
x_;
 
  232   return a.
x1() * b.
x1() + a.
x2() * b.
x2() + a.
x3() * b.
x3();
 
  246   const double a_inv = 1.0 / a;
 
  267     return std::atan2(
x2(), 
x1());
 
  273   return (r > 0.) ? std::acos(
x3() / r) : 0.;
 
  278   const double cos_phi = std::cos(phi);
 
  279   const double sin_phi = std::sin(phi);
 
  280   const double cos_theta = std::cos(theta);
 
  281   const double sin_theta = std::sin(theta);
 
  282   const double cos_psi = std::cos(psi);
 
  283   const double sin_psi = std::sin(psi);
 
  285   std::array<double, 3> x_old = 
x_;
 
  287   x_[0] = (cos_phi * cos_psi - sin_phi * cos_theta * sin_psi) * x_old[0] +
 
  288           (-cos_phi * sin_psi - sin_phi * cos_theta * cos_psi) * x_old[1] +
 
  289           (sin_phi * sin_theta) * x_old[2];
 
  290   x_[1] = (sin_phi * cos_psi + cos_phi * cos_theta * sin_psi) * x_old[0] +
 
  291           (-sin_phi * sin_psi + cos_phi * cos_theta * cos_psi) * x_old[1] +
 
  292           (-cos_phi * sin_theta) * x_old[2];
 
  293   x_[2] = (sin_theta * sin_psi) * x_old[0] + (sin_theta * cos_psi) * x_old[1] +
 
  294           (cos_theta)*x_old[2];
 
  298   const double cost = std::cos(theta);
 
  299   const double sint = std::sin(theta);
 
  301   std::array<double, 3> x_old = 
x_;
 
  303   x_[0] = cost * x_old[0] + sint * x_old[2];
 
  305   x_[2] = -sint * x_old[0] + cost * x_old[2];
 
  309   const double cost = std::cos(theta);
 
  310   const double sint = std::sin(theta);
 
  312   std::array<double, 3> x_old = 
x_;
 
  314   x_[0] = cost * x_old[0] - sint * x_old[1];
 
  315   x_[1] = sint * x_old[0] + cost * x_old[1];
 
The ThreeVector class represents a physical three-vector  with the components .
 
std::array< double, 3 > x_
the internal storage of the components.
 
ThreeVector operator-=(const ThreeVector &v)
decrease this vector by
 
void set_x1(double x)
set first component
 
ThreeVector(double y1, double y2, double y3)
Constructor for ThreeVector that takes 3 doubles to set up a ThreeVector with desired values for the ...
 
std::array< double, 3 >::iterator iterator
iterates over the components
 
void rotate_around_y(double theta)
Rotate the vector around the y axis by the given angle theta.
 
const_iterator begin() const
const overload of the above
 
bool operator!=(const ThreeVector &rhs) const
 
const_iterator cbegin() const
 
void rotate_around_z(double theta)
Rotate the vector around the z axis by the given angle theta.
 
void set_x3(double z)
set third component
 
void rotate(double phi, double theta, double psi)
Rotate vector by the given Euler angles phi, theta, psi.
 
ThreeVector operator*=(const double &a)
scale this vector by
 
void set_x2(double y)
set second component
 
bool operator==(const ThreeVector &rhs) const
 
void rotate_z_axis_to(ThreeVector &r)
Rotate the z-axis onto the vector r.
 
double & operator[](std::size_t i)
access the component at offset i.
 
ThreeVector operator+=(const ThreeVector &v)
increase this vector by
 
ThreeVector operator/=(const double &a)
divide this vector by
 
const_iterator cend() const
 
ThreeVector cross_product(const ThreeVector &b) const
 
double operator[](std::size_t i) const
const overload of the above.
 
ThreeVector()
default constructor (nulls all components)
 
const_iterator end() const
const overload of the above
 
ThreeVector operator-() const
negation: Returns
 
std::array< double, 3 >::const_iterator const_iterator
iterates over the components
 
Collection of useful constants that are known at compile time.
 
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action.
 
EnergyMomentumTensor operator-(EnergyMomentumTensor a, const EnergyMomentumTensor &b)
Direct subtraction operator.
 
EnergyMomentumTensor operator*(EnergyMomentumTensor a, const double b)
Direct multiplication operator.
 
constexpr double really_small
Numerical error tolerance.
 
EnergyMomentumTensor operator+(EnergyMomentumTensor a, const EnergyMomentumTensor &b)
Direct addition operator.
 
EnergyMomentumTensor operator/(EnergyMomentumTensor a, const double b)
Direct division operator.