예제 #1
0
파일: qag.go 프로젝트: mingzhi/gsl-cgo
func Qags(f F, a, b float64, epsabs, epsrel float64, limit int) (result, abserr float64, status int) {
	wf := C.wrapper_function(unsafe.Pointer(&f))
	r := C.qags(wf, C.double(a), C.double(b), C.double(epsabs), C.double(epsrel), C.size_t(limit))
	result = float64(r.result)
	abserr = float64(r.abserr)
	status = int(r.status)
	return
}
예제 #2
0
파일: qng.go 프로젝트: mingzhi/gsl-cgo
func Qng(f F, a, b, epsabs, epsrel float64) (result, abserr float64, neval, status int) {
	wf := C.wrapper_function(unsafe.Pointer(&f))
	r := C.qng(wf, C.double(a), C.double(b), C.double(epsabs), C.double(epsrel))
	result = float64(r.result)
	abserr = float64(r.abserr)
	status = int(r.status)
	neval = int(r.neval)
	return
}
예제 #3
0
파일: qk.go 프로젝트: mingzhi/gsl-cgo
func Qk(f F, a, b float64, key int) (result, abserr, resabs, resasc float64) {
	wf := C.wrapper_function(unsafe.Pointer(&f))

	r := C.qk(wf, C.int(key), C.double(a), C.double(b))
	result = float64(r.result)
	abserr = float64(r.abserr)
	resabs = float64(r.resabs)
	resasc = float64(r.resasc)
	return
}