4#ifndef ROOT_Math_Dsfact
5#define ROOT_Math_Dsfact
48template <
unsigned int n,
unsigned int idim =n>
57 if (idim <
n ||
n <= 0) {
63 typename MatrixRep::value_type*
a = rhs.
Array();
67 const typename MatrixRep::value_type* A = rhs.
Array();
68 typename MatrixRep::value_type array[MatrixRep::kSize];
69 typename MatrixRep::value_type*
a = array;
72 for(
unsigned int i=0; i<MatrixRep::kSize; ++i) {
82 const int arrayOffset = -(idim+1);
85 for (j = 1; j <=
n; ++j) {
86 const unsigned int ji = j * idim;
87 const unsigned int jj = j + ji;
89 if (rhs[jj + arrayOffset] <= 0.) {
94 const unsigned int jp1 = j + 1;
95 const unsigned int jpi = jp1 * idim;
97 det *= rhs[jj + arrayOffset];
98 rhs[jj + arrayOffset] = 1. / rhs[jj + arrayOffset];
100 for (
l = jp1;
l <=
n; ++
l) {
101 rhs[j +
l * idim + arrayOffset] = rhs[jj + arrayOffset] * rhs[
l + ji + arrayOffset];
103 const unsigned int lj =
l + jpi;
105 for (i = 1; i <= j; ++i) {
106 rhs[lj + arrayOffset] -= rhs[
l + i * idim + arrayOffset] * rhs[i + jpi + arrayOffset];
122 for (
unsigned int i = 0; i<
n*
n; ++i)
Expression wrapper class for Matrix objects.
MatRepSym Matrix storage representation for a symmetric matrix of dimension NxN This class is a templ...
static bool Dsfact(MatRepStd< T, n, idim > &rhs, T &det)
static bool Dsfact(MatRepSym< T, n > &rhs, T &det)
Namespace for new Math classes and functions.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.