Vector< N > Class Template Reference A minimal base class for
Inheritance diagram for Vector< N >:
![]()
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.
Referenced by Rivet::fuzzyEquals(), Matrix< 4 >::setColumn(), Matrix< 4 >::setRow(), and Vector3::Vector3().
{ 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, protected] |
Definition at line 126 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 67 of file VectorN.hh.
Referenced by LorentzTransform::boost(), and Rivet::isZero().
{ 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 87 of file VectorN.hh.
Referenced by Sphericity::_calcSphericity(), D0_1996_S3214044::_fourJetAnalysis(), D0_1996_S3214044::_threeJetAnalysis(), CLEO_2004_S5809304::analyze(), BELLE_2001_S4598261::analyze(), ARGUS_1993_S2653028::analyze(), BABAR_2007_S7266081::analyze(), ARGUS_1993_S2789213::analyze(), OPAL_1994_S2927284::analyze(), ARGUS_1993_S2669951::analyze(), SLD_2004_S5693039::analyze(), OPAL_1998_S3780481::analyze(), SLD_1999_S3743934::analyze(), OPAL_1995_S3198391::analyze(), ALEPH_2002_S4823664::analyze(), DELPHI_1999_S3960137::analyze(), OPAL_1996_S3257789::analyze(), OPAL_1998_S3702294::analyze(), DELPHI_1995_S3137023::analyze(), ATLAS_2010_CONF_2010_049::analyze(), OPAL_1998_S3749908::analyze(), OPAL_1997_S3396100::analyze(), D0_2004_S5992206::analyze(), ATLAS_2012_I1183818::analyze(), TASSO_1990_S2148048::analyze(), MC_TTBAR::analyze(), MC_ZZJETS::analyze(), MC_WWJETS::analyze(), MC_SUSY::analyze(), ALEPH_1996_S3486095::analyze(), ALEPH_2004_S5765862::analyze(), DELPHI_1996_S3430090::analyze(), LorentzTransform::beta(), LorentzTransform::boost(), Rivet::cmpJetsByAscP(), Rivet::cmpJetsByP(), Rivet::cmpMomByAscP(), Rivet::cmpMomByP(), Rivet::cmpParticleByAscP(), Rivet::cmpParticleByP(), Rivet::mod(), FoxWolframMoments::project(), and LorentzTransform::setBoost().
{ const double norm = mod2(); assert(norm >= 0); return sqrt(norm); }
double mod2 | ( | ) | const [inline] |
Calculate the modulus-squared of a vector. .
Definition at line 76 of file VectorN.hh.
Referenced by ATLAS_2012_I1091481::getPionEnergy(), Vector< 4 >::mod(), Vector< 4 >::mod2(), Rivet::mod2(), Rivet::mod2Cmp(), and LorentzTransform::setBoost().
bool operator!= | ( | const Vector< N > & | a | ) | const [inline] |
Definition at line 104 of file VectorN.hh.
{ return _vec != a._vec; }
Vector<N> operator- | ( | ) | const [inline] |
Invert the vector.
Reimplemented in FourMomentum, Vector3, and FourVector.
Definition at line 94 of file VectorN.hh.
{ Vector<N> rtn; rtn._vec = -_vec; return rtn; }
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 112 of file VectorN.hh.
{ return _vec <= a._vec; }
bool operator== | ( | const Vector< N > & | a | ) | const [inline] |
Definition at line 100 of file VectorN.hh.
{ return _vec == a._vec; }
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; }
const double& operator[] | ( | const size_t | index | ) | const [inline] |
Direct access to vector elements by index.
Definition at line 42 of file VectorN.hh.
{ return get(index); }
double& operator[] | ( | const size_t | index | ) | [inline] |
Direct access to vector elements by index.
Definition at line 47 of file VectorN.hh.
{ return get(index); }
Set indexed value.
Definition at line 52 of file VectorN.hh.
Referenced by Rivet::diagonalize(), Matrix< 4 >::getColumn(), EigenSystem< N >::getDiagVector(), and Matrix< 4 >::getRow().
{ 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] |
Vector dimensionality.
Definition at line 62 of file VectorN.hh.
Referenced by Rivet::_calcS(), Vector< 4 >::mod2(), and Rivet::toString().
{
return N;
}
Eigen::Vector<double,N> _vec [protected] |
Definition at line 135 of file VectorN.hh.
Referenced by Rivet::add(), Vector3::cross(), Vector3::dot(), Vector< 4 >::get(), Vector< 4 >::isZero(), Matrix3::Matrix3(), Rivet::multiply(), Vector< 4 >::operator!=(), FourVector::operator*=(), Vector3::operator*=(), FourMomentum::operator*=(), FourVector::operator+=(), Vector3::operator+=(), FourMomentum::operator+=(), Vector< 4 >::operator-(), FourVector::operator-(), Vector3::operator-(), FourMomentum::operator-(), FourVector::operator-=(), Vector3::operator-=(), FourMomentum::operator-=(), FourVector::operator/=(), Vector3::operator/=(), FourMomentum::operator/=(), Vector< 4 >::operator<(), Vector< 4 >::operator<=(), Vector< 4 >::operator==(), Vector< 4 >::operator>(), Vector< 4 >::operator>=(), Vector< 4 >::set(), Matrix3::setAsRotation(), Rivet::subtract(), and Vector< 4 >::Vector().