mat: rename CloneVec to CloneFromVec
MODIFY
mat/band.go
mat/band.go
@@ -322,13 +322,13 @@ func (b *BandDense) MulVecTo(dst *VecDense, trans bool, x Vector) {
blas64.Gbmv(t, 1, b.mat, xVec.mat, 0, dst.mat)
} else {
xCopy := getWorkspaceVec(n, false)
- xCopy.CloneVec(xVec)
+ xCopy.CloneFromVec(xVec)
blas64.Gbmv(t, 1, b.mat, xCopy.mat, 0, dst.mat)
putWorkspaceVec(xCopy)
}
} else {
xCopy := getWorkspaceVec(n, false)
- xCopy.CloneVec(x)
+ xCopy.CloneFromVec(x)
blas64.Gbmv(t, 1, b.mat, xCopy.mat, 0, dst.mat)
putWorkspaceVec(xCopy)
}

MODIFY
mat/symband.go
mat/symband.go
@@ -267,13 +267,13 @@ func (s *SymBandDense) MulVecTo(dst *VecDense, _ bool, x Vector) {
blas64.Sbmv(1, s.mat, xVec.mat, 0, dst.mat)
} else {
xCopy := getWorkspaceVec(n, false)
- xCopy.CloneVec(xVec)
+ xCopy.CloneFromVec(xVec)
blas64.Sbmv(1, s.mat, xCopy.mat, 0, dst.mat)
putWorkspaceVec(xCopy)
}
} else {
xCopy := getWorkspaceVec(n, false)
- xCopy.CloneVec(x)
+ xCopy.CloneFromVec(x)
blas64.Sbmv(1, s.mat, xCopy.mat, 0, dst.mat)
putWorkspaceVec(xCopy)
}

MODIFY
mat/vector.go
mat/vector.go
@@ -194,9 +194,9 @@ func (v *VecDense) Zero() {
}
}
-// CloneVec makes a copy of a into the receiver, overwriting the previous value
+// CloneFromVec makes a copy of a into the receiver, overwriting the previous value
// of the receiver.
-func (v *VecDense) CloneVec(a Vector) {
+func (v *VecDense) CloneFromVec(a Vector) {
if v == a {
return
}
@@ -218,7 +218,7 @@ func (v *VecDense) CloneVec(a Vector) {
// VecDenseCopyOf returns a newly allocated copy of the elements of a.
func VecDenseCopyOf(a Vector) *VecDense {
v := &VecDense{}
- v.CloneVec(a)
+ v.CloneFromVec(a)
return v
}

MODIFY
optimize/bfgs.go
optimize/bfgs.go
@@ -91,8 +91,8 @@ func (b *BFGS) InitDirection(loc *Location, dir []float64) (stepSize float64) {
x := mat.NewVecDense(dim, loc.X)
grad := mat.NewVecDense(dim, loc.Gradient)
- b.x.CloneVec(x)
- b.grad.CloneVec(grad)
+ b.x.CloneFromVec(x)
+ b.grad.CloneFromVec(grad)
b.y.Reset()
b.s.Reset()

mat: rename CloneVec to CloneFromVec