Proper fix for gmx do_dssp
authorPaul Bauer <paul.bauer.q@gmail.com>
Wed, 10 Jun 2020 06:47:09 +0000 (08:47 +0200)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 10 Jun 2020 06:47:09 +0000 (08:47 +0200)
The tool was still broken after the previous fix, even though it didn't
crash any more.

Fixed now by providing the correct sizes for the matrix.

Fixes #3444

Change-Id: I6b59bbdd5e69ff2c311ff4c8457037c9310b081f

docs/release-notes/2020/2020.3.rst
src/gromacs/gmxana/gmx_do_dssp.cpp

index 23ba5276a92c283d748d1e4b2557b6c9c5e764f8..bc679e73fd56e56bf3f152859684de302fbc8898 100644 (file)
@@ -26,6 +26,13 @@ The tool would crash due to mismatching sizes of energy terms in the file and F_
 
 :issue:`3547`
 
+Actually fix gmx do_dssp
+""""""""""""""""""""""""
+
+The tool was still broken and gave incorrect results after the previous fix.
+
+:issue:`3444`
+
 Fixes that affect portability
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
index d4e4edefdf5ad6d18c372e47c62c68f360b09c5b..8f28e9393325c935f0275e2f05c624b241a9a27e 100644 (file)
@@ -192,8 +192,7 @@ static int strip_dssp(FILE*                   tapeout,
         bFirst = false;
     }
     mat->axis_x.push_back(t);
-    mat->matrix.resize(mat->matrix.extent(0), nr);
-    mat->nx          = mat->matrix.extent(0);
+    mat->matrix.resize(++(mat->nx), nr);
     auto columnIndex = mat->nx - 1;
     for (int i = 0; i < nr; i++)
     {