mirror of
https://github.com/TREX-CoE/Sherman-Morrison.git
synced 2024-12-25 13:53:56 +01:00
Fixed minor bug
This commit is contained in:
parent
177411f472
commit
c9d1abd29d
@ -11,9 +11,10 @@ int main() {
|
|||||||
unsigned int *Ar_index = new unsigned int[M];
|
unsigned int *Ar_index = new unsigned int[M];
|
||||||
double *A = new double[M * M]; // The matrix to be inverted
|
double *A = new double[M * M]; // The matrix to be inverted
|
||||||
double *A0 =
|
double *A0 =
|
||||||
new double[M * M]; // A diagonal matrix with the digonal elements of A
|
new double[M * M]; // A diagonal matrix with the digonal elements of A
|
||||||
double *Ar = new double[M * M]; // The update matrix
|
double *Ar = new double[M * M]; // The update matrix
|
||||||
double *A0_inv = new double[M * M]; // The inverse
|
double *A0_inv = new double[M * M]; // The inverse
|
||||||
|
double breakdown = 1e-3;
|
||||||
|
|
||||||
// Fill with zeros
|
// Fill with zeros
|
||||||
for (i = 0; i < M; i++) {
|
for (i = 0; i < M; i++) {
|
||||||
@ -51,7 +52,7 @@ int main() {
|
|||||||
|
|
||||||
// Define pointers dim and n_updates to use in Sherman-Morrison(...) function
|
// Define pointers dim and n_updates to use in Sherman-Morrison(...) function
|
||||||
// call
|
// call
|
||||||
MaponiA3(A0_inv, M, M, Ar, Ar_index);
|
MaponiA3(A0_inv, M, M, Ar, Ar_index, breakdown);
|
||||||
showMatrix(A0_inv, M, "A0_inv");
|
showMatrix(A0_inv, M, "A0_inv");
|
||||||
|
|
||||||
// Deallocate all vectors and matrices
|
// Deallocate all vectors and matrices
|
||||||
|
Loading…
Reference in New Issue
Block a user