Ejemplo n.º 1
0
// void dpotrf_(char *uplo, int *n, double *A, int *lda, int *info);
func dpotrf(uplo string, N int, A []float64, lda int) int {
	var info int
	cuplo := C.CString(uplo)
	defer C.free(unsafe.Pointer(cuplo))

	C.dpotrf_(cuplo,
		(*C.int)(unsafe.Pointer(&N)),
		(*C.double)(unsafe.Pointer(&A[0])),
		(*C.int)(unsafe.Pointer(&lda)),
		(*C.int)(unsafe.Pointer(&info)))
	return info
}
Ejemplo n.º 2
0
// DPOTRF: (Double-precision) POsitive-definite TRiangular Factor
//
// http://www.netlib.org/lapack/double/dpotrf.f
func dpotrf(uplo Triangle, n int, a []float64, lda int) error {
	var (
		uplo_ = uploChar(uplo)
		n_    = C.integer(n)
		a_    = ptrFloat64(a)
		lda_  = C.integer(lda)
	)
	var info_ C.integer

	C.dpotrf_(&uplo_, &n_, a_, &lda_, &info_)
	return dpotrfError(int(info_))
}