Dsfact. Compute determinant of a symmetric, positive definite matrix of dimension $idim$ and order $n$.
36 {
37
38#ifdef XXX
39
40 if (idim < n || n <= 0) {
41 return false;
42 }
43#endif
44
45 typename Matrix::value_type*
a = rhs.Array();
46
47#ifdef XXX
48 const typename Matrix::value_type* A = rhs.Array();
49 typename Matrix::value_type array[Matrix::size];
50 typename Matrix::value_type*
a = array;
51
52
53 for(unsigned int i=0; i<Matrix::size; ++i) {
54 array[i] = A[i];
55 }
56#endif
57
58
59 static unsigned int i, j, l;
60
61
63
64
65 det = 1.;
66 for (j = 1; j <= n; ++j) {
67 const unsigned int ji = j * idim;
68 const unsigned int jj = j + ji;
69
71 det = 0.;
72 return false;
73 }
74
75 const unsigned int jp1 = j + 1;
76 const unsigned int jpi = jp1 * idim;
77
80
81 for (l = jp1; l <= n; ++l) {
82 a[j + l * idim] =
a[jj] *
a[l + ji];
83
84 const unsigned int lj = l + jpi;
85
86 for (i = 1; i <= j; ++i) {
87 a[lj] -=
a[l + i * idim] *
a[i + jpi];
88 }
89 }
90 }
91
92 return true;
93}
void a()
Definition: check_aligned.C:59