version 1.31, 2004/08/27 08:33:27 |
version 1.36, 2004/09/09 11:42:22 |
|
|
% $OpenXM: OpenXM/src/kan96xx/Kan/dr.sm1,v 1.30 2004/08/23 08:33:55 takayama Exp $ |
% $OpenXM: OpenXM/src/kan96xx/Kan/dr.sm1,v 1.35 2004/09/09 03:14:46 takayama Exp $ |
%% dr.sm1 (Define Ring) 1994/9/25, 26 |
%% dr.sm1 (Define Ring) 1994/9/25, 26 |
%% This file is error clean. |
%% This file is error clean. |
|
|
|
|
[ |
[ |
/mat arg1 def |
/mat arg1 def |
/m mat length def |
/m mat length def |
|
{ |
|
m 0 eq { /ans [ ] def exit } { } ifelse |
mat 0 get isArray |
mat 0 get isArray |
{ } |
{ } |
{ (transpose: Argument must be an array of arrays.) error } |
{ (transpose: Argument must be an array of arrays.) error } |
|
|
ans [ j i ] << mat i get j get >> put |
ans [ j i ] << mat i get j get >> put |
} for |
} for |
} for |
} for |
|
exit |
|
} loop |
/arg1 ans def |
/arg1 ans def |
] pop |
] pop |
popVariables |
popVariables |
|
|
/univ vars 0 get reverse |
/univ vars 0 get reverse |
vars 1 get reverse join |
vars 1 get reverse join |
def |
def |
|
w-vectors to_int32 /w-vectors set |
[ |
[ |
0 1 << w-vectors length 1 sub >> |
0 1 << w-vectors length 1 sub >> |
{ |
{ |
|
|
/arg2 set /arg1 set |
/arg2 set /arg1 set |
[/univ /www /k /vname /vweight /ans] pushVariables |
[/univ /www /k /vname /vweight /ans] pushVariables |
/univ arg1 def /www arg2 def |
/univ arg1 def /www arg2 def |
[ |
[ |
|
www to_int32 /www set |
/ans << univ length >> -1 0 evecw def |
/ans << univ length >> -1 0 evecw def |
0 2 << www length 2 sub >> |
0 2 << www length 2 sub >> |
{ |
{ |
|
|
} def |
} def |
%%end of function |
%%end of function |
|
|
/rest { % returns remainder of a given list |
/rest { |
[ 2 1 roll aload length -1 roll pop ] |
/arg1 set [(Krest) arg1] extension |
} def |
} def |
[(rest) |
[(rest) |
[(array rest the-rest-of-the-array) |
[(array rest the-rest-of-the-array) |
|
|
[ |
[ |
/fff arg1 def |
/fff arg1 def |
/www arg2 def |
/www arg2 def |
|
www to_int32 /www set |
fff (0). eq { /ddd -intInfinity def /ord_w.LLL goto} { } ifelse |
fff (0). eq { /ddd -intInfinity def /ord_w.LLL goto} { } ifelse |
fff (ring) dc /rrr set |
fff (ring) dc /rrr set |
fff init /fff set |
fff init /fff set |
|
|
[ |
[ |
/fff arg1 def |
/fff arg1 def |
/www arg2 def |
/www arg2 def |
|
www to_int32 /www set |
fff (0). eq { /ddd -intInfinity def /ord_w_all.LLL goto} { } ifelse |
fff (0). eq { /ddd -intInfinity def /ord_w_all.LLL goto} { } ifelse |
/ddd -intInfinity def |
/ddd -intInfinity def |
fff (ring) dc /rrr set |
fff (ring) dc /rrr set |
Line 3657 $ [ff ff] fromVectors :: $ |
|
Line 3665 $ [ff ff] fromVectors :: $ |
|
( ff to_int { tag } map :: ) |
( ff to_int { tag } map :: ) |
]] putUsages |
]] putUsages |
|
|
|
/to_int32 { |
|
/arg1 set |
|
[/to-int32 /ob /ans] pushVariables |
|
[ |
|
/ob arg1 def |
|
/ans ob def |
|
ob isArray { |
|
ob {to_int32} map /ans set |
|
/LLL.to_int32 goto |
|
} { } ifelse |
|
ob isUniversalNumber { |
|
ob (integer) dc /ans set |
|
/LLL.to_int32 goto |
|
} { } ifelse |
|
/LLL.to_int32 |
|
/arg1 ans def |
|
] pop |
|
popVariables |
|
arg1 |
|
} def |
|
[(to_int32) |
|
[(obj to_int32 obj2) |
|
$All universalNumber in obj are changed to integer (int32).$ |
|
(Example: /ff [1 (2).. [(hello) (0).]] def ff { tag } map ::) |
|
( ff to_int32 { tag } map :: ) |
|
(cf. to_int, to_univNum ) |
|
]] putUsages |
|
|
/define_ring_variables { |
/define_ring_variables { |
[/in-define_ring_variables /drv._v /drv._p /drv._v0] pushVariables |
[/in-define_ring_variables /drv._v /drv._p /drv._v0] pushVariables |
%% You cannot use these names for names for polynomials. |
%% You cannot use these names for names for polynomials. |
Line 3877 $ [ff ff] fromVectors :: $ |
|
Line 3913 $ [ff ff] fromVectors :: $ |
|
[(to_univNum) |
[(to_univNum) |
[(obj to_univNum obj2) |
[(obj to_univNum obj2) |
(Example. [ 2 (3).. ] to_univNum) |
(Example. [ 2 (3).. ] to_univNum) |
(cf. to_int) |
$cf. to_int32. (to_int)$ |
]] putUsages |
]] putUsages |
|
|
[(lcm) |
[(lcm) |
Line 4153 $ [ff ff] fromVectors :: $ |
|
Line 4189 $ [ff ff] fromVectors :: $ |
|
( ma (dog) getNode ) |
( ma (dog) getNode ) |
]] putUsages |
]] putUsages |
|
|
|
/cons { |
|
/arg2 set /arg1 set |
|
[/aa /bb] pushVariables |
|
[ |
|
/aa arg1 def /bb arg2 def |
|
[aa] (list) dc bb join /arg1 set |
|
] pop |
|
popVariables |
|
arg1 |
|
} def |
|
[(cons) |
|
[(obj list cons list) |
|
]] putUsages |
|
|
/usages { |
/usages { |
/arg1 set |
/arg1 set |