Modifications

This commit is contained in:
Geoffrey Frogeye 2016-03-09 08:28:07 +01:00
parent 659896de63
commit 5023793832
2 changed files with 5 additions and 3 deletions

View file

@ -6,13 +6,13 @@
// 1)
float D3diag(int n, double* a, double* b, double* c) {
float D[n];
double D3diag(int n, double* a, double* b, double* c) {
double D[n];
int i;
D[0] = b[0];
D[1] = b[0] * b[1] - a[1] * c[0];
for (i = 2; i < n; i++) {
D[i] = b[i] * D[i-1] - a[i] * c[i-2] * D[i-2];
D[i] = b[i] * D[i-1] - a[i] * c[i-1] * D[i-2];
}
return D[i];
}