File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -573,12 +573,12 @@ namespace {
573573 else return funcs_[select<flags>()][n-1 ][m-1 ];
574574 }
575575
576+ void init_funcs_to_nullptr () {
577+ std::memset (funcs_, 0 , sizeof (compute_pair_coordnum_type)*16 *12 *12 );
578+ }
579+
576580 template <int n, int m>
577581 void set_func () {
578- for (int i = 0 ; i < 16 ; ++i) {
579- funcs_[i][n-1 ][m-1 ] = nullptr ;
580- }
581-
582582 funcs_[select<colvar::coordnum::ef_gradients>()][n-1 ][m-1 ] =
583583 &colvar::selfcoordnum::selfcoordnum_sequential_loop<colvar::coordnum::ef_gradients, n, m>;
584584 funcs_[select<colvar::coordnum::ef_use_internal_pbc>()][n-1 ][m-1 ] =
@@ -659,6 +659,7 @@ colvar::selfcoordnum::selfcoordnum()
659659{
660660 set_function_type (" selfCoordNum" );
661661 // NOTE: I only enable the most commonly used template since enabling too many of them would slow down the compilation...
662+ init_funcs_to_nullptr ();
662663 // set_func<1, 1>();
663664 // set_func<1, 2>();
664665 // set_func<1, 3>();
You can’t perform that action at this time.
0 commit comments