4 #ifndef ROOT_Math_Dsfact
5 #define ROOT_Math_Dsfact
32 #ifndef ROOT_Math_MatrixRepresentationsStatic
50 template <
unsigned int n,
unsigned int idim =n>
59 if (idim <
n ||
n <= 0) {
65 typename MatrixRep::value_type*
a = rhs.
Array();
69 const typename MatrixRep::value_type*
A = rhs.
Array();
71 typename MatrixRep::value_type* a = array;
84 const int arrayOffset = -(idim+1);
87 for (j = 1; j <=
n; ++j) {
88 const unsigned int ji = j * idim;
89 const unsigned int jj = j + ji;
91 if (rhs[jj + arrayOffset] <= 0.) {
96 const unsigned int jp1 = j + 1;
97 const unsigned int jpi = jp1 * idim;
99 det *= rhs[jj + arrayOffset];
100 rhs[jj + arrayOffset] = 1. / rhs[jj + arrayOffset];
102 for (l = jp1; l <=
n; ++
l) {
103 rhs[j + l * idim + arrayOffset] = rhs[jj + arrayOffset] * rhs[l + ji + arrayOffset];
105 const unsigned int lj = l + jpi;
107 for (i = 1; i <= j; ++i) {
108 rhs[lj + arrayOffset] -= rhs[l + i * idim + arrayOffset] * rhs[i + jpi + arrayOffset];
124 for (
unsigned int i = 0; i<
n*
n; ++i)
Namespace for new ROOT classes and functions.
MatRepSym Matrix storage representation for a symmetric matrix of dimension NxN This class is a templ...
Expression wrapper class for Matrix objects.
static bool Dsfact(MatRepStd< T, n, idim > &rhs, T &det)
Namespace for new Math classes and functions.
static bool Dsfact(MatRepSym< T, n > &rhs, T &det)