示例#1
0
文件: bessel.go 项目: npadmana/npgo
// SphBesselArr returns an array of Jl(x) where l runs from 0 to nmax inclusive
//
// Note that GSL has two implementations; we use the default one, not the one based
// on Steed's algorithm.
func SphBesselArr(lmax int, x float64) []float64 {
	arr := make([]float64, lmax+1)
	ret := C.gsl_sf_bessel_jl_array(C.int(lmax), C.double(x), (*C.double)(&arr[0]))
	if ret != 0 {
		panic(gsl.Errno(ret))
	}
	return arr
}
示例#2
0
func JlArray(lmax int32, x float64, resultArray []float64) int32 {
	_slice_header_2 := (*reflect.SliceHeader)(unsafe.Pointer(&resultArray))
	return int32(C.gsl_sf_bessel_jl_array(C.int(lmax), C.double(x), (*C.double)(unsafe.Pointer(_slice_header_2.Data))))
}