mirror of
https://github.com/Relintai/pmlpp.git
synced 2024-11-08 13:12:09 +01:00
Properly zero out memory in when multiplying matrices.
This commit is contained in:
parent
c750933c7e
commit
3eff399d6b
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user