38 #ifndef ROOT_Math_CholeskyDecomp 42 #ifndef ROOT_Math_MatrixRepresentationsStatic 72 template <
unsigned int idim,
unsigned int n =
idim>
78 template <
class MatrixRep>
79 static bool Dinv(MatrixRep& rhs) {
83 unsigned int work[
n+1] = {0};
85 typename MatrixRep::value_type det(0.0);
88 Error(
"Inverter::Dinv",
"Dfact_matrix failed!!");
93 if (ifail == 0)
return true;
105 if (ifail == 0)
return true;
147 template <
unsigned int idim,
unsigned int n =
idim>
151 template <
class MatrixRep>
152 static bool Dinv(MatrixRep& rhs) {
174 template <
class MatrixRep>
175 inline static bool Dinv(MatrixRep&) {
return true; }
191 template <
class MatrixRep>
192 static bool Dinv(MatrixRep& rhs) {
197 rhs[0] = 1. / rhs[0];
216 template <
class MatrixRep>
217 static bool Dinv(MatrixRep& rhs) {
219 typedef typename MatrixRep::value_type
T;
220 T det = rhs[0] * rhs[3] - rhs[2] * rhs[1];
222 if (det ==
T(0.) ) {
return false; }
229 rhs[2] = -s * rhs[2];
230 rhs[1] = -s * rhs[1];
244 T det = rhs[0] * rhs[2] - rhs[1] * rhs[1];
247 if (det ==
T(0.)) {
return false; }
252 rhs[1] = -s * rhs[1];
274 template <
class MatrixRep>
275 static bool Dinv(MatrixRep& rhs);
289 template <
class MatrixRep>
290 static bool Dinv(MatrixRep& rhs);
304 template <
class MatrixRep>
305 static bool Dinv(MatrixRep& rhs);
316 template <
unsigned int idim>
320 template <
class MatrixRep>
322 STATIC_CHECK(
false, Error_cholesky_SMatrix_type_is_not_symmetric );
328 return decomp.
Invert(rhs);
337 #ifndef ROOT_Math_CramerInversion_icc 340 #ifndef ROOT_Math_CramerInversionSym_icc 343 #ifndef ROOT_Math_MatrixInversion_icc 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)
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
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.