rational functions

Ricardo Guzman rguzman at iconstructs.com
Mon Feb 12 22:49:42 CET 2001


Thanks-

    So you use the 'lst' data structure to maintain this paired
representation?

Ricardo

----- Original Message -----
From: "Christian Bauer" <cbauer at student.physik.uni-mainz.de>
To: <ginac-list at thep.physik.uni-mainz.de>
Sent: Monday, February 12, 2001 4:17 PM
Subject: Re: rational functions


> Hi!
>
> On Mon, Feb 12, 2001 at 04:02:38PM -0500, Ricardo Guzman wrote:
> >     How does ginac handle rational expressions internally? I see how
> > polynomials in general are represented through the 'expairseq'
framework.
>
> expairseq can store negative powers of expressions as well: 1/x = x^(-1)
>
> > But, how does it manipulate a quotient of two polynomials in the case of
gcd
> > calculations or when querying for numerator/denominator?
>
> normal(), numer() and denom() internally split each (sub-)expression into
> a {numerator,denominator} pair. For example, normal() performs:
>
>   1/x+2 -> {1,x}+{2,1} -> {1+2x,x} -> (1+2x)/x (= (1+x^2)*x^(-1))
>
> But this internal paired representation is not visible to the user.
>
> Bye,
> Christian
>
> --
>   / Coding on PowerPC and proud of it
> \/ http://www.uni-mainz.de/~bauec002/
> -
> To UNSUBSCRIBE, email to ginac-list at ginac.de with a subject of
"unsubscribe".

-
To UNSUBSCRIBE, email to ginac-list at ginac.de with a subject of "unsubscribe".



More information about the GiNaC-list mailing list