예제 #1
0
// Calculates asum(X).
func dasum(N int, X []float64, incX int) float64 {
	var val C.double
	val = C.dasum_((*C.int)(unsafe.Pointer(&N)),
		(*C.double)(unsafe.Pointer(&X[0])),
		(*C.int)(unsafe.Pointer(&incX)))
	return float64(val)
}
예제 #2
0
파일: blas.go 프로젝트: rygomez/goutil
//extern double dasum_(int *n, double *x, int *incx);
func Dasum(n int, x []float64, incx int) float64 {
	r := C.dasum_(
		(*C.int)(unsafe.Pointer(&n)),
		array64(x),
		(*C.int)(unsafe.Pointer(&incx)),
	)
	return float64(r)
}