Mark,
a few years ago I did some similar implementations (householder operations for
use to computenumeric Groebner bases) and solved the problems your raised in
the style how Ralf suggested it. I did not yet put my code into the system, but
we could share our codes and insights, if you want.
Here a typical code:
signValue(r: R): R ==
-- todo: make appropriate categories for R
R has (sign: R -> R) => sign(r)$R
zero? r => r
-- hack, c.f. complex numbers
R has (sqrt: R -> R) =>
if sqrt(r*r) = r then 1 else -1
1
Am 13.03.2012 um 08:25 schrieb Ralf Hemmecke:
>> Well, sign for AlgebraicNumber is less defined than for complex
>> numbers:
>
> Mark,
>
> In fact, the only reason why you need AlgebraicNumber is probably because of
> the use of the length function to get the length of the vector and that the
> length function is only implemented if the R in Vector(R) has RadicalCategory.
>
> I don't, however, see any reason to use Float anywhere in your code. You
> basically use it only for implementing the sign function.
> Better would perhaps be to require that R already exports a function
>
> sign; % -> Integer
>
> that would also remove the headache made by Waldek above. Or better said, it
> moves it from your package to the respective field you are working in. If the
> field has no idea what a sign is, then it's anyway hard to introduce one in
> your package.
>
> BTW, is there any reason that you require just R: Ring and not immediately R:
> Field in the argument type of TestPackage? Or even Join(Field,OrderedRing)?
>
> Ralf
>
> --
> 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.
>
Mit freundlichen Grüßen
Johannes Grabmeier
Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-171-5503789
Tel. +49-(0)-991-3615-100 (d), Fax: +49-(0)-1803-5518-17745
--
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.