예제 #1
0
func dtrsm(side, uplo, transA, diag string,
	M int, N int, alpha float64, A []float64, lda int, B []float64, ldb int) {

	cuplo := C.CString(uplo)
	defer C.free(unsafe.Pointer(cuplo))
	ctrans := C.CString(transA)
	defer C.free(unsafe.Pointer(ctrans))
	cside := C.CString(side)
	defer C.free(unsafe.Pointer(cside))
	cdiag := C.CString(diag)
	defer C.free(unsafe.Pointer(cdiag))

	// protect against index out of bounds panics
	var aptr, bptr *float64 = nil, nil
	if len(A) > 0 {
		aptr = &A[0]
	}
	if len(B) > 0 {
		bptr = &B[0]
	}
	C.dtrsm_(cside, cuplo, ctrans, cdiag,
		(*C.int)(unsafe.Pointer(&M)),
		(*C.int)(unsafe.Pointer(&N)),
		(*C.double)(unsafe.Pointer(&alpha)),
		(*C.double)(unsafe.Pointer(aptr)),
		(*C.int)(unsafe.Pointer(&lda)),
		(*C.double)(unsafe.Pointer(bptr)),
		(*C.int)(unsafe.Pointer(&ldb)))
}
예제 #2
0
func dtrsm(side, uplo, transA, diag string,
	M int, N int, alpha float64, A []float64, lda int, B []float64, ldb int) {

	cuplo := C.CString(uplo)
	defer C.free(unsafe.Pointer(cuplo))
	ctrans := C.CString(transA)
	defer C.free(unsafe.Pointer(ctrans))
	cside := C.CString(side)
	defer C.free(unsafe.Pointer(cside))
	cdiag := C.CString(diag)
	defer C.free(unsafe.Pointer(cdiag))

	C.dtrsm_(cside, cuplo, ctrans, cdiag,
		(*C.int)(unsafe.Pointer(&M)),
		(*C.int)(unsafe.Pointer(&N)),
		(*C.double)(unsafe.Pointer(&alpha)),
		(*C.double)(unsafe.Pointer(&A[0])),
		(*C.int)(unsafe.Pointer(&lda)),
		(*C.double)(unsafe.Pointer(&B[0])),
		(*C.int)(unsafe.Pointer(&ldb)))
}