Skip to content

Commit

Permalink
added column check to dense access
Browse files Browse the repository at this point in the history
  • Loading branch information
btracey committed Mar 17, 2014
1 parent 025ebb2 commit 7f3c273
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mat64/dense.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ func (m *Dense) isZero() bool {
}

func (m *Dense) At(r, c int) float64 {
if c >= m.mat.Cols {
panic("dense access out of bounds")
}
return m.mat.Data[r*m.mat.Stride+c]
}

Expand Down

0 comments on commit 7f3c273

Please sign in to comment.