mat: ensure number of elements to be copied is sanitised for blas64

This commit is contained in:
Dan Kortschak
2019-07-04 15:39:34 +09:30
parent 536a303fd6
commit 0a381ca743
2 changed files with 31 additions and 1 deletions

View File

@@ -226,7 +226,11 @@ func (v *VecDense) CopyVec(a Vector) int {
return n
}
if r, ok := a.(RawVectorer); ok {
blas64.Copy(r.RawVector(), v.mat)
src := r.RawVector()
src.N = n
dst := v.mat
dst.N = n
blas64.Copy(src, dst)
return n
}
for i := 0; i < n; i++ {