@menu
* Functions and Variables for ggf::
@end menu

@node Functions and Variables for ggf,  , ggf, ggf
@section Functions and Variables for ggf

@defvr {Option variable} GGFINFINITY
Default value: 3

This is an option variable for function @code{ggf}.

When computing the continued fraction of the
generating function, a partial quotient having a degree
(strictly) greater than @var{GGFINFINITY} will be discarded and
the current convergent will be considered as the exact value
of the generating function; most often the degree of all
partial quotients will be 0 or 1; if you use a greater value,
then you should give enough terms in order to make the
computation accurate enough.


See also @code{ggf}.

@opencatbox
@category{Package ggf}
@closecatbox

@end defvr


@defvr {Option variable} GGFCFMAX
Default value: 3

This is an option variable for function @code{ggf}.

When computing the continued fraction of the
generating function, if no good result has been found (see
the @var{GGFINFINITY} flag) after having computed @var{GGFCFMAX} partial
quotients, the generating function will be considered as
not being a fraction of two polynomials and the function will
exit. Put freely a greater value for more complicated
generating functions.

See also @code{ggf}.

@opencatbox
@category{Package ggf}
@closecatbox

@end defvr

@deffn {Function} ggf (@var{l})
Compute the generating function (if it is a fraction of two
polynomials) of a sequence, its first terms being given. @var{l}
is a list of numbers.

The solution is returned as a fraction of two polynomials.
If no solution has been found, it returns with @code{done}.

This function is controlled by global variables @var{GGFINFINITY} and @var{GGFCFMAX}. See also @var{GGFINFINITY} and @var{GGFCFMAX}.

To use this function write first @code{load("ggf")}.

@opencatbox
@category{Generating functions} @category{Share packages} @category{Package ggf}
@closecatbox

@end deffn
