Annotation of OpenXM/src/ox_math/documents/math2ox.tex, Revision 1.4
1.1 ohara 1: %#!platex
1.4 ! ohara 2: %% $OpenXM: OpenXM/src/ox_math/documents/math2ox.tex,v 1.3 2000/01/21 09:55:21 takayama Exp $
1.1 ohara 3:
4: \documentclass{article}
5: \title{Mathematica Client for Open XM}
6: \date{January 20, 2000}
7: \author{Katsuyoshi Ohara}
8:
9: \begin{document}
10: \maketitle
11:
12: \section{Mathematica Client}
13:
1.4 ! ohara 14: The program {\tt math2ox} is an external module for Mathematica
! 15: to call OpenXM servers.
! 16: The {\tt math2ox} communicates with OpenXM servers by the OpenXM protocol
! 17: and communicates with Mathematica by MathLink.
1.1 ohara 18:
19: The {\tt math2ox} has the following commands:\\
1.2 ohara 20: {\tt OxStart[s\_String],
21: OxStartInsecure[s\_String, p\_Integer, q\_Integer],
22: OxStartRemoteSSH[s\_String, t\_String],
1.4 ! ohara 23: OxExecuteString[s\_String], OxSendMessage[s\_String], OxGet[], OxPopCMO[],
1.1 ohara 24: OxPopString[], OxClose[], OxReset[]}.
25:
26: First, let us load the math2ox.
27: \begin{verbatim}
28: In[1]:= Install["math2ox"]
29: \end{verbatim}
30:
31: Second, let us open a connection with an OX server.
32: For example, if we want to call the ox\_sm1 (the kan/sm1 server), then
33: \begin{verbatim}
1.4 ! ohara 34: In[2] := oxid = OxStart["ox_sm1"]
1.1 ohara 35: \end{verbatim}
36: where we have the connection of reverse mode. The OxStart function
37: automatically invoke ox\_sm1 on the local machine. If you need to
38: connect an OX server on a remote machine, then you can use reverse mode.
39: \begin{verbatim}
1.4 ! ohara 40: In[2] := oxid = OxStartInsecure["water.s.kanazawa-u.ac.jp", 1300, 1400]
1.1 ohara 41: \end{verbatim}
42: The mode is not secured but you can crypt data stream by using ssh
43: (Secure SHell).
44: \begin{verbatim}
1.2 ohara 45: In[3] := Run["ssh -f water ox -insecure -ox ox_sm1 -host water"]
1.1 ohara 46: \end{verbatim}
47:
48: Third, let us send an OX message to the OX server.
49: We can send an OX message written in OX/CMO expressions.
50: \begin{verbatim}
1.4 ! ohara 51: In[4] := OxSendMessage["(CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO))"]
! 52: In[5] := OxSendMessage["(OX_COMMAND, (SM_popCMO))"]
1.1 ohara 53: \end{verbatim}
1.4 ! ohara 54: If the expression conains syntax errors, then nothing is sent.
1.1 ohara 55:
1.4 ! ohara 56: Remarks: if SM\_popCMO is sent by the {\tt OxSendMessage[]} function, then the
1.1 ohara 57: OX stack machine returns the top of the stack to the {\tt math2ox}.
58: Then, in order to receive the message, we need to call the {\tt OxGet[]}
1.4 ! ohara 59: function always after executing {\tt OxSendMessage[]}
1.1 ohara 60: \begin{verbatim}
1.2 ohara 61: In[6] := OxGet[]
1.1 ohara 62: \end{verbatim}
63:
1.4 ! ohara 64: If we do not use the {\tt OxSendMessage} function and use the {\tt OxPopCMO[]}
1.1 ohara 65: function, then we do not need to call the {\tt OxGet[]}.
66: \begin{verbatim}
1.2 ohara 67: In[5] := OxPopCMO[]
1.1 ohara 68: \end{verbatim}
69:
70: Fourth, if we send a command expressed in the local language of the OX
71: server, then we need to call the {\tt OxExecuteString[]} function.
72:
73: Last, let us close the connection.
74: \begin{verbatim}
75: In[7] := OxClose[]
76: \end{verbatim}
1.3 takayama 77:
78: \section{Examples}
79:
80: \begin{enumerate}
81: \item
82: {\tt OpenXM/lib/math/primadec.m} is a Mathematica program
83: to make primary ideal decompositions by calling
84: {\tt ox\_asir}.
85: As to usages, see comments in this file.
86: \item
87: {\tt OpenXM/lib/math/beta.m} is a Mathematica program
88: to get beta-nbc bases by calling {\tt ox\_asir}.
89: \end{enumerate}
90:
91:
1.1 ohara 92:
93: \appendix
94:
95: \begin{thebibliography}{99}
96: \bibitem{Openxxx-1998}
97: M. Noro, N. Takayama:
98: Design and Implementation of OpenXM, 1996, 1997, 1998, 1999, 2000.
99: \bibitem{openxm-web}
100: {\footnotesize {\tt http://www.math.kobe-u.ac.jp/OpenXM/}}
101: \bibitem{Ohara-Takayama-Noro-1999}
102: M. Noro, K. Ohara, N. Takayama:
103: {Introduction to Open Asir}, 1999, Suusiki Shori, Vol 7, No 2,
104: 2--17. (ISBN4-87243-086-7, SEG Publishing, Tokyo). (in Japanese)
105: \bibitem{Wolfram-1996}
106: Stephen Wolfram:
107: {The Mathematica Book}, Third edition,
108: Wolfram Media/Cambridge University Press, 1996.
109:
110: \bibitem{miyachi-1998}
111: T. Miyachi:
112: {Mathematica Network Programming},
113: Iwanami Book Co., 1998. (in Japanese)
114: \end{thebibliography}
115:
116: \end{document}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>