Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 21 lines (18 sloc) 0.272 kb
c714e7d @ziutek Ddot, Dnrm2, Dasum implemented
authored
1 package blas
2
70ca838 @ziutek Idamax and Dswap added
authored
3 // Absolute sum: \sum |X_i|
519970a @ziutek Makefile removed
authored
4 func Dasum(N int, X []float64, incX int) float64
5
6 func dasum(N int, X []float64, incX int) float64 {
c714e7d @ziutek Ddot, Dnrm2, Dasum implemented
authored
7 var (
519970a @ziutek Makefile removed
authored
8 a float64
c714e7d @ziutek Ddot, Dnrm2, Dasum implemented
authored
9 xi int
10 )
11 for ; N > 0; N-- {
12 x := X[xi]
13 if x < 0 {
7845a0f @ziutek Slightly improved Dasum
authored
14 x = -x
c714e7d @ziutek Ddot, Dnrm2, Dasum implemented
authored
15 }
7845a0f @ziutek Slightly improved Dasum
authored
16 a += x
c714e7d @ziutek Ddot, Dnrm2, Dasum implemented
authored
17 xi += incX
18 }
19 return a
20 }
Something went wrong with that request. Please try again.