On Mon, Feb 27, 2012 at 09:10:45PM +0400, Serge D. Mechveliani wrote: > On Mon, Feb 27, 2012 at 12:15:08PM +0100, Ralf Hemmecke wrote: > >> 2. Canonic fraction > >> ------------------- > > > >> For a mutually prime n, d : (D : IntegralDomain), > >> how to set fraction of n/d in Spad with avoiding gcd and also > >> obtaining a correct fraction? > > [..]
> [..] > This is why I suggest for an Axiom (FriCAS) library to provide > package ... (D : IntegralDomain) > ... > fraction(m : FooMode, num : D, den : D) : Fraction D == ... > > in which m may be MtPrime or Generic > (may be, to provide the second format for `fraction', with skipped `m'). > > MtPrime means that num and den are mutually prime, > that is Ideal(num) + Ideal(den) = (1). Error!! I am sorry, x and y have not any non-trivial common divisor in Z[x,y] but Ideal(x) + Ideal(y) /= (1). I think now that MtPrime must mean: D : UniqueFactorizationRing and num : D, den : D have not any non-trivial common divisor. With all the rest, my sugestion remains ... I think (remove the words about "sum of ideals" in another place). Another note: once a fraction over a GcdRing is input, in most cases it is subjected to many further arithmetics, most of which will still require finding gcd. This considerably reduces the need of my suggestion for `fraction-with-mode'. Anyway, here is the example: in my DParse.zip on the Web, using `pretend' for Fraction Int saves 1/15 of the time for parsing of f :: UP(x, Fraction INT) (test2Fr) (this is curious, because 0 < num, den < 9 in the coefficients). Note aside: also I worked trustfully with replacing recursive calls with loops -- and this has slowed the example back on 1/15 ! Regards, ------ Sergei [email protected] -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/fricas-devel?hl=en.
