예제 #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))))
}