Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Commit

Permalink
Avoid the issue of NaN in receiver matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Jan 1, 2015
1 parent 35f9fa1 commit f9625e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions mat64/dense_arithmetic.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,6 @@ func (m *Dense) Pow(a Matrix, n int) {
m.Copy(a)
return
case 2:
for i := 0; i < r; i++ {
zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c])
}
m.Mul(a, a)
return
}
Expand Down
6 changes: 6 additions & 0 deletions mat64/dense_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,9 @@ func (s *S) TestPow(c *check.C) {
d[i] = math.NaN()
}
*a = *NewDense(10, 10, d).View(1, 1, 3, 3).(*Dense)
for i := 0; i < a.mat.Rows; i++ {
zero(a.mat.Data[i*a.mat.Stride : i*a.mat.Stride+a.mat.Cols])
}
},
},
{
Expand All @@ -621,6 +624,9 @@ func (s *S) TestPow(c *check.C) {
d[i] = math.NaN()
}
*a = *NewDense(10, 10, d).View(1, 1, 3, 3).(*Dense)
for i := 0; i < a.mat.Rows; i++ {
zero(a.mat.Data[i*a.mat.Stride : i*a.mat.Stride+a.mat.Cols])
}
},
},
} {
Expand Down

0 comments on commit f9625e8

Please sign in to comment.