mirror of
https://github.com/gonum/gonum.git
synced 2025-10-12 10:30:17 +08:00
Change NewDense signature and behaviour
This is an API breaking change. NewDense now panics if len(mat) != r*c, unless mat == nil. When mat is nil a new, correctly sized slice is allocated.
This commit is contained in:
@@ -289,7 +289,7 @@ func Inverse(a Matrix) *Dense {
|
||||
for i := 0; i < m*m; i += m + 1 {
|
||||
d[i] = 1
|
||||
}
|
||||
eye, _ := NewDense(m, m, d)
|
||||
eye := NewDense(m, m, d)
|
||||
return Solve(a, eye)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user