up previous next
command for making a ring active
Use R
Use RingDefn
Use R ::= RingDefn
where R is a RING, and RingDefn is a ring definition.
|
This command works only at top-level; it makes a ring active,
i.e. it makes that ring the
current ring.
The command will also let you create a new ring, and make it active
immediately
Use NewR ::= RingDefn;
where
RingDefn
is
a ring definition; this is a shorthand for
NewR ::= RingDefn; Use NewR;
This command cannot be called inside a function, and it is never
necessary (if you write clean programs ;-)
In CoCoA-5 you can define new rings, return rings, assign rings and
pass rigns as arguments (this was not possible in CoCoA-4).
/**/ Use S ::= QQ[x,y,z];
/**/ Print CurrentRing;
RingDistrMPolyClean(QQ, 3)
/**/ indets(CurrentRing);
[x, y, z]
/**/ Use QQ[u]; -- can be used w/out a ring identifier
/**/ indets(CurrentRing);
[u]
/**/ Define SumInAnotherRing(N)
/**/ K := NewRingTwinFloat(128); -- 128 bits of precision
/**/ P ::= K[x[1..N]], Lex;
/**/ Return sum(indets(P));
/**/ EndDefine;
/**/ SumInAnotherRing(4);
x[1] +x[2] +x[3] +x[4]
/**/ CoeffRing(RingOf(It));
RingTwinFloat(AccuracyBits=128, BufferBits=128, NoiseBits=32)
|