|
D.2.6.3 changevar
Procedure from library ring.lib (see ring_lib).
- Usage:
changevar(newr,vars[,r]); newr,vars=strings, r=ring/qring
- Create:
creates a new ring with name ‘newr‘ and makes it the basering if r
is an existing ring/qring [default: r=basering].
The new ring differs from the old ring only in the variables. If,
say, (newr,vars) = ("R","t()") and the ring r exists and has n
variables, the new basering will have name R and variables
t(1),...,t(n).
If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
- Return:
No return value
- Note:
This procedure is useful in connection with the procedure ringtensor,
when a conflict between variable names must be avoided.
This proc uses ’execute’ or calls a procedure using ’execute’.
If you use it in your own proc, let the local names of your proc
start with @.
Example:
| LIB "ring.lib";
ring r=0,(x,y,u,v),(dp(2),ds);
ideal i = x^2,y^2-u^3,v;
qring Q = std(i);
setring(r);
changevar("R","A()"); R; "";
→ // basering is now R
→ // characteristic : 0
→ // number of vars : 4
→ // block 1 : ordering dp
→ // : names A(1) A(2)
→ // block 2 : ordering ds
→ // : names A(3) A(4)
→ // block 3 : ordering C
→
changevar("Q'","a,b,c,d",Q); Q';
→ // basering is now Q'
→ // characteristic : 0
→ // number of vars : 4
→ // block 1 : ordering dp
→ // : names a b
→ // block 2 : ordering ds
→ // : names c d
→ // block 3 : ordering C
→ // quotient ring from ideal
→ _[1]=d
→ _[2]=a2
→ _[3]=b2-c3
kill R,Q,Q';
if(system("with","Namespaces")) {
if( nameof(Current) == "Ring" ) {
kill Top::R,Top::Q';
} else {
kill Ring::R,Ring::Q';
}
}
|
|