Ejemplo n.º 1
0
// Deriv evaluates the derivative of the spline at x.
// If x is out of bounds, the code will panic.
func (s *Spline) Deriv(x float64) (float64, error) {
	var y C.double
	ret := C.gsl_spline_eval_deriv_e(s.sp, C.double(x), s.acc, &y)
	if ret != 0 {
		return float64(y), gsl.Errno(ret)
	}
	return float64(y), nil
}
Ejemplo n.º 2
0
func SplineEvalDerivE(spline *GslSpline, x float64, acc *GslInterpAccel) (int32, float64) {
	var _outptr_3 C.double
	_result := int32(C.gsl_spline_eval_deriv_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))
}