File tree Expand file tree Collapse file tree 3 files changed +5
-20
lines changed
Expand file tree Collapse file tree 3 files changed +5
-20
lines changed Original file line number Diff line number Diff line change 11#include < iostream>
22#include < fstream>
3- #include < sys/stat.h>
43
54#include " colvargrid.h"
65#include " colvargrid_integrate.h"
Original file line number Diff line number Diff line change 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-
206colvargrid_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 }
Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments