Public Member Functions |
Static Public Member Functions |
Protected Types |
Protected Attributes |
Friends
Matrix< N > Class Template Reference General
Inheritance diagram for Matrix< N >:
![]()
Detailed Descriptiontemplate<size_t N>
|
typedef Eigen::Matrix<double,N> EMatrix [protected] |
Definition at line 253 of file MatrixN.hh.
Matrix | ( | ) | [inline] |
Definition at line 67 of file MatrixN.hh.
{ _matrix.loadZero(); }
Definition at line 71 of file MatrixN.hh.
{ _matrix = other._matrix; }
double det | ( | ) | const [inline] |
double get | ( | const size_t | i, |
const size_t | j | ||
) | const [inline] |
Definition at line 84 of file MatrixN.hh.
Referenced by FParameter::_calcFParameter(), Sphericity::_calcSphericity(), Rivet::diagonalize(), Rivet::fuzzyEquals(), LorentzTransform::mkMatrix4(), and Rivet::toString().
{ if (i < N && j < N) { return _matrix(i, j); } else { throw std::runtime_error("Attempted get access outside matrix bounds."); } }
Definition at line 107 of file MatrixN.hh.
Referenced by LorentzTransform::boost().
{ Vector<N> rtn; for (size_t i = 0; i < N; ++i) { rtn.set(i, _matrix(i,col)); } return rtn; }
Definition at line 92 of file MatrixN.hh.
{ Vector<N> rtn; for (size_t i = 0; i < N; ++i) { rtn.set(i, _matrix(row,i)); } return rtn; }
Calculate inverse.
Definition at line 134 of file MatrixN.hh.
Referenced by LorentzTransform::inverse(), Rivet::inverse(), and LorentzTransform::rotate().
{ Matrix<N> tmp; tmp._matrix = _matrix.inverse(); return tmp; }
bool isDiag | ( | ) | const [inline] |
Check that all off-diagonal elements are zero, allowing for numerical precision.
Definition at line 193 of file MatrixN.hh.
{ for (size_t i=0; i < N; ++i) { for (size_t j=0; j < N; ++j) { if (i == j) continue; if (! Rivet::isZero(_matrix(i,j)) ) return false; } } return true; }
Check for index-wise equality, allowing for numerical precision.
Definition at line 178 of file MatrixN.hh.
Referenced by Matrix< 4 >::isSymm().
{ for (size_t i=0; i < N; ++i) { for (size_t j=i; j < N; ++j) { if (! Rivet::isZero(_matrix(i,j) - other._matrix(i,j)) ) return false; } } return true; }
bool isSymm | ( | ) | const [inline] |
Check for symmetry under transposition.
Definition at line 188 of file MatrixN.hh.
Referenced by FParameter::_calcFParameter(), and Sphericity::_calcSphericity().
bool isZero | ( | double | tolerance = 1E-5 | ) | const [inline] |
Index-wise check for nullness, allowing for numerical precision.
Definition at line 168 of file MatrixN.hh.
Referenced by Rivet::isZero().
{ for (size_t i=0; i < N; ++i) { for (size_t j=0; j < N; ++j) { if (! Rivet::isZero(_matrix(i,j), tolerance) ) return false; } } return true; }
Definition at line 48 of file MatrixN.hh.
{ Matrix<N> rtn; for (size_t i = 0; i < N; ++i) { rtn.set(i, i, diag[i]); } return rtn; }
static Matrix<N> mkIdentity | ( | ) | [inline, static] |
Definition at line 56 of file MatrixN.hh.
{ Matrix<N> rtn; for (size_t i = 0; i < N; ++i) { rtn.set(i, i, 1); } return rtn; }
Definition at line 43 of file MatrixN.hh.
{
Matrix<N> rtn;
return rtn;
}
Definition at line 207 of file MatrixN.hh.
{ return _matrix != a._matrix; }
Definition at line 227 of file MatrixN.hh.
Matrix<N>& operator*= | ( | const double | a | ) | [inline] |
Definition at line 232 of file MatrixN.hh.
{ _matrix *= a; return *this; }
Definition at line 242 of file MatrixN.hh.
Matrix<N> operator- | ( | ) | const [inline] |
Negate.
Definition at line 156 of file MatrixN.hh.
{ Matrix<N> rtn; rtn._matrix = -_matrix; return rtn; }
Definition at line 247 of file MatrixN.hh.
Matrix<N>& operator/= | ( | const double | a | ) | [inline] |
Definition at line 237 of file MatrixN.hh.
{ _matrix /= a; return *this; }
bool operator< | ( | const Matrix< N > & | a | ) | const [inline] |
Definition at line 211 of file MatrixN.hh.
{ return _matrix < a._matrix; }
bool operator<= | ( | const Matrix< N > & | a | ) | const [inline] |
Definition at line 215 of file MatrixN.hh.
{ return _matrix <= a._matrix; }
bool operator== | ( | const Matrix< N > & | a | ) | const [inline] |
Definition at line 203 of file MatrixN.hh.
{ return _matrix == a._matrix; }
bool operator> | ( | const Matrix< N > & | a | ) | const [inline] |
Definition at line 219 of file MatrixN.hh.
{ return _matrix > a._matrix; }
bool operator>= | ( | const Matrix< N > & | a | ) | const [inline] |
Definition at line 223 of file MatrixN.hh.
{ return _matrix >= a._matrix; }
Definition at line 75 of file MatrixN.hh.
Referenced by FParameter::_calcFParameter(), Sphericity::_calcSphericity(), Matrix< 4 >::mkDiag(), Matrix< 4 >::mkIdentity(), LorentzTransform::mkMatrix4(), and LorentzTransform::setBoost().
{ if (i < N && j < N) { _matrix(i, j) = value; } else { throw std::runtime_error("Attempted set access outside matrix bounds."); } return *this; }
Definition at line 115 of file MatrixN.hh.
{ for (size_t i = 0; i < N; ++i) { _matrix(i,col) = c.get(i); } return *this; }
Definition at line 100 of file MatrixN.hh.
{ for (size_t i = 0; i < N; ++i) { _matrix(row,i) = r.get(i); } return *this; }
size_t size | ( | ) | const [inline] |
Get dimensionality.
Definition at line 163 of file MatrixN.hh.
Referenced by Rivet::toString().
{
return N;
}
double trace | ( | ) | const [inline] |
Calculate trace.
Definition at line 146 of file MatrixN.hh.
Referenced by Rivet::trace().
{ double tr = 0.0; for (size_t i = 0; i < N; ++i) { tr += _matrix(i,i); } return tr; // return _matrix.trace(); }
Definition at line 122 of file MatrixN.hh.
Referenced by Matrix< 4 >::isSymm(), and Rivet::transpose().
{ Matrix<N> tmp = *this; tmp._matrix.replaceWithAdjoint(); return tmp; }
Definition at line 254 of file MatrixN.hh.
Referenced by Rivet::add(), Matrix< 4 >::det(), Matrix< 4 >::get(), Matrix< 4 >::getColumn(), Matrix< 4 >::getRow(), Matrix< 4 >::inverse(), Matrix< 4 >::isDiag(), Matrix< 4 >::isEqual(), Matrix< 4 >::isZero(), Matrix< 4 >::Matrix(), Rivet::multiply(), Matrix< 4 >::operator!=(), Matrix< 4 >::operator*=(), Matrix< 4 >::operator+=(), Matrix< 4 >::operator-(), Matrix< 4 >::operator-=(), Matrix< 4 >::operator/=(), Matrix< 4 >::operator<(), Matrix< 4 >::operator<=(), Matrix< 4 >::operator==(), Matrix< 4 >::operator>(), Matrix< 4 >::operator>=(), Matrix< 4 >::set(), Matrix< 4 >::setColumn(), Matrix< 4 >::setRow(), Matrix< 4 >::trace(), and Matrix< 4 >::transpose().