mirror of
https://github.com/TREX-CoE/Sherman-Morrison.git
synced 2025-01-12 22:18:36 +01:00
tests/test_internal_h5 and test_external_h5 updated to use replacement updates instead of additive updates.
This commit is contained in:
parent
6012b9decf
commit
4e7c4de0e8
@ -77,5 +77,5 @@ program QMCChem_dataset_test
|
|||||||
close(4000)
|
close(4000)
|
||||||
close(5000)
|
close(5000)
|
||||||
|
|
||||||
deallocate(S, S_inv, S_inv_t, Updates, Updates_index)
|
deallocate(S, S_inv, S_inv_t, Updates, U, Updates_index)
|
||||||
end program
|
end program
|
||||||
|
@ -47,6 +47,9 @@ int test_cycle(H5File file, int cycle) {
|
|||||||
double * updates = new double[nupdates*dim];
|
double * updates = new double[nupdates*dim];
|
||||||
read_double(file, group + "/updates", updates);
|
read_double(file, group + "/updates", updates);
|
||||||
|
|
||||||
|
double * u = new double[nupdates*dim];
|
||||||
|
|
||||||
|
|
||||||
/* Test */
|
/* Test */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
showMatrix(slater_matrix, dim, "OLD Slater");
|
showMatrix(slater_matrix, dim, "OLD Slater");
|
||||||
@ -59,12 +62,13 @@ int test_cycle(H5File file, int cycle) {
|
|||||||
for (j = 0; j < nupdates; j++) {
|
for (j = 0; j < nupdates; j++) {
|
||||||
for (i = 0; i < dim; i++) {
|
for (i = 0; i < dim; i++) {
|
||||||
col = col_update_index[j];
|
col = col_update_index[j];
|
||||||
slater_matrix[i*dim + (col - 1)] += updates[i + j*dim];
|
u[i + j*dim] = updates[i + j*dim] - slater_matrix[i*dim + (col - 1)];
|
||||||
|
slater_matrix[i*dim + (col - 1)] = updates[i + j*dim];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//MaponiA3(slater_inverse, dim, nupdates, updates, col_update_index);
|
//MaponiA3(slater_inverse, dim, nupdates, updates, col_update_index);
|
||||||
SM(slater_inverse, dim, nupdates, updates, col_update_index);
|
SM(slater_inverse, dim, nupdates, u, col_update_index);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
showMatrix(slater_matrix, dim, "NEW Slater");
|
showMatrix(slater_matrix, dim, "NEW Slater");
|
||||||
@ -82,7 +86,7 @@ int test_cycle(H5File file, int cycle) {
|
|||||||
showMatrix(res, dim, "Result");
|
showMatrix(res, dim, "Result");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
delete [] res, updates, col_update_index,
|
delete [] res, updates, u, col_update_index,
|
||||||
slater_matrix, slater_inverse;
|
slater_matrix, slater_inverse;
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "Helpers.hpp"
|
#include "Helpers.hpp"
|
||||||
|
|
||||||
using namespace H5;
|
using namespace H5;
|
||||||
//#define DEBUG
|
// #define DEBUG
|
||||||
|
|
||||||
const H5std_string FILE_NAME( "datasets.hdf5" );
|
const H5std_string FILE_NAME( "datasets.hdf5" );
|
||||||
|
|
||||||
@ -47,6 +47,8 @@ int test_cycle(H5File file, int cycle) {
|
|||||||
double * updates = new double[nupdates*dim];
|
double * updates = new double[nupdates*dim];
|
||||||
read_double(file, group + "/updates", updates);
|
read_double(file, group + "/updates", updates);
|
||||||
|
|
||||||
|
double * u = new double[nupdates*dim];
|
||||||
|
|
||||||
/* Test */
|
/* Test */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
showMatrix(slater_matrix, dim, "OLD Slater");
|
showMatrix(slater_matrix, dim, "OLD Slater");
|
||||||
@ -59,11 +61,12 @@ int test_cycle(H5File file, int cycle) {
|
|||||||
for (j = 0; j < nupdates; j++) {
|
for (j = 0; j < nupdates; j++) {
|
||||||
for (i = 0; i < dim; i++) {
|
for (i = 0; i < dim; i++) {
|
||||||
col = col_update_index[j];
|
col = col_update_index[j];
|
||||||
slater_matrix[i*dim + (col - 1)] += updates[i + j*dim];
|
u[i + j*dim] = updates[i + j*dim] - slater_matrix[i*dim + (col - 1)];
|
||||||
|
slater_matrix[i*dim + (col - 1)] = updates[i + j*dim];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MaponiA3(slater_inverse, dim, nupdates, updates, col_update_index);
|
MaponiA3(slater_inverse, dim, nupdates, u, col_update_index);
|
||||||
//SM(slater_inverse, dim, nupdates, updates, col_update_index);
|
//SM(slater_inverse, dim, nupdates, updates, col_update_index);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -82,7 +85,7 @@ int test_cycle(H5File file, int cycle) {
|
|||||||
showMatrix(res, dim, "Result");
|
showMatrix(res, dim, "Result");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
delete [] res, updates, col_update_index,
|
delete [] res, updates, u, col_update_index,
|
||||||
slater_matrix, slater_inverse;
|
slater_matrix, slater_inverse;
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
|
Loading…
Reference in New Issue
Block a user