1 // Copyright ©2015 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.
10 "gonum.org/v1/gonum/blas/blas64"
13 // Drscl multiplies the vector x by 1/a being careful to avoid overflow or
14 // underflow where possible.
16 // Drscl is an internal routine. It is exported for testing purposes.
17 func (impl Implementation) Drscl(n int, a float64, x []float64, incX int) {
18 checkVector(n, x, incX)
19 bi := blas64.Implementation()
25 cden1 := cden * smlnum
26 cnum1 := cnum / bignum
30 case cnum != 0 && math.Abs(cden1) > math.Abs(cnum):
34 case math.Abs(cnum1) > math.Abs(cden):
42 bi.Dscal(n, mul, x, incX)