Apply clang-format

This commit is contained in:
Pablo Oliveira 2021-02-09 14:46:28 +01:00
parent b575cda8d6
commit aa78f94177
2 changed files with 103 additions and 97 deletions

View File

@ -4,7 +4,9 @@
#include "SM_MaponiA3.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 *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
for (k = 1; k < M + 1; k++) {
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'
// gets reassigned by 'matMul(...)' in the next line, by creating a new
// pointer 'copy' that points to whereever 'Slater_inv' points to now.
// Keep the memory location of the passed array 'Slater_inv' before
// 'Slater_inv' gets reassigned by 'matMul(...)' in the next line, by creating
// a new pointer 'copy' that points to whereever 'Slater_inv' points to now.
double *copy = Slater_inv;
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]];
for (i = 0; i < M; i++) {
for (j = 0; j < M; j++) {
@ -109,8 +111,10 @@ void MaponiA3(double *Slater0, double *Slater_inv, unsigned int M, unsigned int
}
extern "C" {
void MaponiA3_f(double **linSlater0, double **linSlater_inv, unsigned int *Dim, unsigned int *N_updates, double **linUpdates, unsigned int **Updates_index)
{
MaponiA3(*linSlater0, *linSlater_inv, *Dim, *N_updates, *linUpdates, *Updates_index);
void MaponiA3_f(double **linSlater0, double **linSlater_inv, unsigned int *Dim,
unsigned int *N_updates, double **linUpdates,
unsigned int **Updates_index) {
MaponiA3(*linSlater0, *linSlater_inv, *Dim, *N_updates, *linUpdates,
*Updates_index);
}
}

View File

@ -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);