Exemple #1
0
// Eval evaluates the spline at x.
// If x is out of bounds, the code will panic.
func (s *Spline) Eval(x float64) (float64, error) {
	var y C.double
	ret := C.gsl_spline_eval_e(s.sp, C.double(x), s.acc, &y)
	if ret != 0 {
		return float64(y), gsl.Errno(ret)
	}
	return float64(y), nil
}
Exemple #2
0
func SplineEvalE(spline *GslSpline, x float64, acc *GslInterpAccel) (int32, float64) {
	var _outptr_3 C.double
	_result := int32(C.gsl_spline_eval_e((*C.gsl_spline)(unsafe.Pointer(spline.Ptr())), C.double(x), (*C.gsl_interp_accel)(unsafe.Pointer(acc.Ptr())), &_outptr_3))
	return _result, *(*float64)(unsafe.Pointer(&_outptr_3))
}