From de8073e6891799b372e4fc50a333fe0bba427e00 Mon Sep 17 00:00:00 2001 From: Tong Dong Qiu Date: Tue, 23 Nov 2021 09:49:04 +0100 Subject: [PATCH] Reuse Matrix constructor --- opm/simulators/linalg/bda/Matrix.hpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/opm/simulators/linalg/bda/Matrix.hpp b/opm/simulators/linalg/bda/Matrix.hpp index 8a90b0f67..d06ee57e6 100644 --- a/opm/simulators/linalg/bda/Matrix.hpp +++ b/opm/simulators/linalg/bda/Matrix.hpp @@ -38,6 +38,7 @@ public: /// \param[in] nnzs number of nonzeros Matrix(int N_, int nnzs_) : N(N_), + M(N_), nnzs(nnzs_) { nnzValues.resize(nnzs); @@ -50,13 +51,9 @@ public: /// \param[in] M number of columns /// \param[in] nnzs number of nonzeros Matrix(int N_, int M_, int nnzs_) - : N(N_), - M(M_), - nnzs(nnzs_) + : Matrix(N_, nnzs_) { - nnzValues.resize(nnzs); - colIndices.resize(nnzs); - rowPointers.resize(N+1); + M = M_; } #if HAVE_FPGA