Пример #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
//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)
}