#include <iostream>
#include <iomanip>
#include <assert.h>
#include <string.h>
#include "vt++/VtSymMatrix.hh"
#include "vt++/VtVector.hh"
|
| void | Dsfact1 (int *idim, double *a, int *n, int *ifail, double *det, int *jfail) |
| |
| void | Dsinv1 (int *idim, double *a, int *n, int *ifail) |
| |
◆ Dsfact1()
| void Dsfact1 |
( |
int * |
idim, |
|
|
double * |
a, |
|
|
int * |
n, |
|
|
int * |
ifail, |
|
|
double * |
det, |
|
|
int * |
jfail |
|
) |
| |
46 static unsigned int i, j, l;
51 if (*idim < *n || *n <= 0) {
62 for (j = 1; j <= (
unsigned int)(*n); ++j) {
63 const unsigned int ji = j * (*idim);
64 const unsigned int jj = j + ji;
72 const unsigned int jp1 = j + 1;
73 const unsigned int jpi = jp1 * (*idim);
78 for (l = jp1; l <= (
unsigned int)(*n); ++l) {
79 a[j + l * (*idim)] =
a[jj] *
a[l + ji];
81 const unsigned int lj = l + jpi;
83 for (i = 1; i <= j; ++i) {
84 a[lj] -=
a[l + i * (*idim)] *
a[i + jpi];
void a()
Definition: check_aligned.C:59
◆ Dsinv1()
| void Dsinv1 |
( |
int * |
idim, |
|
|
double * |
a, |
|
|
int * |
n, |
|
|
int * |
ifail |
|
) |
| |
95 static int i, j, k, l;
96 static double s31, s32;
104 if (*idim < *n || *n <= 1) {
110 for (j = 1; j <= *n; ++j) {
111 const int ja = j * (*idim);
112 const int jj = j + ja;
113 const int ja1 = ja + (*idim);
115 if (
a[jj] <= 0.) { *ifail = -1;
return; }
117 if (j == *n) {
break; }
119 for (l = j + 1; l <= *n; ++l) {
120 a[j + l * (*idim)] =
a[jj] *
a[l + ja];
121 const int lj = l + ja1;
122 for (i = 1; i <= j; ++i) {
123 a[lj] -=
a[l + i * (*idim)] *
a[i + ja1];
131 a[(*idim << 1) + 1] = -
a[(*idim << 1) + 1];
132 a[*idim + 2] =
a[(*idim << 1) + 1] *
a[(*idim << 1) + 2];
136 for (j = 3; j <= *n; ++j) {
137 const int jm2 = j - 2;
138 const int ja = j * (*idim);
139 const int jj = j + ja;
140 const int j1 = j - 1 + ja;
142 for (k = 1; k <= jm2; ++k) {
145 for (i = k; i <= jm2; ++i) {
146 s31 +=
a[k + (i + 1) * (*idim)] *
a[i + 1 + ja];
149 a[j + k * (*idim)] = -s31 *
a[jj];
153 a[jj - (*idim)] =
a[j1] *
a[jj];
159 const int jad = j * (*idim);
160 const int jj = j + jad;
163 for (i = jp1; i <= *n; ++i) {
164 a[jj] +=
a[j + i * (*idim)] *
a[i + jad];
169 const int ja = j * (*idim);
171 for (k = 1; k <= jm1; ++k) {
173 for (i = j; i <= *n; ++i) {
174 s32 +=
a[k + i * (*idim)] *
a[i + ja];
176 a[k + ja] =
a[j + k * (*idim)] = s32;