2021-06-04 16:50:49 +02:00
|
|
|
#include "SMWB.hpp"
|
|
|
|
#include "SM_Standard.hpp"
|
|
|
|
#include "Woodbury.hpp"
|
|
|
|
#include "Helpers.hpp"
|
|
|
|
|
|
|
|
// Sherman-Morrison-Woodbury kernel 1
|
|
|
|
// WB2, WB3, SM2 mixing scheme 1
|
2021-06-10 08:46:40 +02:00
|
|
|
void SMWB1(double *Slater_inv, unsigned int Dim, unsigned int N_updates, double *Updates, unsigned int *Updates_index) {
|
2021-06-04 16:50:49 +02:00
|
|
|
std::cerr << "Called Sherman-Morrison-Woodbury kernel 1 with " << N_updates << " updates" << std::endl;
|
2021-06-10 08:46:40 +02:00
|
|
|
|
|
|
|
bool ok;
|
|
|
|
ok = WB2(Slater_inv, Dim, Updates, Updates_index);
|
|
|
|
if (!ok) {
|
|
|
|
std::cerr << "Woodbury kernel failed!" << std::endl;
|
|
|
|
SM2(Slater_inv, Dim, N_updates, Updates, Updates_index);
|
|
|
|
}
|
2021-06-04 16:50:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
void SMWB1_f(double **linSlater_inv, unsigned int *Dim, unsigned int *N_updates,
|
|
|
|
double **linUpdates, unsigned int **Updates_index) {
|
|
|
|
SMWB1(*linSlater_inv, *Dim, *N_updates, *linUpdates, *Updates_index);
|
|
|
|
}
|
|
|
|
}
|