diff --git a/mlpp/lin_alg/mlpp_matrix.cpp b/mlpp/lin_alg/mlpp_matrix.cpp index 83504cf..f3e0515 100644 --- a/mlpp/lin_alg/mlpp_matrix.cpp +++ b/mlpp/lin_alg/mlpp_matrix.cpp @@ -711,6 +711,7 @@ Ref MLPPMatrix::multn(const Ref &B) const { Ref C; C.instance(); C->resize(rs); + C->fill(0); const real_t *a_ptr = ptr(); const real_t *b_ptr = B->ptr(); @@ -745,6 +746,8 @@ void MLPPMatrix::multb(const Ref &A, const Ref &B) { resize(rs); } + fill(0); + const real_t *a_ptr = A->ptr(); const real_t *b_ptr = B->ptr(); real_t *c_ptr = ptrw();