Skip to content

Commit df27d7e

Browse files
committed
Cleanup after PR review
Thanks Haochuan for the feedback.
1 parent 24f4098 commit df27d7e

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

colvartools/poisson_integrator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <iostream>
22
#include <fstream>
3-
#include <sys/stat.h>
43

54
#include "colvargrid.h"
65
#include "colvargrid_integrate.h"

src/colvargrid_integrate.cpp

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@
33
#include <iomanip>
44
#include <iostream>
55

6-
// Helper function to print vector<int>
7-
std::string vec_to_string(const std::vector<int> &vec)
8-
{
9-
std::ostringstream oss;
10-
oss << "[";
11-
for (size_t i = 0; i < vec.size(); ++i) {
12-
oss << vec[i];
13-
if (i < vec.size() - 1)
14-
oss << ", ";
15-
}
16-
oss << "]";
17-
return oss.str();
18-
};
19-
206
colvargrid_integrate::colvargrid_integrate(std::vector<colvar *> &colvars,
217
std::shared_ptr<colvar_grid_gradient> gradients_in,
228
bool weighted_in)
@@ -941,14 +927,14 @@ void colvargrid_integrate::prepare_laplacian_stencils()
941927
std::vector<int> binary = convert_base_two(weights_to_average_relative_pos, nd - 1);
942928
weight_stencil[2 * dim][weights_to_average_relative_pos].resize(nd);
943929
weight_stencil[2 * dim + 1][weights_to_average_relative_pos].resize(nd);
944-
int off_set = 0;
930+
int offset = 0;
945931
for (size_t k = 0; k < nd; k++) {
946932
if (k != dim) {
947-
weight_stencil[2 * dim][weights_to_average_relative_pos][k] = binary[k + off_set];
933+
weight_stencil[2 * dim][weights_to_average_relative_pos][k] = binary[k + offset];
948934
weight_stencil[2 * dim + 1][weights_to_average_relative_pos][k] =
949-
binary[k + off_set];
935+
binary[k + offset];
950936
} else {
951-
off_set = -1;
937+
offset = -1;
952938
weight_stencil[2 * dim][weights_to_average_relative_pos][dim] = 0;
953939
weight_stencil[2 * dim + 1][weights_to_average_relative_pos][dim] = 1;
954940
}

src/colvargrid_integrate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class colvargrid_integrate : public colvar_grid_scalar {
7272
bool weighted = false;
7373
bool precompute = true;
7474

75-
colvar_grid_scalar* computation_grid;
75+
colvar_grid_scalar* computation_grid = nullptr;
7676
std::vector<cvm::real> div_border_supplement;
7777

7878
std::vector<int> computation_nx;

0 commit comments

Comments
 (0)