當前位置: 首頁>>代碼示例>>Golang>>正文


Golang gogsl.InitializeGslReference函數代碼示例

本文整理匯總了Golang中github.com/dtromb/gogsl.InitializeGslReference函數的典型用法代碼示例。如果您正苦於以下問題:Golang InitializeGslReference函數的具體用法?Golang InitializeGslReference怎麽用?Golang InitializeGslReference使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了InitializeGslReference函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: DriverAllocScaledNew

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:7,代碼來源:ode.go

示例2: ControlScaledNew

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:7,代碼來源:ode.go

示例3: DiscretePreproc

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:7,代碼來源:randist.go

示例4: CreateOrOpen

//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
}
開發者ID:dtromb,項目名稱:gogsl,代碼行數:40,代碼來源:ntuple_support.go

示例5: DriverAllocStandardNew

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:ode.go

示例6: WaveletAlloc

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
}
開發者ID:dtromb,項目名稱:gogsl,代碼行數:6,代碼來源:wavelet.go

示例7: Alloc

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:dht.go

示例8: BlockComplexCalloc

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:block.go

示例9: FdfsolverF

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:multiroot.go

示例10: Clone

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:qrng.go

示例11: ComplexWorkspaceAlloc

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:fft.go

示例12: HalfcomplexWavetableAlloc

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:fft.go

示例13: ControlYpNew

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:ode.go

示例14: ControlStandardNew

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:ode.go

示例15: StepAlloc

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
}
開發者ID:postfix,項目名稱:gsl-1,代碼行數:6,代碼來源:ode.go


注:本文中的github.com/dtromb/gogsl.InitializeGslReference函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。