|
BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Simple three vector that's templated so the right type can be used. More...
#include <BDSThreeVector.hh>

Public Member Functions | |
| BDSThreeVector () | |
| Default constructor. | |
| BDSThreeVector (T xIn, T yIn, T zIn) | |
| Alternate constructor. | |
| BDSThreeVector (const BDSThreeVector &other) | |
| Copy constructor. | |
| BDSThreeVector & | operator= (const BDSThreeVector &rhs) |
| Assignment operator. | |
| T & | operator[] (const G4int index) |
| Access / set a single element. | |
| const T & | operator[] (const G4int index) const |
| Access a single element. | |
| T | dot (const BDSThreeVector &b) const |
| T | mag () const |
| Get the magnitude of it. | |
| BDSThreeVector & | operator*= (G4double a) |
| const T & | x () const |
| Accessor by name. | |
| const T & | y () const |
| Accessor by name. | |
| const T & | z () const |
| Accessor by name. | |
Private Attributes | |
| T | values [3] |
| Member data - x,y,z. | |
Friends | |
| std::ostream & | operator<< (std::ostream &out, BDSThreeVector const &v) |
| Output stream. | |
| BDSThreeVector | operator* (const BDSThreeVector &a, const double &b) |
| Multiplication. | |
| BDSThreeVector | operator* (const double &b, const BDSThreeVector &a) |
| Multiplication. | |
| T | operator* (const BDSThreeVector &a, const BDSThreeVector &b) |
| Multiplication. | |
| BDSThreeVector | operator+ (const BDSThreeVector &a, const G4double &b) |
| Addition, subtraction. | |
| BDSThreeVector | operator+ (const BDSThreeVector &a, const BDSThreeVector &b) |
| Addition, subtraction. | |
| BDSThreeVector | operator- (const BDSThreeVector &a, const G4double &b) |
| Addition, subtraction. | |
| BDSThreeVector | operator- (const BDSThreeVector &a, const BDSThreeVector &b) |
| Addition, subtraction. | |
Simple three vector that's templated so the right type can be used.
The G4ThreeVector(HEP::ThreeVector) is much better, but this only uses a double. Here, a simple three vector that's templated allows the possibility of using float or double precision, which could make a significant difference to the memory usage - very important for large arrays of this class.
Should more complex features be required - it's best to use an actual G4ThreeVector - constructed from this - and then translated back.
Definition at line 43 of file BDSThreeVector.hh.
|
inline |
Default constructor.
Definition at line 47 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
|
inline |
Alternate constructor.
Definition at line 51 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
|
inline |
Copy constructor.
Definition at line 55 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
|
inline |
Definition at line 98 of file BDSThreeVector.hh.
|
inline |
Get the magnitude of it.
Definition at line 102 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
Referenced by BDS::mag().

|
inline |
Definition at line 124 of file BDSThreeVector.hh.
|
inline |
Assignment operator.
Definition at line 62 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
|
inline |
Access / set a single element.
Definition at line 73 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
|
inline |
Access a single element.
Definition at line 81 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
|
inline |
Accessor by name.
Definition at line 89 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
Referenced by BDSArrayOperatorValueReflect::Apply(), BDSArrayOperatorValueFlip::Apply(), BDSArray2DCoordsRDipole::GetConst(), BDSArray2DCoordsRQuad::GetConst(), BDSInterpolator1D::GetInterpolatedValue(), BDSInterpolator2D::GetInterpolatedValue(), BDSInterpolator3D::GetInterpolatedValue(), and BDSInterpolator4D::GetInterpolatedValue().

|
inline |
Accessor by name.
Definition at line 90 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
Referenced by BDSArrayOperatorValueReflect::Apply(), BDSArrayOperatorValueFlip::Apply(), BDSArray2DCoordsRDipole::GetConst(), BDSArray2DCoordsRQuad::GetConst(), BDSInterpolator1D::GetInterpolatedValue(), BDSInterpolator2D::GetInterpolatedValue(), BDSInterpolator3D::GetInterpolatedValue(), and BDSInterpolator4D::GetInterpolatedValue().

|
inline |
Accessor by name.
Definition at line 91 of file BDSThreeVector.hh.
References BDSThreeVector< T >::values.
Referenced by BDSArrayOperatorValueReflect::Apply(), BDSArrayOperatorValueFlip::Apply(), BDSArray2DCoordsRQuad::GetConst(), BDSInterpolator1D::GetInterpolatedValue(), BDSInterpolator2D::GetInterpolatedValue(), BDSInterpolator3D::GetInterpolatedValue(), and BDSInterpolator4D::GetInterpolatedValue().

|
friend |
Multiplication.
Definition at line 109 of file BDSThreeVector.hh.
|
friend |
Multiplication.
Definition at line 105 of file BDSThreeVector.hh.
|
friend |
Multiplication.
Definition at line 107 of file BDSThreeVector.hh.
|
friend |
Addition, subtraction.
Definition at line 116 of file BDSThreeVector.hh.
|
friend |
Addition, subtraction.
Definition at line 114 of file BDSThreeVector.hh.
|
friend |
Addition, subtraction.
Definition at line 120 of file BDSThreeVector.hh.
|
friend |
Addition, subtraction.
Definition at line 118 of file BDSThreeVector.hh.
|
friend |
Output stream.
Definition at line 95 of file BDSThreeVector.hh.
|
private |
Member data - x,y,z.
Definition at line 134 of file BDSThreeVector.hh.
Referenced by BDSThreeVector< T >::BDSThreeVector(), BDSThreeVector< T >::BDSThreeVector(), BDSThreeVector< T >::BDSThreeVector(), BDSThreeVector< T >::mag(), BDSThreeVector< T >::operator=(), BDSThreeVector< T >::operator[](), BDSThreeVector< T >::operator[](), BDSThreeVector< T >::x(), BDSThreeVector< T >::y(), and BDSThreeVector< T >::z().