Exemple #1
0
// void zgetrf_(int *m, int *n, complex *A, int *lda, int *ipiv, int *info);
func zgetrf(M, N int, A []complex128, lda int, ipiv []int32) int {
	var info int = 0
	C.zgetrf_((*C.int)(unsafe.Pointer(&M)),
		(*C.int)(unsafe.Pointer(&N)),
		(unsafe.Pointer(&A[0])),
		(*C.int)(unsafe.Pointer(&lda)),
		(*C.int)(unsafe.Pointer(&ipiv[0])),
		(*C.int)(unsafe.Pointer(&info)))
	return info
}
Exemple #2
0
func zgetrfHelper(m, n int, a []complex128, lda int, ipiv []C.integer) error {
	var (
		m_    = C.integer(m)
		n_    = C.integer(n)
		a_    = ptrComplex128(a)
		lda_  = C.integer(lda)
		ipiv_ = ptrInt(ipiv)
	)
	var info_ C.integer

	C.zgetrf_(&m_, &n_, a_, &lda_, ipiv_, &info_)
	return zgetrfError(int(info_))
}