mirror of
https://github.com/TREX-CoE/Sherman-Morrison.git
synced 2025-04-28 11:24:45 +02:00
Apply clang-format
This commit is contained in:
parent
b575cda8d6
commit
aa78f94177
@ -4,7 +4,9 @@
|
|||||||
#include "SM_MaponiA3.hpp"
|
#include "SM_MaponiA3.hpp"
|
||||||
#include "Helpers.hpp"
|
#include "Helpers.hpp"
|
||||||
|
|
||||||
void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M, unsigned int N_updates, double *Updates, unsigned int *Updates_index) {
|
void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M,
|
||||||
|
unsigned int N_updates, double *Updates,
|
||||||
|
unsigned int *Updates_index) {
|
||||||
|
|
||||||
unsigned int k, l, lbar, i, j, tmp = M;
|
unsigned int k, l, lbar, i, j, tmp = M;
|
||||||
unsigned int *p = new unsigned int[M + 1];
|
unsigned int *p = new unsigned int[M + 1];
|
||||||
@ -37,7 +39,8 @@ void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M, unsigned int
|
|||||||
// Calculate all the y0k in M^2 multiplications instead of M^3
|
// Calculate all the y0k in M^2 multiplications instead of M^3
|
||||||
for (k = 1; k < M + 1; k++) {
|
for (k = 1; k < M + 1; k++) {
|
||||||
for (i = 1; i < M + 1; i++) {
|
for (i = 1; i < M + 1; i++) {
|
||||||
ylk[0][k][i] = Slater_inv[(i-1)*M+(i-1)] * Updates[(i-1)*M+(k-1)];
|
ylk[0][k][i] =
|
||||||
|
Slater_inv[(i - 1) * M + (i - 1)] * Updates[(i - 1) * M + (k - 1)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,9 +69,9 @@ void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M, unsigned int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep the memory location of the passed array 'Slater_inv' before 'Slater_inv'
|
// Keep the memory location of the passed array 'Slater_inv' before
|
||||||
// gets reassigned by 'matMul(...)' in the next line, by creating a new
|
// 'Slater_inv' gets reassigned by 'matMul(...)' in the next line, by creating
|
||||||
// pointer 'copy' that points to whereever 'Slater_inv' points to now.
|
// a new pointer 'copy' that points to whereever 'Slater_inv' points to now.
|
||||||
double *copy = Slater_inv;
|
double *copy = Slater_inv;
|
||||||
|
|
||||||
double *U = new double[M * M];
|
double *U = new double[M * M];
|
||||||
@ -81,7 +84,6 @@ void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M, unsigned int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
beta = 1 + ylk[l][p[k]][p[k]];
|
beta = 1 + ylk[l][p[k]][p[k]];
|
||||||
for (i = 0; i < M; i++) {
|
for (i = 0; i < M; i++) {
|
||||||
for (j = 0; j < M; j++) {
|
for (j = 0; j < M; j++) {
|
||||||
@ -109,8 +111,10 @@ void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M, unsigned int
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void MaponiA3_f(double **linSlater0, double **linSlater_inv, unsigned int *Dim, unsigned int *N_updates, double **linUpdates, unsigned int **Updates_index)
|
void MaponiA3_f(double **linSlater0, double **linSlater_inv, unsigned int *Dim,
|
||||||
{
|
unsigned int *N_updates, double **linUpdates,
|
||||||
MaponiA3(*linSlater0, *linSlater_inv, *Dim, *N_updates, *linUpdates, *Updates_index);
|
unsigned int **Updates_index) {
|
||||||
|
MaponiA3(*linSlater0, *linSlater_inv, *Dim, *N_updates, *linUpdates,
|
||||||
|
*Updates_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1,3 @@
|
|||||||
void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M, unsigned int N_updates, double *Updates, unsigned int *Updates_index);
|
void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M,
|
||||||
|
unsigned int N_updates, double *Updates,
|
||||||
|
unsigned int *Updates_index);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user