1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-22 20:36:01 +01:00

Resolved compiler warnings about initialising 'objects' with 'const objects'. #25

This commit is contained in:
Francois Coppens 2021-07-27 08:48:28 +02:00
parent 0e4ea1f81b
commit afc6e115d3

View File

@ -1113,8 +1113,8 @@ qmckl_exit_code qmckl_sherman_morrison_smw2s_c(const qmckl_context context,
uint64_t later = 0;
if (n_of_2blocks > 0) {
for (uint64_t i = 0; i < n_of_2blocks; i++) {
double *Updates_2block = &Updates[i * length_2block];
uint64_t *Updates_index_2block = &Updates_index[i * 2];
const double *Updates_2block = &Updates[i * length_2block];
const uint64_t *Updates_index_2block = &Updates_index[i * 2];
rc = qmckl_woodbury_2_c(local_context, Dim, Updates_2block, Updates_index_2block, breakdown, Slater_inv);
if (rc != 0) { // Send the entire block to slagel_splitting
uint64_t l = 0;
@ -1126,8 +1126,8 @@ qmckl_exit_code qmckl_sherman_morrison_smw2s_c(const qmckl_context context,
}
if (remainder == 1) { // Apply last remaining update with slagel_splitting
double *Updates_1block = &Updates[n_of_2blocks * length_2block];
uint64_t *Updates_index_1block = &Updates_index[2 * n_of_2blocks];
const double *Updates_1block = &Updates[n_of_2blocks * length_2block];
const uint64_t *Updates_index_1block = &Updates_index[2 * n_of_2blocks];
uint64_t l = 0;
rc = qmckl_slagel_splitting_c(Dim, 1, Updates_1block, Updates_index_1block,
breakdown, Slater_inv, later_updates + (Dim * later), later_index + later, &l);
@ -1322,8 +1322,8 @@ qmckl_exit_code qmckl_sherman_morrison_smw3s_c(const qmckl_context context,
uint64_t later = 0;
if (n_of_3blocks > 0) {
for (uint64_t i = 0; i < n_of_3blocks; i++) {
double *Updates_3block = &Updates[i * length_3block];
uint64_t *Updates_index_3block = &Updates_index[i * 3];
const double *Updates_3block = &Updates[i * length_3block];
const uint64_t *Updates_index_3block = &Updates_index[i * 3];
rc = qmckl_woodbury_3_c(local_context, Dim, Updates_3block, Updates_index_3block, breakdown, Slater_inv);
if (rc != 0) { // Send the entire block to slagel_splitting
uint64_t l = 0;
@ -1335,8 +1335,8 @@ qmckl_exit_code qmckl_sherman_morrison_smw3s_c(const qmckl_context context,
}
if (remainder != 0) { // Apply last remaining block of 2 updates with Woodbury 2x2 kernel
double *Updates_remainder_block = &Updates[n_of_3blocks * length_3block];
uint64_t *Updates_index_remainder_block = &Updates_index[3 * n_of_3blocks];
const double *Updates_remainder_block = &Updates[n_of_3blocks * length_3block];
const uint64_t *Updates_index_remainder_block = &Updates_index[3 * n_of_3blocks];
uint64_t l = 0;
rc = qmckl_slagel_splitting_c(Dim, remainder, Updates_remainder_block, Updates_index_remainder_block,
breakdown, Slater_inv, later_updates + (Dim * later), later_index + later, &l);
@ -1531,8 +1531,8 @@ qmckl_exit_code qmckl_sherman_morrison_smw32s_c(const qmckl_context context,
uint64_t later = 0;
if (n_of_3blocks > 0) {
for (uint64_t i = 0; i < n_of_3blocks; i++) {
double *Updates_3block = &Updates[i * length_3block];
uint64_t *Updates_index_3block = &Updates_index[i * 3];
const double *Updates_3block = &Updates[i * length_3block];
const uint64_t *Updates_index_3block = &Updates_index[i * 3];
rc = qmckl_woodbury_3_c(local_context, Dim, Updates_3block, Updates_index_3block, breakdown, Slater_inv);
if (rc != 0) { // Send the entire block to slagel_splitting
uint64_t l = 0;
@ -1544,8 +1544,8 @@ qmckl_exit_code qmckl_sherman_morrison_smw32s_c(const qmckl_context context,
}
if (remainder == 2) { // Apply last remaining block of 2 updates with Woodbury 2x2 kernel
double *Updates_2block = &Updates[n_of_3blocks * length_3block];
uint64_t *Updates_index_2block = &Updates_index[3 * n_of_3blocks];
const double *Updates_2block = &Updates[n_of_3blocks * length_3block];
const uint64_t *Updates_index_2block = &Updates_index[3 * n_of_3blocks];
rc = qmckl_woodbury_2_c(local_context, Dim, Updates_2block, Updates_index_2block, breakdown, Slater_inv);
if (rc != 0) { // Send the entire block to slagel_splitting
uint64_t l = 0;
@ -1555,8 +1555,8 @@ qmckl_exit_code qmckl_sherman_morrison_smw32s_c(const qmckl_context context,
}
}
else if (remainder == 1) { // Apply last remaining update with slagel_splitting
double *Updates_1block = &Updates[n_of_3blocks * length_3block];
uint64_t *Updates_index_1block = &Updates_index[3 * n_of_3blocks];
const double *Updates_1block = &Updates[n_of_3blocks * length_3block];
const uint64_t *Updates_index_1block = &Updates_index[3 * n_of_3blocks];
uint64_t l = 0;
rc = qmckl_slagel_splitting_c(Dim, 1, Updates_1block, Updates_index_1block,
breakdown, Slater_inv, later_updates + (Dim * later), later_index + later, &l);