github.com/gopherd/gonum@v0.0.4/internal/asm/c128/scal.go (about) 1 // Copyright ©2016 The Gonum Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package c128 6 7 // ScalUnitaryTo is 8 // for i, v := range x { 9 // dst[i] = alpha * v 10 // } 11 func ScalUnitaryTo(dst []complex128, alpha complex128, x []complex128) { 12 for i, v := range x { 13 dst[i] = alpha * v 14 } 15 } 16 17 // ScalIncTo is 18 // var idst, ix uintptr 19 // for i := 0; i < int(n); i++ { 20 // dst[idst] = alpha * x[ix] 21 // ix += incX 22 // idst += incDst 23 // } 24 func ScalIncTo(dst []complex128, incDst uintptr, alpha complex128, x []complex128, n, incX uintptr) { 25 var idst, ix uintptr 26 for i := 0; i < int(n); i++ { 27 dst[idst] = alpha * x[ix] 28 ix += incX 29 idst += incDst 30 } 31 }