Skip to content

Commit

Permalink
stat: use IsZero
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Jul 6, 2017
1 parent 01a0286 commit e1b3c53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stat/pca_cca.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (c *PC) VectorsTo(dst *mat.Dense) *mat.Dense {
}

if dst != nil {
if d, n := dst.Dims(); (n != 0 || d != 0) && (d != c.d || n != min(c.n, c.d)) {
if d, n := dst.Dims(); !dst.IsZero() && (d != c.d || n != min(c.n, c.d)) {
panic(mat.ErrShape)
}
}
Expand Down Expand Up @@ -226,7 +226,7 @@ func (c *CC) LeftTo(dst *mat.Dense, spheredSpace bool) *mat.Dense {
}

if dst != nil {
if d, n := dst.Dims(); (n != 0 || d != 0) && (n != c.yd || d != c.xd) {
if d, n := dst.Dims(); !dst.IsZero() && (n != c.yd || d != c.xd) {
panic(mat.ErrShape)
}
}
Expand Down

0 comments on commit e1b3c53

Please sign in to comment.