Skip to content

Commit

Permalink
mat: rename CloneVec to CloneFromVec
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-ch committed Mar 8, 2020
1 parent 8ba336e commit 5f268d9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mat/band.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions mat/symband.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions mat/vector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions optimize/bfgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5f268d9

Please sign in to comment.