Feature #1644
Allow user to choose whether to print finite field elems as symm residues or non-neg residue
Description
A student here asked how to make CoCoA-5 print elements of a finite field as the least non-neg residue class representative.
CoCoALib allows this, but CoCoA-5 does not.
History
#1 Updated by John Abbott over 2 years ago
JAA thinks that allowing the user to choose should not cause any problems: it is just a matter of printing.
Mmm, well, what should AsINT
produce?
#2 Updated by John Abbott over 2 years ago
The current impl in SmallFpImpl.H
expects there to be a boolean data mem which says how to print (LeastNonNeg
or Symm
).
The choice is fixed at creation time of the ring. The flag affects only the mem fn myExport
.
Do we want to allow a global variable which is consulted each time a value is exported?
Maybe we need a 3-way flag: LeastNonNeg, Symm, UseGlobalSetting
?
SOURCE: Consult source code in SmallFpImpl.H
#3 Updated by John Abbott over 2 years ago
I have just given a demo to my students of using CRT to reconstruct a large integer value.
The demo happened to work well because AsINT
returns "symmetric" representatives when
applied to elements of a finite field. Naturally, it did not work do well when I used the
prime 2. Technically this is my fault (since I should have checked what AsINT
does).
Maybe there should be 2 fns instead of (or as well as?) AsINT
for elements of a finite field.
For instance: SymmRepr
and LeastNonNegRepr
.
#4 Updated by John Abbott over 2 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
Anna suggests these names: AsINT_Symm
and AsINT_NonNeg
(because AsINT_LeastNonNeg
is too long)
The idea is to have a name "similar" to AsINT
.
UPDATE AsINT_symm
and AsINT_NonNeg
would give error if applied to an element of a ring of char 0... right?
#5 Updated by John Abbott about 2 years ago
AsINT_symm
orAsINT_Symm
AsINT_NonNeg
orAsINT_nonneg
orAsINT_nneg
Other suggestions?
#6 Updated by John Abbott about 2 years ago
- Target version changed from CoCoA-5.4.0 to CoCoA-5.4.2