Example #1
0
File: ode.go Project: postfix/gsl-1
func DriverAllocScaledNew(sys *GslOdeiv2System, t *GslOdeiv2StepType, hstart float64, epsabs float64, epsrel float64, aY float64, aDydt float64, scaleAbs []float64) *GslOdeiv2Driver {
	_slice_header_7 := (*reflect.SliceHeader)(unsafe.Pointer(&scaleAbs))
	_ref := C.gsl_odeiv2_driver_alloc_scaled_new((*C.gsl_odeiv2_system)(unsafe.Pointer(sys.CPtr())), (*C.gsl_odeiv2_step_type)(unsafe.Pointer(t.Ptr())), C.double(hstart), C.double(epsabs), C.double(epsrel), C.double(aY), C.double(aDydt), (*C.double)(unsafe.Pointer(_slice_header_7.Data)))
	_result := &GslOdeiv2Driver{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #2
0
File: ode.go Project: postfix/gsl-1
func ControlScaledNew(epsAbs float64, epsRel float64, aY float64, aDydt float64, scaleAbs []float64, dim int) *GslOdeiv2Control {
	_slice_header_4 := (*reflect.SliceHeader)(unsafe.Pointer(&scaleAbs))
	_ref := C.gsl_odeiv2_control_scaled_new(C.double(epsAbs), C.double(epsRel), C.double(aY), C.double(aDydt), (*C.double)(unsafe.Pointer(_slice_header_4.Data)), C.size_t(dim))
	_result := &GslOdeiv2Control{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #3
0
func DiscretePreproc(k int, p []float64) *GslRanDiscreteT {
	_slice_header_1 := (*reflect.SliceHeader)(unsafe.Pointer(&p))
	_ref := C.gsl_ran_discrete_preproc(C.size_t(k), (*C.double)(unsafe.Pointer(_slice_header_1.Data)))
	_result := &GslRanDiscreteT{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #4
0
//gsl_ntuple * gsl_ntuple_create (char * filename, void * ntuple_data, size_t size)
func CreateOrOpen(filename string, data interface{}, op OpenOperation) *GslNtuple {

	// Check the data type and make sure it is a slice of some concrete type.
	dataType := reflect.TypeOf(data)
	if dataType.Kind() != reflect.Slice {
		gogsl.Error("ntuple.Create() data argument must be a slice", gogsl.GSL_EINVAL)
		return nil
	}
	dataValue := reflect.ValueOf(data)
	baseType := dataType.Elem()
	dataSize := int(baseType.Size()) * dataValue.Len()
	if !dataValue.CanAddr() {
		x := reflect.New(dataValue.Type()).Elem()
		x.Set(dataValue)
		dataValue = x
	}
	srcHdr := (*reflect.SliceHeader)(unsafe.Pointer(dataValue.UnsafeAddr()))
	cFile := C.CString(filename)
	var tuplePtr *C.gsl_ntuple
	switch op {
	case OPEN:
		{
			tuplePtr = C.gsl_ntuple_open(cFile, unsafe.Pointer(srcHdr.Data), C.size_t(dataSize))
		}
	case CREATE:
		{
			tuplePtr = C.gsl_ntuple_create(cFile, unsafe.Pointer(srcHdr.Data), C.size_t(dataSize))
		}
	default:
		{
			gogsl.Error("unknown open operation", gogsl.GSL_EINVAL)
			return nil
		}
	}
	result := &GslNtuple{baseType: baseType, refLen: dataValue.Len(), elementSize: int(baseType.Size()), ref: data}
	gogsl.InitializeGslReference(result, uintptr(unsafe.Pointer(tuplePtr)))
	C.free(unsafe.Pointer(cFile))
	return result
}
Example #5
0
File: ode.go Project: postfix/gsl-1
func DriverAllocStandardNew(sys *GslOdeiv2System, t *GslOdeiv2StepType, hstart float64, epsabs float64, epsrel float64, aY float64, aDydt float64) *GslOdeiv2Driver {
	_ref := C.gsl_odeiv2_driver_alloc_standard_new((*C.gsl_odeiv2_system)(unsafe.Pointer(sys.CPtr())), (*C.gsl_odeiv2_step_type)(unsafe.Pointer(t.Ptr())), C.double(hstart), C.double(epsabs), C.double(epsrel), C.double(aY), C.double(aDydt))
	_result := &GslOdeiv2Driver{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #6
0
func WaveletAlloc(t *GslWaveletType, k int) *GslWavelet {
	_ref := C.gsl_wavelet_alloc((*C.gsl_wavelet_type)(unsafe.Pointer(t.Ptr())), C.size_t(k))
	_result := &GslWavelet{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #7
0
File: dht.go Project: postfix/gsl-1
func Alloc(size int) *GslDht {
	_ref := C.gsl_dht_alloc(C.size_t(size))
	_result := &GslDht{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #8
0
func BlockComplexCalloc(n int) *GslBlockComplex {
	_ref := C.gsl_block_complex_calloc(C.size_t(n))
	_result := &GslBlockComplex{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #9
0
func FdfsolverF(s *GslMultirootFdfsolver) *vector.GslVector {
	_ref := C.gsl_multiroot_fdfsolver_f((*C.gsl_multiroot_fdfsolver)(unsafe.Pointer(s.Ptr())))
	_result := &vector.GslVector{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #10
0
func Clone(q *GslQrng) *GslQrng {
	_ref := C.gsl_qrng_clone((*C.gsl_qrng)(unsafe.Pointer(q.Ptr())))
	_result := &GslQrng{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #11
0
File: fft.go Project: postfix/gsl-1
func ComplexWorkspaceAlloc(n int) *GslFftComplexWorkspace {
	_ref := C.gsl_fft_complex_workspace_alloc(C.size_t(n))
	_result := &GslFftComplexWorkspace{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #12
0
File: fft.go Project: postfix/gsl-1
func HalfcomplexWavetableAlloc(n int) *GslFftHalfcomplexWavetable {
	_ref := C.gsl_fft_halfcomplex_wavetable_alloc(C.size_t(n))
	_result := &GslFftHalfcomplexWavetable{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #13
0
File: ode.go Project: postfix/gsl-1
func ControlYpNew(epsAbs float64, epsRel float64) *GslOdeiv2Control {
	_ref := C.gsl_odeiv2_control_yp_new(C.double(epsAbs), C.double(epsRel))
	_result := &GslOdeiv2Control{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #14
0
File: ode.go Project: postfix/gsl-1
func ControlStandardNew(epsAbs float64, epsRel float64, aY float64, aDydt float64) *GslOdeiv2Control {
	_ref := C.gsl_odeiv2_control_standard_new(C.double(epsAbs), C.double(epsRel), C.double(aY), C.double(aDydt))
	_result := &GslOdeiv2Control{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #15
0
File: ode.go Project: postfix/gsl-1
func StepAlloc(t *GslOdeiv2StepType, dim int) *GslOdeiv2Step {
	_ref := C.gsl_odeiv2_step_alloc((*C.gsl_odeiv2_step_type)(unsafe.Pointer(t.Ptr())), C.size_t(dim))
	_result := &GslOdeiv2Step{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #16
0
File: fit.go Project: postfix/gsl-1
func GslMultifitLinearAlloc(n int, p int) *GslMultifitLinearWorkspace {
	_ref := C.gsl_multifit_linear_alloc(C.size_t(n), C.size_t(p))
	_result := &GslMultifitLinearWorkspace{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #17
0
func QrngAlloc(t *GslQrngType, d uint32) *GslQrng {
	_ref := C.gsl_qrng_alloc((*C.gsl_qrng_type)(unsafe.Pointer(t.Ptr())), C.uint(d))
	_result := &GslQrng{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #18
0
func MathieuWorkspaceAlloc(n int, qmax float64) *GslSfMathieuWorkspace {
	_ref := C.gsl_sf_mathieu_alloc(C.size_t(n), C.double(qmax))
	_result := &GslSfMathieuWorkspace{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #19
0
func VegasAlloc(dim int) *GslMonteVegasState {
	_ref := C.gsl_monte_vegas_alloc(C.size_t(dim))
	_result := &GslMonteVegasState{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #20
0
func CombinationCalloc(n int, k int) *GslCombination {
	_ref := C.gsl_combination_calloc(C.size_t(n), C.size_t(k))
	_result := &GslCombination{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #21
0
func FdfsolverAlloc(t *GslMultirootFdfsolverType, n int) *GslMultirootFdfsolver {
	_ref := C.gsl_multiroot_fdfsolver_alloc((*C.gsl_multiroot_fdfsolver_type)(unsafe.Pointer(t.Ptr())), C.size_t(n))
	_result := &GslMultirootFdfsolver{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #22
0
File: root.go Project: dtromb/gogsl
func FsolverAlloc(t *GslRootFsolverType) *GslRootFsolver {
	_ref := C.gsl_root_fsolver_alloc((*C.gsl_root_fsolver_type)(unsafe.Pointer(t.Ptr())))
	_result := &GslRootFsolver{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #23
0
func BlockUcharAlloc(n int) *GslBlockUchar {
	_ref := C.gsl_block_uchar_alloc(C.size_t(n))
	_result := &GslBlockUchar{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #24
0
File: sum.go Project: postfix/gsl-1
func LevinUtruncAlloc(n int) *GslSumLevinUtruncWorkspace {
	_ref := C.gsl_sum_levin_utrunc_alloc(C.size_t(n))
	_result := &GslSumLevinUtruncWorkspace{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #25
0
func BlockFloatCalloc(n int) *GslBlockFloat {
	_ref := C.gsl_block_float_calloc(C.size_t(n))
	_result := &GslBlockFloat{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #26
0
File: rng.go Project: postfix/gsl-1
func EnvSetup() *GslRngType {
	_ref := C.gsl_rng_env_setup()
	_result := &GslRngType{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #27
0
File: dht.go Project: postfix/gsl-1
func New(size int, nu float64, xmax float64) *GslDht {
	_ref := C.gsl_dht_new(C.size_t(size), C.double(nu), C.double(xmax))
	_result := &GslDht{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #28
0
File: fit.go Project: postfix/gsl-1
func GslMultifitRobustAlloc(t *GslMultifitRobustType, n int, p int) *GslMultifitRobustWorkspace {
	_ref := C.gsl_multifit_robust_alloc((*C.gsl_multifit_robust_type)(unsafe.Pointer(t.Ptr())), C.size_t(n), C.size_t(p))
	_result := &GslMultifitRobustWorkspace{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #29
0
func WaveletWorkspaceAlloc(n int) *GslWaveletWorkspace {
	_ref := C.gsl_wavelet_workspace_alloc(C.size_t(n))
	_result := &GslWaveletWorkspace{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}
Example #30
0
File: ode.go Project: postfix/gsl-1
func EvolveAlloc(dim int) *GslOdeiv2Evolve {
	_ref := C.gsl_odeiv2_evolve_alloc(C.size_t(dim))
	_result := &GslOdeiv2Evolve{}
	gogsl.InitializeGslReference(_result, uintptr(unsafe.Pointer(_ref)))
	return _result
}