version 1.30, 2004/08/23 08:33:55 |
version 1.34, 2004/09/01 05:06:09 |
|
|
% $OpenXM: OpenXM/src/kan96xx/Kan/dr.sm1,v 1.29 2004/08/22 12:52:34 takayama Exp $ |
% $OpenXM: OpenXM/src/kan96xx/Kan/dr.sm1,v 1.33 2004/08/31 05:30:20 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 >> |
{ |
{ |
|
|
[ |
[ |
/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 4111 $ [ff ff] fromVectors :: $ |
|
Line 4147 $ [ff ff] fromVectors :: $ |
|
(It normalizes a given vector of Q into a vector of Z with relatively prime) |
(It normalizes a given vector of Q into a vector of Z with relatively prime) |
(entries by multiplying a postive number.) |
(entries by multiplying a postive number.) |
]] putUsages |
]] putUsages |
|
|
|
/getNode { |
|
/arg2 set |
|
/arg1 set |
|
[/in-getNode /ob /key /rr /rr /ii] pushVariables |
|
[ |
|
/ob arg1 def |
|
/key arg2 def |
|
/rr null def |
|
{ |
|
ob isClass { |
|
ob (array) dc /ob set |
|
} { exit } ifelse |
|
ob 0 get key eq { |
|
/rr ob def |
|
exit |
|
} { } ifelse |
|
ob 2 get /ob set |
|
0 1 ob length 1 sub { |
|
/ii set |
|
ob ii get key getNode /rr set |
|
rr tag 0 eq { } { exit } ifelse |
|
} for |
|
exit |
|
} loop |
|
/arg1 rr def |
|
] pop |
|
popVariables |
|
arg1 |
|
} def |
|
[(getNode) |
|
[(ob key getNode) |
|
(ob is a class object.) |
|
(The operator getNode returns the node with the key in ob.) |
|
(The node is an array of the format [key attr-list node-list]) |
|
(Example:) |
|
( /dog [(dog) [[(legs) 4] ] [ ]] [(class) (tree)] dc def) |
|
( /man [(man) [[(legs) 2] ] [ ]] [(class) (tree)] dc def) |
|
( /ma [(mammal) [ ] [man dog]] [(class) (tree)] dc def) |
|
( ma (dog) getNode ) |
|
]] putUsages |
|
|
|
|
/usages { |
/usages { |
/arg1 set |
/arg1 set |