Пример #1
0
/*
 double cblas_dasum(const int N, const double *X, const int incX);
*/
func Dasum(x []float64) float64 {
	c_N := C.int(len(x))

	c_X := (*C.double)(unsafe.Pointer(&x[0]))
	c_incX := C.int(1)

	return float64(C.cblas_dasum(c_N, c_X, c_incX))
}
Пример #2
0
// Return the sum of v
func (v vector) sum() float64 {
	return float64(C.cblas_dasum(C.int(len(v)), (*C.double)(unsafe.Pointer(&v[0])), 1))
}