Vector< N > Class Template Reference A minimal base class for
Detailed Descriptiontemplate<size_t N>
|
Vector | ( | ) | [inline] |
Definition at line 28 of file VectorN.hh.
{ _vec.loadZero(); }
Definition at line 30 of file VectorN.hh.
: _vec(other._vec) { }
const double& get | ( | const size_t | index | ) | const [inline] |
Definition at line 33 of file VectorN.hh.
{ if (index >= N) { throw std::runtime_error("Tried to access an invalid vector index."); } else { return _vec(index); } }
double& get | ( | const size_t | index | ) | [inline] |
Definition at line 41 of file VectorN.hh.
{ if (index >= N) { throw std::runtime_error("Tried to access an invalid vector index."); } else { return _vec(index); } }
bool isZero | ( | double | tolerance = 1E-5 | ) | const [inline] |
Check for nullness, allowing for numerical precision.
Definition at line 75 of file VectorN.hh.
{ for (size_t i=0; i < N; ++i) { if (! Rivet::isZero(_vec[i], tolerance) ) return false; } return true; }
double mod | ( | ) | const [inline] |
Calculate the modulus of a vector. .
Definition at line 95 of file VectorN.hh.
{ const double norm = mod2(); assert(norm >= 0); return sqrt(norm); }
double mod2 | ( | ) | const [inline] |
Calculate the modulus-squared of a vector. .
Definition at line 84 of file VectorN.hh.
Definition at line 112 of file VectorN.hh.
{ return _vec != a._vec; }
Vector<N> operator- | ( | ) | const [inline] |
Invert the vector.
Reimplemented in FourMomentum, FourVector, and Vector3.
Definition at line 102 of file VectorN.hh.
{ Vector<N> rtn; rtn._vec = -_vec; return rtn; }
bool operator< | ( | const Vector< N > & | a | ) | const [inline] |
Definition at line 116 of file VectorN.hh.
{ return _vec < a._vec; }
bool operator<= | ( | const Vector< N > & | a | ) | const [inline] |
Definition at line 120 of file VectorN.hh.
{ return _vec <= a._vec; }
bool operator== | ( | const Vector< N > & | a | ) | const [inline] |
Definition at line 108 of file VectorN.hh.
{ return _vec == a._vec; }
bool operator> | ( | const Vector< N > & | a | ) | const [inline] |
Definition at line 124 of file VectorN.hh.
{ return _vec > a._vec; }
bool operator>= | ( | const Vector< N > & | a | ) | const [inline] |
Definition at line 128 of file VectorN.hh.
{ return _vec >= a._vec; }
const double& operator[] | ( | const size_t | index | ) | const [inline] |
Direct access to vector elements by index.
Definition at line 50 of file VectorN.hh.
{ return get(index); }
double& operator[] | ( | const size_t | index | ) | [inline] |
Direct access to vector elements by index.
Definition at line 55 of file VectorN.hh.
{ return get(index); }
Set indexed value.
Definition at line 60 of file VectorN.hh.
{ if (index >= N) { throw std::runtime_error("Tried to access an invalid vector index."); } else { _vec[index] = value; } return *this; }
size_t size | ( | ) | const [inline] |
Eigen::Vector<double,N> _vec |
Definition at line 133 of file VectorN.hh.