Example #1
0
// Calculates Y = alpha*X + Y.
func daxpy(N int, alpha float64, X []float64, incX int, Y []float64, incY int) {

	C.daxpy_((*C.int)(unsafe.Pointer(&N)),
		(*C.double)(unsafe.Pointer(&alpha)),
		(*C.double)(unsafe.Pointer(&X[0])),
		(*C.int)(unsafe.Pointer(&incX)),
		(*C.double)(unsafe.Pointer(&Y[0])),
		(*C.int)(unsafe.Pointer(&incY)))
}
Example #2
0
// extern void daxpy_(int *n, double *alpha, double *x, int *incx, double *y, int *incy);
func Dacpy(N int, alpha float64, x []float64, incX int, y []float64, incY int) {
	C.daxpy_(
		(*C.int)(unsafe.Pointer(&N)),
		(*C.double)(unsafe.Pointer(&alpha)),
		(*C.double)(unsafe.Pointer(array64(x))),
		(*C.int)(unsafe.Pointer(&incX)),
		array64(y),
		(*C.int)(unsafe.Pointer(&incY)),
	)
}