本文整理匯總了Golang中github.com/dtromb/gogsl.InitializeGslStruct函數的典型用法代碼示例。如果您正苦於以下問題:Golang InitializeGslStruct函數的具體用法?Golang InitializeGslStruct怎麽用?Golang InitializeGslStruct使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了InitializeGslStruct函數的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: gslMultifitFunctionFdfDfCaller
//export gslMultifitFunctionFdfDfCaller
func gslMultifitFunctionFdfDfCaller(x uintptr, cFunParamPtr uintptr, df uintptr) int {
xVect := &vector.GslVector{}
gogsl.InitializeGslStruct(xVect, x)
dfMat := &matrix.GslMatrix{}
gogsl.InitializeGslStruct(dfMat, df)
gslf := (*GslMultifitFunctionFdf)(unsafe.Pointer(cFunParamPtr))
return gslf.Derivative(xVect, gslf.Params, dfMat)
}
示例2: gslMultiminFunctionFdfCaller
//export gslMultiminFunctionFdfCaller
func gslMultiminFunctionFdfCaller(x uintptr, cFunParamPtr uintptr, df uintptr) float64 {
xVect := &vector.GslVector{}
gogsl.InitializeGslStruct(xVect, x)
dfVect := &vector.GslVector{}
gogsl.InitializeGslStruct(dfVect, df)
gslf := (*GslMultiminFunctionFdf)(unsafe.Pointer(cFunParamPtr))
return gslf.Fdf(xVect, gslf.Params, dfVect)
}
示例3: gslMultifitFunctionFdfFCaller
//export gslMultifitFunctionFdfFCaller
func gslMultifitFunctionFdfFCaller(x uintptr, cFunParamPtr uintptr, f uintptr) int {
xVect := &vector.GslVector{}
gogsl.InitializeGslStruct(xVect, x)
fVect := &vector.GslVector{}
gogsl.InitializeGslStruct(fVect, f)
gslf := (*GslMultifitFunctionFdf)(unsafe.Pointer(cFunParamPtr))
return gslf.Function(xVect, gslf.Params, fVect)
}
示例4: gslMultiminFunctionFdfDfCaller
//export gslMultiminFunctionFdfDfCaller
func gslMultiminFunctionFdfDfCaller(x uintptr, cFunParamPtr uintptr, df uintptr) {
xVect := &vector.GslVector{}
gogsl.InitializeGslStruct(xVect, x)
dfVect := &vector.GslVector{}
gogsl.InitializeGslStruct(dfVect, df)
gslf := (*GslMultiminFunctionFdf)(unsafe.Pointer(cFunParamPtr))
gslf.Derivative(xVect, gslf.Params, dfVect)
}
示例5: gslMultirootFunctionFdfCaller
//export gslMultirootFunctionFdfCaller
func gslMultirootFunctionFdfCaller(x uintptr, cFunParamPtr uintptr, f uintptr, df uintptr) int {
xVect := &vector.GslVector{}
gogsl.InitializeGslStruct(xVect, x)
fVect := &vector.GslVector{}
gogsl.InitializeGslStruct(fVect, f)
dfMat := &matrix.GslMatrix{}
gogsl.InitializeGslStruct(dfMat, df)
gslf := (*GslMultirootFunctionFdf)(unsafe.Pointer(cFunParamPtr))
return gslf.Fdf(xVect, gslf.Params, fVect, dfMat)
}
示例6: gslSimanStepFunctionCaller
//export gslSimanStepFunctionCaller
func gslSimanStepFunctionCaller(rngptr uintptr, xptr uintptr, stepSize float64) {
//fmt.Println("S")
r := &rng.GslRng{}
gogsl.InitializeGslStruct(r, rngptr)
xarg := (*GslSimanArgument)(unsafe.Pointer(xptr))
//fmt.Printf("S inval=%f @ %8.8x\n", *xarg.x.(*float64), reflect.ValueOf(xarg.x).Pointer())
xarg.impl.stepFn(r, xarg.x, stepSize)
//fmt.Printf(" outval=%f @ %8.8x\n", *xarg.x.(*float64), reflect.ValueOf(xarg.x).Pointer())
}
示例7: Ptr
func (r *GslSfResultE10) Ptr() uintptr {
ptr := r.GslReference.Ptr()
if ptr != 0 {
return ptr
}
r.CData = make([]byte, GSL_SF_RESULT_E10_STRUCT_SIZE)
ptr = ((*reflect.SliceHeader)(unsafe.Pointer(&r.CData))).Data
gogsl.InitializeGslStruct(r, ptr)
return ptr
}
示例8: RobustStatistics
//gsl_multifit_robust_stats gsl_multifit_robust_statistics (const gsl_multifit_robust_workspace * w)
func RobustStatistics(rw *GslMultifitRobustWorkspace) *GslMultifitRobustStatistics {
var dof C.size_t
var numit C.size_t
var weightsPtr *C.gsl_vector
var rPtr *C.gsl_vector
res := &GslMultifitRobustStatistics{}
C.get_robust_statistics((*C.gsl_multifit_robust_workspace)(unsafe.Pointer(rw.Ptr())),
(*C.double)(&res.SigmaOls), (*C.double)(&res.SigmaMad), (*C.double)(&res.SigmaRob), (*C.double)(&res.Sigma),
(*C.double)(&res.Rsq), (*C.double)(&res.AdjRsq), (*C.double)(&res.Rmse), (*C.double)(&res.Sse),
&dof, &numit, &weightsPtr, &rPtr)
res.Dof = int(dof)
res.Numit = int(numit)
weights := &vector.GslVector{}
gogsl.InitializeGslStruct(weights, uintptr(unsafe.Pointer(weightsPtr)))
r := &vector.GslVector{}
gogsl.InitializeGslStruct(r, uintptr(unsafe.Pointer(rPtr)))
res.Weights = vector.VectorAlloc(weights.Length())
res.R = vector.VectorAlloc(r.Length())
vector.Memcpy(res.Weights, weights)
vector.Memcpy(res.R, r)
return res
}
示例9: J_
func (s *GslMultifitFdfsolver) J_() *matrix.GslMatrix {
cptr := C.get_gsl_multifit_fdfsolver_j_ptr((*C.gsl_multifit_fdfsolver)(unsafe.Pointer(s.Ptr())))
m := &matrix.GslMatrix{}
gogsl.InitializeGslStruct(m, uintptr(unsafe.Pointer(cptr)))
return m
}
示例10: Dx_
func (s *GslMultifitFdfsolver) Dx_() *vector.GslVector {
cptr := C.get_gsl_multifit_fdfsolver_dx_ptr((*C.gsl_multifit_fdfsolver)(unsafe.Pointer(s.Ptr())))
v := &vector.GslVector{}
gogsl.InitializeGslStruct(v, uintptr(unsafe.Pointer(cptr)))
return v
}
示例11: Vector
func (vv *GslVectorView) Vector() *GslVector {
v := &GslVector{}
ptr := C.get_vector_view_vector((*C.gsl_vector_view)(unsafe.Pointer(vv.Ptr())))
gogsl.InitializeGslStruct(v, uintptr(unsafe.Pointer(ptr)))
return v
}
示例12: X_
func (s *GslMultirootFsolver) X_() *vector.GslVector {
cptr := C.get_gsl_mutliroot_solver_x_ptr((*C.gsl_multiroot_fsolver)(unsafe.Pointer(s.Ptr())))
v := &vector.GslVector{}
gogsl.InitializeGslStruct(v, uintptr(unsafe.Pointer(cptr)))
return v
}
示例13: Gradient_
func (s *GslMultiminFdfminimizer) Gradient_() *vector.GslVector {
cptr := C.get_gsl_mutlimin_fdfminimizer_gradient_ptr((*C.gsl_multimin_fdfminimizer)(unsafe.Pointer(s.Ptr())))
v := &vector.GslVector{}
gogsl.InitializeGslStruct(v, uintptr(unsafe.Pointer(cptr)))
return v
}
示例14: Matrix
// XXX - Do this with the others...
func (v *GslMatrixView) Matrix() *GslMatrix {
m := &GslMatrix{}
ptr := C.get_matrix_view_matrix((*C.gsl_matrix_view)(unsafe.Pointer(v.Ptr())))
gogsl.InitializeGslStruct(m, uintptr(unsafe.Pointer(ptr)))
return m
}