示例#1
0
// Norm computes the Euclidean norm of the vector.
func (v Vector) Norm() float32 {
	return blas.Snrm2(len(v), v, 1)
}
示例#2
0
// Normalise normalises the vector in-place.
func (v Vector) Normalise() {
	w := blas.Snrm2(len(v), v, 1)
	blas.Sscal(len(v), 1/w, v, 1)
}