mirror of
https://github.com/gonum/gonum.git
synced 2025-10-17 20:51:06 +08:00
mat: Expose ReuseAs method to help resizing (#1082)
* mat: Expose ReuseAs method to help resizing Fixes #963
This commit is contained in:
@@ -24,7 +24,7 @@ func (m *Dense) Solve(a, b Matrix) error {
|
||||
if ar != br {
|
||||
panic(ErrShape)
|
||||
}
|
||||
m.reuseAs(ac, bc)
|
||||
m.reuseAsNonZeroed(ac, bc)
|
||||
|
||||
// TODO(btracey): Add special cases for SymDense, etc.
|
||||
aU, aTrans := untranspose(a)
|
||||
@@ -121,7 +121,7 @@ func (v *VecDense) SolveVec(a Matrix, b Vector) error {
|
||||
if v != b {
|
||||
v.checkOverlap(bmat)
|
||||
}
|
||||
v.reuseAs(c)
|
||||
v.reuseAsNonZeroed(c)
|
||||
m := v.asDense()
|
||||
// We conditionally create bm as m when b and v are identical
|
||||
// to prevent the overlap detection code from identifying m
|
||||
@@ -134,7 +134,7 @@ func (v *VecDense) SolveVec(a Matrix, b Vector) error {
|
||||
return m.Solve(a, bm)
|
||||
}
|
||||
|
||||
v.reuseAs(c)
|
||||
v.reuseAsNonZeroed(c)
|
||||
m := v.asDense()
|
||||
return m.Solve(a, b)
|
||||
}
|
||||
|
Reference in New Issue
Block a user