示例#1
0
文件: bessel.go 项目: npadmana/npgo
// BesselJArr returns an array of Jn(x) where n runs from nmin to nmax inclusive
func BesselJArr(nmin, nmax int, x float64) []float64 {
	arr := make([]float64, nmax-nmin+1)
	ret := C.gsl_sf_bessel_Jn_array(C.int(nmin), C.int(nmax), C.double(x), (*C.double)(&arr[0]))
	if ret != 0 {
		panic(gsl.Errno(ret))
	}
	return arr
}
示例#2
0
文件: bessel.go 项目: kofron/gogsl
func BesselJnArray(nmin, nmax int, x float64, result *[]float64) (e error) {
	resptr := (*C.double)((unsafe.Pointer)(&(*result)[0]))
	er := (C.gsl_sf_bessel_Jn_array((C.int)(nmin),
		(C.int)(nmax),
		(C.double)(x),
		resptr))
	if er == (C.int)(0) {
		e = nil
	} else {
		e = gsl.NewGSLError(int(er))
	}

	return
}
示例#3
0
func JnArray(nmin int32, nmax int32, x float64, resultArray []float64) int32 {
	_slice_header_3 := (*reflect.SliceHeader)(unsafe.Pointer(&resultArray))
	return int32(C.gsl_sf_bessel_Jn_array(C.int(nmin), C.int(nmax), C.double(x), (*C.double)(unsafe.Pointer(_slice_header_3.Data))))
}