mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-12-23 04:44:03 +01:00
Passing argument context instead of creating and passing a locally created context. #25
This commit is contained in:
parent
afc6e115d3
commit
a5e58c80d7
@ -5,7 +5,7 @@
|
|||||||
Low- and high-level functions that use the Sherman-Morrison and
|
Low- and high-level functions that use the Sherman-Morrison and
|
||||||
Woodbury matrix inversion formulas to update the inverse of a
|
Woodbury matrix inversion formulas to update the inverse of a
|
||||||
non-singualr matrix
|
non-singualr matrix
|
||||||
|
|
||||||
* Headers
|
* Headers
|
||||||
#+begin_src elisp :noexport :results none :exports none
|
#+begin_src elisp :noexport :results none :exports none
|
||||||
(org-babel-lob-ingest "../tools/lib.org")
|
(org-babel-lob-ingest "../tools/lib.org")
|
||||||
@ -255,6 +255,7 @@ end function qmckl_sherman_morrison_f
|
|||||||
#+begin_src c :tangle (eval c) :comments org
|
#+begin_src c :tangle (eval c) :comments org
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
qmckl_exit_code qmckl_sherman_morrison_c(const qmckl_context context,
|
qmckl_exit_code qmckl_sherman_morrison_c(const qmckl_context context,
|
||||||
const uint64_t Dim,
|
const uint64_t Dim,
|
||||||
@ -303,6 +304,7 @@ qmckl_exit_code qmckl_sherman_morrison_c(const qmckl_context context,
|
|||||||
|
|
||||||
l += 1;
|
l += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return QMCKL_SUCCESS;
|
return QMCKL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -911,8 +913,6 @@ qmckl_exit_code qmckl_sherman_morrison_splitting_c(const qmckl_context context,
|
|||||||
// std::cerr << "Called qmckl_sherman_morrison_splitting with " << N_updates << " updates" << std::endl;
|
// std::cerr << "Called qmckl_sherman_morrison_splitting with " << N_updates << " updates" << std::endl;
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
qmckl_context local_context;
|
|
||||||
local_context = qmckl_context_create();
|
|
||||||
qmckl_exit_code rc;
|
qmckl_exit_code rc;
|
||||||
|
|
||||||
double later_updates[Dim * N_updates];
|
double later_updates[Dim * N_updates];
|
||||||
@ -923,7 +923,7 @@ qmckl_exit_code qmckl_sherman_morrison_splitting_c(const qmckl_context context,
|
|||||||
breakdown, Slater_inv, later_updates, later_index, &later);
|
breakdown, Slater_inv, later_updates, later_index, &later);
|
||||||
|
|
||||||
if (later > 0) {
|
if (later > 0) {
|
||||||
rc = qmckl_sherman_morrison_splitting_c(local_context, Dim, later,
|
rc = qmckl_sherman_morrison_splitting_c(context, Dim, later,
|
||||||
later_updates, later_index, breakdown, Slater_inv);
|
later_updates, later_index, breakdown, Slater_inv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user