=================================================================== RCS file: /home/cvs/OpenXM/src/ox_math/documents/math2ox.texi,v retrieving revision 1.1 retrieving revision 1.5 diff -u -p -r1.1 -r1.5 --- OpenXM/src/ox_math/documents/math2ox.texi 2000/03/08 06:59:37 1.1 +++ OpenXM/src/ox_math/documents/math2ox.texi 2000/03/14 14:25:27 1.5 @@ -1,4 +1,4 @@ -%% $OpenXM$ +%% $OpenXM: OpenXM/src/ox_math/documents/math2ox.texi,v 1.4 2000/03/14 05:46:09 ohara Exp $ \input texinfo @iftex @@ -38,6 +38,96 @@ * Sample Programs:: @end menu +@node Starting OX servers,,, Top + +@chapter Starting OX servers + +@node Starting OX servers on the localhost,,, Starting OX servers +@section Starting OX servers on the localhost + +@c Description of OxStart +@menu +* OxStart:: +@end menu +@node OxStart,,, +@subsection @code{OxStart} +@findex OxStart +@table @t +@item OxStart[@var{s}] +:: Start the OX server @code{s}. +@end table + +@table @var +@item return +Integer +@item s +String +@end table + +@itemize @bullet +@item It starts the OX server @code{s}. +@item Servers are looked for in the directory $OpenXM_HOME/bin, hoge hoge. +@end itemize + +@example +In[1]:= Install["math2ox"] +In[2]:= pid = OxStart["ox_sm1"] +@end example + +In this example, @code{ox_sm1} is started on the local machine. + + + + +@node Starting OX servers on a remote machine,,, Top +@section Starting OX servers on a remote machine + +In order to connect to remote OX servers, it is convenient, secure and +recommended to use @code{ssh} (Secure SHell). +The function @code{OxStartRemoteSSH} starts remote OX servers +by ssh. Of course, you are supposed to be able to login the remote +machine by @code{ssh} and @code{$Remote_OpenXM_HOME/rc/cshrc} or +@code{$Remote_OpenXM_HOME/rc/bashrc} are executed from the login shell +of your remote machine. +The function @code{OxStartRemoteSSH[]} does not request your password, +that is, you need to be using @code{ssh-agent} before calling +@code{OxStartRemoteSSH[]}. +Then there will be no check of password. + +@c Description of OxStartRemoteSSH +@menu +* OxStartRemoteSSH:: +@end menu +@node OxStartRemoteSSH,,, +@subsection @code{OxStartRemoteSSH} +@findex OxStartRemoteSSH +@table @t +@item OxStartRemoteSSH[@var{s}, @var{host}] +:: start the OX server @code{s} on the remote machine @code{host} by ssh. +@end table + +@table @var +@item return +Integer +@item s +String +@item host +String +@end table + +We note that the @code{OxStartRemoteSSH[]} is an experimental implementation. + +@itemize @bullet +@item It starts the OX server @code{s}. +@item Servers are looked for in the directory $OpenXM_HOME/bin, hoge hoge. +@end itemize + +@example +In[2]:= pid = OxStartRemoteSSH["ox_sm1", "remotehost"] +@end example + +In this example, @code{ox_sm1} is started on the remote machine @code{remotehost}. + @node Mathematica Client Functions,,, Top @chapter Mathematica Client Functions @@ -55,7 +145,7 @@ and communicates with Mathematica by MathLink. @section @code{OxStart} @findex OxStart @table @t -@item OxStart(@var{s}) +@item OxStart[@var{s}] :: Start the OX server @code{s}. @end table @@ -68,36 +158,291 @@ String @itemize @bullet @item It starts the OX server @code{s}. -@item Servers are looked for in the directory $OenXM_HOME/bin , hoge hoge. +@item Servers are looked for in the directory $OpenXM_HOME/bin, hoge hoge. @end itemize @example In[1]:= Install["math2ox"] -In[2] := Pid = OxStart["ox_sm1"] +In[2]:= pid = OxStart["ox_sm1"] @end example In this example, @code{ox_sm1} is started on the local machine. -@c Put descriptions of a next function. +@c Description of OxSendMessage +@menu +* OxSendMessage:: +@end menu +@node OxSendMessage,,, Mathematica Client Functions +@section @code{OxSendMessage} +@findex OxSendMessage +@table @t +@item OxSendMessage[@var{pid}, @var{s}] +:: send a message @code{s} to the OX server @code{pid}. +@end table +@table @var +@item return +Integer +@item pid +Integer +@item s +String +@end table +@example +In[4] := OxSendMessage[pid, "(CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO))"] +In[5] := OxSendMessage[pid, "(OX_COMMAND, (SM_popCMO))"] +@end example + +In this example, an OX data message +(OX_DATA, (CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO)) +and an OX command message (OX_COMMAND, (SM_popCMO)) are sent to +the OX server @code{pid}. + +@c Description of OxPopCMO +@menu +* OxPopCMO:: +@end menu +@node OxPopCMO,,, Mathematica Client Functions +@section @code{OxPopCMO} +@findex OxPopCMO +@table @t +@item OxPopCMO[@var{pid}] +:: pop an object on the top of the stack. +@end table + +@table @var +@item return +Manual +@item pid +Integer +@end table + +The @code{OxPopCMO[]} function pops an object on the top of the stack of +the OX stack machine @code{pid} and returns the object. +The return type of the function @code{OxPopCMO[]} is @code{Manual} in +terms of MathLink, that is, an object of suitable type is returned. + +@example +In[5] := cmo = OxPopCMO[pid] +@end example + +@c Description of OxPopString +@menu +* OxPopString:: +@end menu +@node OxPopString,,, Mathematica Client Functions +@section @code{OxPopString} +@findex OxPopString +@table @t +@item OxPopString[@var{pid}] +:: get a string from the OX server @code{pid}. +@end table + +@table @var +@item return +String +@item pid +Integer +@end table + +The @code{OxPopString[]} function pops an object on the top of the stack +of the OX stack machine @code{pid} and returns a string which is +translated from the object by the OX stack machine. + +@example +In[5] := string = OxPopString[pid] +@end example + +@c Description of OxClose +@menu +* OxClose:: +@end menu +@node OxClose,,, Mathematica Client Functions +@section @code{OxClose} +@findex OxClose +@table @t +@item OxClose[@var{pid}] +:: close the connection to the OX server @code{pid}. +@end table + +@table @var +@item return +none +@item pid +Integer +@end table + +The @code{OxClose[]} function closes the connection to the OX server +@code{pid}. + +@example +In[5] := OxClose[pid] +@end example + +@c Description of OxExecuteString +@menu +* OxExecuteString:: +@end menu +@node OxExecuteString,,, Mathematica Client Functions +@section @code{OxExecuteString} +@findex OxExecuteString +@table @t +@item OxExecuteString[@var{pid}, @var{command}] +:: execute @code{command} on the OX server @code{pid}. +@end table + +@table @var +@item return +none +@item pid +Integer +@item command +String +@end table + +The @code{OxExecuteString[]} function executes @code{command} on the OX server +@code{pid}. +The string @code{command} is interpreted in local language of the OX server. + +@example +In[5] := OxExecuteString["print(1+2);"] +@end example + +@c Description of OxGet +@menu +* OxGet:: +@end menu +@node OxGet,,, Mathematica Client Functions +@section @code{OxGet} +@findex OxGet +@table @t +@item OxGet[@var{pid}] +:: get an object from the connection to the OX server @code{pid}. +@end table + +@table @var +@item return +Manual +@item pid +Integer +@end table + +The @code{OxGet[]} function gets an object from the connection to the OX server +@code{pid}. + +@example +In[5] := cmo = OxGet[pid] +@end example + +@c Put descriptions of a next function. + @node Sample Programs,,, Top @chapter Sample Programs -@tex -\noindent -1. -{\tt OpenXM/lib/math/primadec.m} is a Mathematica program +@enumerate +@item +@code{OpenXM/lib/math/primadec.m} is a Mathematica program to make primary ideal decompositions by calling -{\tt ox\_asir}. +@code{ox_asir}. As to usages, see comments in this file. -\noindent 2. -{\tt OpenXM/lib/math/beta.m} is a Mathematica program -to get beta-nbc bases by calling {\tt ox\_asir}. -@end tex +@item +@code{OpenXM/lib/math/beta.m} is a Mathematica program +to get beta-nbc bases by calling @code{ox_asir}. +@end enumerate +@node Example,,, Top +@chapter Example +The @code{math2ox} has the following commands: + +@code{OxStart[s_String], +OxStartInsecure[s_String, p_Integer, q_Integer], +OxStartRemoteSSH[s_String, t_String], +OxExecuteString[s_String], OxSendMessage[s_String], OxGet[], OxPopCMO[], +OxPopString[], OxClose[], OxReset[]}. + +First, let us load the math2ox. +@example +In[1]:= <