Esempio n. 1
0
// For general band matrix A  and vector X and Y compute
// Y = alpha * A * X + beta * Y or Y = alpha * A.T * X + beta * Y
func dgbmv(transA string, M int, N int, KL int, KU int,
	alpha float64, A []float64, lda int,
	X []float64, incX int, beta float64,
	Y []float64, incY int) {

	ctransA := C.CString(transA)
	defer C.free(unsafe.Pointer(ctransA))

	C.dgbmv_(ctransA,
		(*C.int)(unsafe.Pointer(&M)),
		(*C.int)(unsafe.Pointer(&N)),
		(*C.int)(unsafe.Pointer(&KU)),
		(*C.int)(unsafe.Pointer(&KL)),
		(*C.double)(unsafe.Pointer(&alpha)),
		(*C.double)(unsafe.Pointer(&A[0])),
		(*C.int)(unsafe.Pointer(&lda)),
		(*C.double)(unsafe.Pointer(&X[0])),
		(*C.int)(unsafe.Pointer(&incX)),
		(*C.double)(unsafe.Pointer(&beta)),
		(*C.double)(unsafe.Pointer(&Y[0])),
		(*C.int)(unsafe.Pointer(&incY)))
}
Esempio n. 2
0
// For general band matrix A  and vector X and Y compute
// Y = alpha * A * X + beta * Y or Y = alpha * A.T * X + beta * Y
func dgbmv(transA string, M int, N int, KL int, KU int,
	alpha float64, A []float64, lda int,
	X []float64, incX int, beta float64,
	Y []float64, incY int) {

	ctransA := C.CString(transA)
	defer C.free(unsafe.Pointer(ctransA))

	// ?? TODO: protect against index out of bounds panics.
	C.dgbmv_(ctransA,
		(*C.int)(unsafe.Pointer(&M)),
		(*C.int)(unsafe.Pointer(&N)),
		(*C.int)(unsafe.Pointer(&KU)),
		(*C.int)(unsafe.Pointer(&KL)),
		(*C.double)(unsafe.Pointer(&alpha)),
		(*C.double)(unsafe.Pointer(&A[0])),
		(*C.int)(unsafe.Pointer(&lda)),
		(*C.double)(unsafe.Pointer(&X[0])),
		(*C.int)(unsafe.Pointer(&incX)),
		(*C.double)(unsafe.Pointer(&beta)),
		(*C.double)(unsafe.Pointer(&Y[0])),
		(*C.int)(unsafe.Pointer(&incY)))
}