axiom-mail
[Top][All Lists]

Re: [Axiom-mail] New to Axiom: Implement 'Balanced' FiniteField ?

 From: Martin Rubey Subject: Re: [Axiom-mail] New to Axiom: Implement 'Balanced' FiniteField ? Date: Wed, 30 Mar 2005 12:13:12 +0200

```It will roughly work as follows:

)abbrev domain BAL Balanced
Balanced(n:PositiveInteger):Exports == Implementation where

Exports == with
coerce: PrimeField n -> \$
coerce: \$ -> OutputForm

--    coerce: \$ -> PrimeField n

Rep := Integer

coerce(a: PrimeField n):\$ == convert(a)@Integer - n
coerce(x:%):OutputForm == coerce(x)\$Rep

-------------------------------------------------------------------------------

If you need explanation, ask for it. (No time right now)

Martin

jim kraai writes:
> Greetings,
>
> (I'm more of a pencil-n-paper math guy.)
>
> A BalancedFiniteField representation of an integer n would be:
>   the same as FiniteField (base) if n <= floor(n/2)
>   else base - floor(n/2)
>
> Examples:
>
> base of 4     base of 5
> n  FF BFF     n  FF BFF
> ----------    ----------
> 0  0   0      0  0   0
> 1  1   1      1  1   1
> 2  2   2      2  2   2
> 3  3  -1      3  3  -2
> 4  0   0      4  0  -1
> 5  1   1      5  1   0
>               6  0   0
>
> After reading the book chapters on Packages, Categorys, and Domains, I find
> that I'm no more clear on which is an effective way to get this output.
>
> Thanks for any help,
>
> --jim
>
>
>
>
> __________________________________
> Do you Yahoo!?
> http://www.yahoo.com/r/hs
>
>
> _______________________________________________
> Axiom-mail mailing list