/* lib/setvariables.ccc : to generate sm1-package setvariables.sm1 */
/* sm1(" (incmac.sm1) run (slib.sm1) run ");
sm1(" (factor-a.sm1) run "); run does not work!! */
sm1(" 0 @@@.indexMode "); /* C-like notation of matrix. a[0], ... */
def getxvar(i) {
sm1( "[(x) (var) ", i , " ..int ] system_variable /FunctionValue set ");
}
def getdvar(i) {
sm1( "[(D) (var) ", i , " ..int ] system_variable /FunctionValue set ");
}
def getvarn() {
sm1( "[(N)] system_variable (universalNumber) dc /FunctionValue set ");
}
def setRingVariables() {
local n,i,v,f;
n = getvarn();
for (i=0; i<n; i++) {
v = getxvar(i);
f = Poly(v);
sm1( v ," (literal) dc ", f ," def ");
v = getdvar(i);
f = Poly(v);
sm1( v ," (literal) dc ", f ," def ");
}
}