mat: add IsZero method to resetable types

This commit is contained in:
kortschak
2017-06-21 09:58:26 +09:30
committed by Dan Kortschak
parent 08e1f7dfc1
commit 01a0286e0f
9 changed files with 45 additions and 24 deletions

View File

@@ -467,7 +467,7 @@ func (m *Dense) Exp(a Matrix) {
}
var w *Dense
if m.isZero() {
if m.IsZero() {
m.reuseAsZeroed(r, r)
w = m
} else {
@@ -696,7 +696,7 @@ func (m *Dense) Outer(alpha float64, x, y *Vector) {
// Panic as a string, not a mat.Error.
panic("mat: caps not correctly set")
}
if m.isZero() {
if m.IsZero() {
m.mat = blas64.General{
Rows: r,
Cols: c,