mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-12-23 04:44:03 +01:00
Bug fix in tests. #25
This commit is contained in:
parent
11eee81f84
commit
081e27dd92
@ -326,12 +326,16 @@ const uint64_t Updates_index[2] = {0, 0};
|
||||
const double Updates[4] = {0.0, 0.0, 0.0, 0.0};
|
||||
double Slater_inv[4] = {0.0, 0.0, 0.0, 0.0};
|
||||
|
||||
// [TODO : FMJC ] add realistic tests
|
||||
|
||||
rc = qmckl_sherman_morrison_c(context, Dim, N_updates, Updates, Updates_index, Slater_inv);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
#+end_src
|
||||
|
||||
|
||||
* Woodbury 2x2
|
||||
|
||||
[TODO: FMJC] Add main body intro.
|
||||
|
||||
** ~qmckl_woodbury_2~
|
||||
:PROPERTIES:
|
||||
@ -340,14 +344,18 @@ assert(rc == QMCKL_SUCCESS);
|
||||
:FRetType: qmckl_exit_code
|
||||
:END:
|
||||
|
||||
This is the simplest of the available Sherman-Morrison-Woodbury kernels in QMCkl. It applies rank-1 updates one by one in the order that is given. It only checks if the denominator in the Sherman-Morrison formula is not too close to zero (and exit with an error if it does) during the application of an update.
|
||||
This is the simplest of the available Sherman-Morrison-Woodbury
|
||||
kernels in QMCkl. It applies rank-1 updates one by one in the order
|
||||
that is given. It only checks if the denominator in the
|
||||
Sherman-Morrison formula is not too close to zero (and exit with an
|
||||
error if it does) during the application of an update.
|
||||
|
||||
#+NAME: qmckl_woodbury_2_args
|
||||
| qmckl_context | context | in | Global state |
|
||||
| uint64_t | Dim | in | Leading dimension of Slater_inv |
|
||||
| double | Updates[2*Dim] | in | Array containing the updates |
|
||||
| uint64_t | Updates_index[2] | in | Array containing the rank-1 updates |
|
||||
| double | Slater_inv[Dim*Dim] | inout | Array containing the inverse of a Slater-matrix |
|
||||
| qmckl_context | context | in | Global state |
|
||||
| uint64_t | Dim | in | Leading dimension of Slater_inv |
|
||||
| double | Updates[2*Dim] | in | Array containing the updates |
|
||||
| uint64_t | Updates_index[2] | in | Array containing the rank-1 updates |
|
||||
| double | Slater_inv[Dim*Dim] | inout | Array containing the inverse of a Slater-matrix |
|
||||
|
||||
*** Requirements
|
||||
|
||||
@ -463,7 +471,7 @@ qmckl_exit_code qmckl_woodbury_2_c(const qmckl_context context,
|
||||
#+end_src
|
||||
|
||||
|
||||
|
||||
|
||||
*** Performance
|
||||
|
||||
** C interface :noexport:
|
||||
@ -520,12 +528,14 @@ qmckl_exit_code qmckl_woodbury_2_c(const qmckl_context context,
|
||||
|
||||
|
||||
#+begin_src c :tangle (eval c_test)
|
||||
const uint64_t Dim2 = 2;
|
||||
const uint64_t Updates_index2[2] = {0, 0};
|
||||
const double Updates2[4] = {0.0, 0.0, 0.0, 0.0};
|
||||
double Slater_inv2[4] = {0.0, 0.0, 0.0, 0.0};
|
||||
const uint64_t woodbury_Dim = 2;
|
||||
const uint64_t woodbury_Updates_index[2] = {1, 1};
|
||||
const double woodbury_Updates[4] = {1.0, 1.0, 1.0, 1.0};
|
||||
double woodbury_Slater_inv[4] = {1.0, 1.0, 1.0, 1.0};
|
||||
|
||||
rc = qmckl_woodbury_2_c(context, Dim, Updates, Updates_index, Slater_inv);
|
||||
// [TODO : FMJC ] add realistic tests
|
||||
|
||||
rc = qmckl_woodbury_2_c(context, woodbury_Dim, woodbury_Updates, woodbury_Updates_index, woodbury_Slater_inv);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
#+end_src
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user