68 template <
unsigned int idim,
unsigned int n =
idim>
74 template <
class MatrixRep>
75 static bool Dinv(MatrixRep& rhs) {
79 unsigned int work[
n+1] = {0};
81 typename MatrixRep::value_type det(0.0);
84 Error(
"Inverter::Dinv",
"Dfact_matrix failed!!");
89 if (ifail == 0)
return true;
101 if (ifail == 0)
return true;
143 template <
unsigned int idim,
unsigned int n =
idim>
147 template <
class MatrixRep>
148 static bool Dinv(MatrixRep& rhs) {
170 template <
class MatrixRep>
171 inline static bool Dinv(MatrixRep&) {
return true; }
187 template <
class MatrixRep>
188 static bool Dinv(MatrixRep& rhs) {
193 rhs[0] = 1. / rhs[0];
212 template <
class MatrixRep>
213 static bool Dinv(MatrixRep& rhs) {
215 typedef typename MatrixRep::value_type
T;
216 T det = rhs[0] * rhs[3] - rhs[2] * rhs[1];
218 if (det ==
T(0.) ) {
return false; }
225 rhs[2] = -s * rhs[2];
226 rhs[1] = -s * rhs[1];
240 T det = rhs[0] * rhs[2] - rhs[1] * rhs[1];
243 if (det ==
T(0.)) {
return false; }
248 rhs[1] = -s * rhs[1];
270 template <
class MatrixRep>
271 static bool Dinv(MatrixRep& rhs);
285 template <
class MatrixRep>
286 static bool Dinv(MatrixRep& rhs);
300 template <
class MatrixRep>
301 static bool Dinv(MatrixRep& rhs);
312 template <
unsigned int idim>
316 template <
class MatrixRep>
318 STATIC_CHECK(
false, Error_cholesky_SMatrix_type_is_not_symmetric );
324 return decomp.
Invert(rhs);
static int DfinvMatrix(MatRepStd< T, idim, n > &rhs, unsigned int *work)
LU inversion of general square matrices.
static bool Dinv(MatrixRep &rhs)
static bool Dinv(MatRepSym< T, idim > &rhs)
static bool Dinv(MatRepSym< T, 2 > &rep)
Namespace for new ROOT classes and functions.
bool Invert(M &m) const
place the inverse into m
static bool Dinv(MatRepSym< T, idim > &rhs)
static bool Dinv(MatrixRep &)
MatRepSym Matrix storage representation for a symmetric matrix of dimension NxN This class is a templ...
static bool Dinv(MatrixRep &rhs)
static int DfactMatrix(MatRepStd< T, idim, n > &rhs, T &det, unsigned int *work)
LU Factorization method for inversion of general square matrices (see implementation in Math/MatrixIn...
Fast Matrix Inverter class Class to specialize calls to Dinv.
#define STATIC_CHECK(expr, msg)
header file containing the templated implementation of matrix inversion routines for use with ROOT's ...
class to compute the Cholesky decomposition of a matrix
static void InvertBunchKaufman(MatRepSym< T, idim > &rhs, int &ifail)
Bunch-Kaufman method for inversion of symmetric matrices.
Expression wrapper class for Matrix objects.
Matrix Inverter class Class to specialize calls to Dinv.
static bool Dinv(MatRepSym< T, idim > &rhs)
symmetric matrix inversion using Bunch-kaufman pivoting method implementation in Math/MatrixInversion...
static bool Dinv(MatrixRep &rhs)
matrix inversion for a generic square matrix using LU factorization (code originally from CERNLIB and...
Namespace for new Math classes and functions.
static bool Dinv(MatrixRep &)
static bool Dinv(MatrixRep &rhs)
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.