GOffice.CSpline¶
Fields¶
Name  Type  Access  Description 

a  float 
r/w  
b  float 
r/w  
c  float 
r/w  
n  int 
r/w  
ref_count  int 
r/w  
x  float 
r/w  
y  float 
r/w 
Methods¶
class  destroyl (sp) 
class  init (x, y, n, limits, c0, cn) 
destroy () 

get_deriv (x) 

get_derivs (x, n) 

get_integrals (x, n) 

get_value (x) 

get_values (x, n) 
Details¶

class
GOffice.
CSpline
¶ 
classmethod
destroyl
(sp)¶ Parameters: sp ( GOffice.CSplinel
) –

classmethod
init
(x, y, n, limits, c0, cn)¶ Parameters:  x (
float
) – the x values  y (
float
) – the y values  n (
int
) – the number of x and y values  limits (
int
) – how the limits must be treated, four values are allowed:GOffice.CSplineType.NATURAL
: first and least second derivatives are 0.GOffice.CSplineType.PARABOLIC
: the curve will be a parabole arc outside of the limits.GOffice.CSplineType.CUBIC
: the curve will be cubic outside of the limits.GOffice.CSplineType.CLAMPED
: the first and last derivatives are imposed.  c0 (
float
) – the first derivative when using clamped splines, not used in the other limit types.  cn (
float
) – the first derivative when using clamped splines, not used in the other limit types.
Returns: a newly created
GOffice.CSpline
instance which should be destroyed by a call toGOffice.CSpline.destroy
.Return type: Creates a spline structure, and computes the coefficients associated with the polynoms. The ith polynome (between x[i1] and x[i] is: y(x) = y[i1] + (c[i1] + (b[i1] + a[i] * (x  x[i1])) * (x  x[i1])) * (x  x[i1]) where a[i1], b[i1], c[i1], x[i1] and y[i1] are the corresponding members of the new structure.
 x (

destroy
()¶ Frees the spline structure when done.

get_deriv
(x)¶ Parameters: x ( float
) – theGOffice.value
Returns: the interpolated derivative at x, or 0 if an error occurred. Return type: float
sp must be a valid spline structure as returned by
GOffice.CSpline.init
.

get_derivs
(x, n)¶ Parameters: Returns: a newly allocated array of the n interpolated derivatives which should be destroyed by a call to
GLib.free
when not anymore needed, orNone
if an error occurred.Return type: sp must be a valid spline structure as returned by
GOffice.CSpline.init
. The x values must be sorted in increasing order.

get_integrals
(x, n)¶ Parameters: Returns: a newly allocated array of the n1 integrals on the intervals between two consecutive values stored in x. which should be destroyed by a call to
GLib.free
when not anymore needed, orNone
if an error occurred.Return type: sp must be a valid spline structure as returned by
GOffice.CSpline.init
. The x values must be sorted in increasing order.

get_value
(x)¶ Parameters: x ( float
) – TheGOffice.value
Returns: the interpolated GOffice.value
for x, or 0 if an error occurred.Return type: float
sp must be a valid spline structure as returned by
GOffice.CSpline.init
.

get_values
(x, n)¶ Parameters: Returns: a newly allocated array of interpolated values which should be destroyed by a call to
GLib.free
when not anymore needed, orNone
if an error occurred.Return type: sp must be a valid spline structure as returned by
GOffice.CSpline.init
. The x values must be sorted in increasing order.

classmethod