Properly zero out memory in when multiplying matrices.

This commit is contained in:
Relintai 2023-04-26 16:41:37 +02:00
parent c750933c7e
commit 3eff399d6b

View File

@ -711,6 +711,7 @@ Ref<MLPPMatrix> MLPPMatrix::multn(const Ref<MLPPMatrix> &B) const {
Ref<MLPPMatrix> 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<MLPPMatrix> &A, const Ref<MLPPMatrix> &B) {
resize(rs);
}
fill(0);
const real_t *a_ptr = A->ptr();
const real_t *b_ptr = B->ptr();
real_t *c_ptr = ptrw();