=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Doc/ox.sm1,v retrieving revision 1.32 retrieving revision 1.39 diff -u -p -r1.32 -r1.39 --- OpenXM/src/kan96xx/Doc/ox.sm1 2004/02/24 00:45:33 1.32 +++ OpenXM/src/kan96xx/Doc/ox.sm1 2004/03/08 08:24:42 1.39 @@ -1,4 +1,4 @@ -%%%%%%%%%%% $OpenXM: OpenXM/src/kan96xx/Doc/ox.sm1,v 1.31 2004/02/05 03:04:40 takayama Exp $ +%%%%%%%%%%% $OpenXM: OpenXM/src/kan96xx/Doc/ox.sm1,v 1.38 2004/03/04 05:18:26 takayama Exp $ /ox.sm1.myname (ox-new.sm1) def @@ -15,7 +15,7 @@ [(getenv) (OXSTART100)] extension tag 0 eq not { /oxstart100 [(getenv) (OXSTART100)] extension def } { } ifelse -oxstart100 message +oxstart100 message-quiet /ox.sm1.loaded 1 def /oxasir.sm1.loaded 1 def @@ -76,6 +76,9 @@ ox.version [(Version)] system_variable gt /SM_getsp 275 def /SM_dupErrors 276 def +/SM_pushCMOtag 277 def +/SM_executeFunctionWithOptionalArgument 282 def + /SM_control_kill 1024 def /SM_control_reset_connection 1030 def /SM_control_spawn_server 1027 def @@ -88,6 +91,7 @@ ox.version [(Version)] system_variable gt (Example: oxsm1.ccc [1 2 3] oxpushcmo oxsm1.ccc oxpopcmo /ff set ff :: ) ( ) (client ss oxexecutestring(oxsubmit) <>, client ss oxexec <>) + (client ss oxexecWithOpt ) (Example: oxsm1.ccc (0 1 10 { pop $Hello$ message } for) oxexecutestring ) (Example: oxsm1.ccc (2).. oxpushcmo oxsm1.ccc (10).. oxpushcmo ) @@ -96,6 +100,7 @@ ox.version [(Version)] system_variable gt (client str oxevalname, client str oxsetname, client num oxpops, client oxget) ( ) (client oxmathcap, client oxsetmathcap, oxgenportfile, oxremoveportfile) + (client oxpushcmotag) ( ) (client oxgetsp --- get stack pointer, client oxgeterrors --- get all errors) (cleint oxisData, client oxreset, client oxshutdown) @@ -146,6 +151,11 @@ ox.verbose { oxhelp } { } ifelse [(oxReq) arg2 SM_DUMMY_sendcmo arg1] extension pop } def +/oxpushcmotag { + /arg2 set + [(oxReq) arg2 SM_pushCMOtag ] extension pop +} def + /oxpopcmo { /arg1 set [(oxReq) arg1 SM_popCMO ] extension pop @@ -251,6 +261,23 @@ ox.verbose { oxhelp } { } ifelse } { } ifelse [(oxReq) arg2 SM_executeFunction arg1] extension pop } def +/oxexecWithOpt { + /arg1 set + /arg2 set + ox.takelog { ox.log [(oxSerial)] extension ox.mod arg1 put + ox.log [(oxSerial)] extension 1 add ox.mod + (executeFunctionWithOptionalArgument) put + } { } ifelse + [(oxReq) arg2 SM_executeFunctionWithOptionalArgument arg1] extension pop +} def +[(oxexecWithOpt) + [ + $Example: $ + $oxsm1.ccc (/foo { message message message } def) oxsubmit ;$ + $oxsm1.ccc (hello) oxpushcmo oxsm1.ccc 1 oxpushcmo oxsm1.ccc [[(opt) 0]] oxpushcmo ;$ + $oxsm1.ccc (foo) oxexecWithOpt $ + ] +] putUsages /oxsubmit2 { oxexec } def @@ -487,7 +514,7 @@ ox.verbose { oxhelp } { } ifelse [(oxCreateControl_RFC_101) peer 0 pass] extension /oxsm1.ccc set %% 0 means connect from only localhost. /ox.ccc oxsm1.ccc def - (The server is binded to the variable oxsm1.ccc) message + (The server is binded to the variable oxsm1.ccc) message-quiet oxsm1.ccc ] pop popVariables @@ -505,7 +532,7 @@ ox.verbose { oxhelp } { } ifelse oxsm1.ccc oxpopcmo /engineID set [(oxCreateEngine_RFC_101) peer 0 (Empty) engineID] extension /ox.ddd set - (The engine is binded to the variables ox.ddd) message + (The engine is binded to the variables ox.ddd) message-quiet ] pop popVariables arg1 @@ -639,16 +666,17 @@ ox.verbose { oxhelp } { } ifelse /peer [(oxGetPort) (localhost)] extension def /data peer 1 get toString def /control peer 3 get toString def - peer message + peer message-quiet [ oxstart100 + @@@.quiet { ( -quiet ) } { } ifelse Xm_noX { ( -nox ) } { } ifelse ( -oxserver bin/ox_sm1 -e ) ( -reverse ) ( -data ) data ( -control ) control ( -pass ) pass ( )] cat execve [(oxCreateClient2) peer 0 pass] extension /oxsm1.ccc set %% 0 means connect from only localhost. - (The server is binded to the variable oxsm1.ccc) message + (The server is binded to the variable oxsm1.ccc) message-quiet /ox.ccc oxsm1.ccc def oxsm1.ccc.init oxsm1.ccc @@ -679,7 +707,7 @@ ox.verbose { oxhelp } { } ifelse /peer [(oxGetPort) myhostname-ssh] extension def /data peer 1 get toString def /control peer 3 get toString def - peer message + peer message-quiet [(ssh -f ) machine ( -l ) name ( ") oxpath.oxlog.xterm-ssh oxpath.ox-ssh ( -reverse -ox ) oxpath.oxsm1-ssh ( -host ) myhostname-ssh @@ -733,7 +761,7 @@ ox.verbose { oxhelp } { } ifelse /peer [(oxGetPort) (localhost)] extension def /data peer 1 get toString def /control peer 3 get toString def - peer message + peer message-quiet [ oxstart100 Xm_noX { ( -nox ) } { } ifelse @@ -742,7 +770,7 @@ ox.verbose { oxhelp } { } ifelse ( )] cat execve [(oxCreateClient2) peer 0 pass] extension /oxntl.ccc set %% 0 means connect from only localhost. - (The server is binded to the variable oxntl.ccc) message + (The server is binded to the variable oxntl.ccc) message-quiet % oxntl.ccc.init oxntl.ccc ] pop @@ -841,10 +869,11 @@ oxasir.verbose { (If you interrupted the computation by typing ctrl-C, type in ) ( oxasir.ccc oxreset ; ) (to interrupt the ox_asir server.) + (NOTE: all asir-args must belong to the same ring. cf.oxasir.changeRing. ) (Example: oxasir.ccc [(fctr) (x^10-1).] asir ) ( ) (This function requires plugins cmo, socket and ox_asir server. cf. oxasir) - (See, ftp://endeavor.fujitsu.co.jp/pub/isis/asir on asir) + (See, http://www.math.kobe-u.ac.jp/Asir on asir) ] ] putUsages @@ -893,16 +922,27 @@ oxasir.verbose { %%% Mathematical functions for asir %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /oxasir.changeRing { + /oxasir.changeRing.rr.prev 0 def + oxasir.changeRing2 +} def +/oxasir.changeRing2 { /arg1 set - [/in-oxasir.changeRing /f /rr] pushVariables + [/in-oxasir.changeRing2 /f /rr ] pushVariables [ /f arg1 def f isArray { - f {oxasir.changeRing} map + f {oxasir.changeRing2} map }{ f isPolynomial { f (0). eq { } - { f (ring) dc /rr set [(CurrentRingp) rr] system_variable } ifelse + { f (ring) dc /rr set [(CurrentRingp) rr] system_variable + oxasir.changeRing.rr.prev tag 1 eq { } + { + oxasir.changeRing.rr.prev rr eq { } + { (asir : arguments must belong to the same ring.) error } ifelse + } ifelse + /oxasir.changeRing.rr.prev rr def + } ifelse } { } ifelse } ifelse ] pop @@ -1407,7 +1447,7 @@ oxasir.verbose { f { toString . } map /f set vvv { . } map /vvv set ddd { . } map /ddd set - /wt wt generic_bfct.aux1 def + /wt [vvv ddd wt] generic_bfct.aux1 def } ifelse [f vvv ddd wt] message @@ -1428,16 +1468,24 @@ oxasir.verbose { /generic_bfct.aux1 { /arg1 set - [/in-generic_bfct.aux1 /wt /wtx /wtd /n] pushVariables + [/in-generic_bfct.aux1 /ii /jj /wt /wtx /wtd /vv /dd /n] pushVariables [ - arg1 /wt set - /n [(N)] system_variable def - wt { dup tag PolyP eq { toString } { } ifelse } map /wt set - wt weightv /wt set - /wtx wt n carN rest reverse rest reverse def - /wtd wt reverse n carN reverse - rest reverse rest reverse def - wtx wtd join /wt set + arg1 2 get /wt set + arg1 0 get /vv set + arg1 1 get /dd set + /wtx [ 0 1 vv length 1 sub { pop (0).. } for ] def + /n wt length def + 0 2 n 1 sub { + /ii set + 0 1 vv length 1 sub { + /jj set + wt ii get toString dd jj get toString eq { + wtx jj << wt ii 1 add get >> put + } { } ifelse + } for + } for + + wtx /wt set wt { dup tag IntegerP eq { (universalNumber) dc } { } ifelse } map /wt set wt /arg1 set ] pop @@ -1480,7 +1528,7 @@ oxasir.verbose { [wvec] weight_vector 0] define_ring - ff { . dehomogenize homogenize } map /ff set + ff { toString . dehomogenize homogenize } map /ff set vvx { . } map /vvx set %%ex [x,y] vvd { . } map /vvd set %%ex [Dx,Dy] vvx vvd join [(h).] join /avv set @@ -1531,9 +1579,10 @@ oxasir.verbose { /peer [(oxGetPort) (localhost)] extension def /data peer 1 get toString def /control peer 3 get toString def - peer message + peer message-quiet [ oxstart100 + @@@.quiet { ( -quiet ) } { } ifelse Xm_noX { ( -nox ) } { } ifelse ( -oxserver bin/ox_asir -e ) ( -reverse ) ( -data ) data ( -control ) control ( -pass ) pass @@ -1577,7 +1626,7 @@ oxasir.verbose { /peer [(oxGetPort) (localhost)] extension def /data peer 1 get toString def /control peer 3 get toString def - peer message + peer message-quiet [ oxstart100 Xm_noX { ( -nox ) } { } ifelse @@ -1586,7 +1635,7 @@ oxasir.verbose { ( )] cat execve [(oxCreateClient2) peer 0 pass] extension /oxk0.ccc set %% 0 means connect from only localhost. - (The server is binded to the variable oxk0.ccc) message + (The server is binded to the variable oxk0.ccc) message-quiet ox.k0.init /arg1 oxk0.ccc def ] pop @@ -1595,3 +1644,7 @@ oxasir.verbose { } def /@@@polymake.k0.ccc [ ] def +/ox_server_mode { + /:: { } def % do nothing + +} def \ No newline at end of file