Annotation of OpenXM/src/ox_math/documents/math2ox.texi, Revision 1.5
1.5 ! ohara 1: %% $OpenXM: OpenXM/src/ox_math/documents/math2ox.texi,v 1.4 2000/03/14 05:46:09 ohara Exp $
1.1 ohara 2:
3: \input texinfo
4: @iftex
5: @catcode`@#=6
6: @def@b#1{{@bf@gt #1}}
7: @catcode`@#=@other
8: @end iftex
9: @overfullrule=0pt
10: @c -*-texinfo-*-
11: @comment %**start of header
12: @setfilename Math2ox
13: @settitle Math2ox
14: @comment %**end of header
15: @comment %@setchapternewpage odd
16:
17: @iftex
18: @comment @finalout
19: @end iftex
20:
21: @titlepage
22:
23: @title Math2ox
24: @subtitle Math2ox User's Manual (English Edition)
25: @subtitle Edition 1.1.2 for OpenXM/oxmath
26: @subtitle March 2000
27:
28: @author by Katsuyoshi Ohara
29: @end titlepage
30:
31: @synindex vr fn
32:
33: @comment node-name, next, previous, up
34: @node Top,, (dir), (dir)
35:
36: @menu
37: * Mathematica Client Functions::
38: * Sample Programs::
39: @end menu
40:
1.3 ohara 41: @node Starting OX servers,,, Top
42:
43: @chapter Starting OX servers
44:
45: @node Starting OX servers on the localhost,,, Starting OX servers
46: @section Starting OX servers on the localhost
47:
48: @c Description of OxStart
49: @menu
50: * OxStart::
51: @end menu
52: @node OxStart,,,
53: @subsection @code{OxStart}
54: @findex OxStart
55: @table @t
56: @item OxStart[@var{s}]
57: :: Start the OX server @code{s}.
58: @end table
59:
60: @table @var
61: @item return
62: Integer
63: @item s
64: String
65: @end table
66:
67: @itemize @bullet
68: @item It starts the OX server @code{s}.
1.4 ohara 69: @item Servers are looked for in the directory $OpenXM_HOME/bin, hoge hoge.
1.3 ohara 70: @end itemize
71:
72: @example
73: In[1]:= Install["math2ox"]
74: In[2]:= pid = OxStart["ox_sm1"]
75: @end example
76:
77: In this example, @code{ox_sm1} is started on the local machine.
78:
79:
80:
81:
82: @node Starting OX servers on a remote machine,,, Top
83: @section Starting OX servers on a remote machine
84:
1.4 ohara 85: In order to connect to remote OX servers, it is convenient, secure and
86: recommended to use @code{ssh} (Secure SHell).
87: The function @code{OxStartRemoteSSH} starts remote OX servers
88: by ssh. Of course, you are supposed to be able to login the remote
89: machine by @code{ssh} and @code{$Remote_OpenXM_HOME/rc/cshrc} or
90: @code{$Remote_OpenXM_HOME/rc/bashrc} are executed from the login shell
91: of your remote machine.
92: The function @code{OxStartRemoteSSH[]} does not request your password,
93: that is, you need to be using @code{ssh-agent} before calling
94: @code{OxStartRemoteSSH[]}.
95: Then there will be no check of password.
1.3 ohara 96:
97: @c Description of OxStartRemoteSSH
98: @menu
99: * OxStartRemoteSSH::
100: @end menu
101: @node OxStartRemoteSSH,,,
102: @subsection @code{OxStartRemoteSSH}
103: @findex OxStartRemoteSSH
104: @table @t
105: @item OxStartRemoteSSH[@var{s}, @var{host}]
1.4 ohara 106: :: start the OX server @code{s} on the remote machine @code{host} by ssh.
1.3 ohara 107: @end table
108:
109: @table @var
110: @item return
111: Integer
112: @item s
113: String
114: @item host
115: String
116: @end table
117:
1.4 ohara 118: We note that the @code{OxStartRemoteSSH[]} is an experimental implementation.
1.3 ohara 119:
120: @itemize @bullet
121: @item It starts the OX server @code{s}.
1.4 ohara 122: @item Servers are looked for in the directory $OpenXM_HOME/bin, hoge hoge.
1.3 ohara 123: @end itemize
124:
125: @example
126: In[2]:= pid = OxStartRemoteSSH["ox_sm1", "remotehost"]
127: @end example
128:
129: In this example, @code{ox_sm1} is started on the remote machine @code{remotehost}.
130:
1.1 ohara 131: @node Mathematica Client Functions,,, Top
132:
133: @chapter Mathematica Client Functions
134:
135: The program @code{math2ox} is an external module for Mathematica
136: to call OpenXM servers.
137: The @code{math2ox} communicates with OpenXM servers by the OpenXM protocol
138: and communicates with Mathematica by MathLink.
139:
140: @c Description of OxStart
141: @menu
142: * OxStart::
143: @end menu
144: @node OxStart,,, Mathematica Client Functions
145: @section @code{OxStart}
146: @findex OxStart
147: @table @t
1.2 ohara 148: @item OxStart[@var{s}]
1.1 ohara 149: :: Start the OX server @code{s}.
150: @end table
151:
152: @table @var
153: @item return
154: Integer
155: @item s
156: String
157: @end table
158:
159: @itemize @bullet
160: @item It starts the OX server @code{s}.
1.4 ohara 161: @item Servers are looked for in the directory $OpenXM_HOME/bin, hoge hoge.
1.1 ohara 162: @end itemize
163:
164: @example
165: In[1]:= Install["math2ox"]
1.2 ohara 166: In[2]:= pid = OxStart["ox_sm1"]
1.1 ohara 167: @end example
168:
169: In this example, @code{ox_sm1} is started on the local machine.
170:
1.2 ohara 171: @c Description of OxSendMessage
172: @menu
173: * OxSendMessage::
174: @end menu
175: @node OxSendMessage,,, Mathematica Client Functions
176: @section @code{OxSendMessage}
177: @findex OxSendMessage
178: @table @t
179: @item OxSendMessage[@var{pid}, @var{s}]
1.3 ohara 180: :: send a message @code{s} to the OX server @code{pid}.
1.2 ohara 181: @end table
182:
183: @table @var
184: @item return
185: Integer
1.3 ohara 186: @item pid
1.2 ohara 187: Integer
188: @item s
189: String
190: @end table
191:
192: @example
193: In[4] := OxSendMessage[pid, "(CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO))"]
194: In[5] := OxSendMessage[pid, "(OX_COMMAND, (SM_popCMO))"]
195: @end example
196:
197: In this example, an OX data message
198: (OX_DATA, (CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO))
199: and an OX command message (OX_COMMAND, (SM_popCMO)) are sent to
200: the OX server @code{pid}.
201:
1.3 ohara 202: @c Description of OxPopCMO
203: @menu
204: * OxPopCMO::
205: @end menu
206: @node OxPopCMO,,, Mathematica Client Functions
207: @section @code{OxPopCMO}
208: @findex OxPopCMO
209: @table @t
210: @item OxPopCMO[@var{pid}]
211: :: pop an object on the top of the stack.
212: @end table
213:
214: @table @var
215: @item return
216: Manual
217: @item pid
218: Integer
219: @end table
220:
1.4 ohara 221: The @code{OxPopCMO[]} function pops an object on the top of the stack of
1.3 ohara 222: the OX stack machine @code{pid} and returns the object.
1.4 ohara 223: The return type of the function @code{OxPopCMO[]} is @code{Manual} in
224: terms of MathLink, that is, an object of suitable type is returned.
1.3 ohara 225:
226: @example
1.4 ohara 227: In[5] := cmo = OxPopCMO[pid]
1.3 ohara 228: @end example
229:
230: @c Description of OxPopString
231: @menu
232: * OxPopString::
233: @end menu
234: @node OxPopString,,, Mathematica Client Functions
235: @section @code{OxPopString}
236: @findex OxPopString
237: @table @t
238: @item OxPopString[@var{pid}]
239: :: get a string from the OX server @code{pid}.
240: @end table
241:
242: @table @var
243: @item return
244: String
245: @item pid
246: Integer
247: @end table
248:
1.4 ohara 249: The @code{OxPopString[]} function pops an object on the top of the stack
1.3 ohara 250: of the OX stack machine @code{pid} and returns a string which is
1.4 ohara 251: translated from the object by the OX stack machine.
1.3 ohara 252:
253: @example
1.4 ohara 254: In[5] := string = OxPopString[pid]
1.3 ohara 255: @end example
256:
257: @c Description of OxClose
258: @menu
259: * OxClose::
260: @end menu
261: @node OxClose,,, Mathematica Client Functions
262: @section @code{OxClose}
263: @findex OxClose
264: @table @t
265: @item OxClose[@var{pid}]
266: :: close the connection to the OX server @code{pid}.
267: @end table
268:
269: @table @var
270: @item return
271: none
272: @item pid
273: Integer
274: @end table
275:
1.4 ohara 276: The @code{OxClose[]} function closes the connection to the OX server
1.3 ohara 277: @code{pid}.
278:
279: @example
1.4 ohara 280: In[5] := OxClose[pid]
1.3 ohara 281: @end example
282:
283: @c Description of OxExecuteString
284: @menu
285: * OxExecuteString::
286: @end menu
287: @node OxExecuteString,,, Mathematica Client Functions
288: @section @code{OxExecuteString}
289: @findex OxExecuteString
290: @table @t
291: @item OxExecuteString[@var{pid}, @var{command}]
292: :: execute @code{command} on the OX server @code{pid}.
293: @end table
294:
295: @table @var
296: @item return
297: none
298: @item pid
299: Integer
300: @item command
301: String
302: @end table
303:
304: The @code{OxExecuteString[]} function executes @code{command} on the OX server
305: @code{pid}.
1.4 ohara 306: The string @code{command} is interpreted in local language of the OX server.
1.3 ohara 307:
308: @example
309: In[5] := OxExecuteString["print(1+2);"]
310: @end example
311:
312: @c Description of OxGet
313: @menu
314: * OxGet::
315: @end menu
316: @node OxGet,,, Mathematica Client Functions
317: @section @code{OxGet}
318: @findex OxGet
319: @table @t
320: @item OxGet[@var{pid}]
321: :: get an object from the connection to the OX server @code{pid}.
322: @end table
323:
324: @table @var
325: @item return
326: Manual
327: @item pid
328: Integer
329: @end table
330:
1.4 ohara 331: The @code{OxGet[]} function gets an object from the connection to the OX server
1.3 ohara 332: @code{pid}.
1.1 ohara 333:
1.3 ohara 334: @example
1.4 ohara 335: In[5] := cmo = OxGet[pid]
1.3 ohara 336: @end example
1.2 ohara 337:
1.3 ohara 338: @c Put descriptions of a next function.
1.1 ohara 339:
340: @node Sample Programs,,, Top
341: @chapter Sample Programs
342:
1.5 ! ohara 343: @enumerate
! 344: @item
! 345: @code{OpenXM/lib/math/primadec.m} is a Mathematica program
1.1 ohara 346: to make primary ideal decompositions by calling
1.5 ! ohara 347: @code{ox_asir}.
1.1 ohara 348: As to usages, see comments in this file.
349:
1.5 ! ohara 350: @item
! 351: @code{OpenXM/lib/math/beta.m} is a Mathematica program
! 352: to get beta-nbc bases by calling @code{ox_asir}.
! 353: @end enumerate
! 354:
! 355: @node Example,,, Top
! 356: @chapter Example
! 357:
! 358: The @code{math2ox} has the following commands:
! 359:
! 360: @code{OxStart[s_String],
! 361: OxStartInsecure[s_String, p_Integer, q_Integer],
! 362: OxStartRemoteSSH[s_String, t_String],
! 363: OxExecuteString[s_String], OxSendMessage[s_String], OxGet[], OxPopCMO[],
! 364: OxPopString[], OxClose[], OxReset[]}.
1.1 ohara 365:
1.5 ! ohara 366: First, let us load the math2ox.
! 367: @example
! 368: In[1]:= <<oxclient.m
! 369: @end example
! 370:
! 371: Second, let us open a connection with an OX server.
! 372: For example, if we want to call the @code{ox_sm1} (the kan/sm1 server), then
! 373: @example
! 374: In[2] := pid = OxStart[pid, "ox_sm1"]
! 375: @end example
! 376: where we have the connection of reverse mode. The OxStart function
! 377: automatically invoke @code{ox_sm1} on the local machine. If you need to
! 378: connect an OX server on a remote machine, then you can use reverse mode.
! 379: @example
! 380: In[2] := pid = OxStartInsecure["water.s.kanazawa-u.ac.jp", 1300, 1400]
! 381: @end example
! 382: The mode is not secured but you can crypt data stream by using ssh
! 383: (Secure SHell).
! 384: @example
! 385: In[3] := Run["ssh -f water ox -insecure -ox ox_sm1 -host water"]
! 386: @end example
! 387:
! 388: Third, let us send an OX message to the OX server.
! 389: We can send an OX message written in OX/CMO expressions.
! 390: @example
! 391: In[4] := OxSendMessage[pid, "(CMO_LIST, (CMO_STRING, "hello world"), (CMO_ZERO))"]
! 392: In[5] := OxSendMessage[pid, "(OX_COMMAND, (SM_popCMO))"]
! 393: @end example
! 394: If the expression conains syntax errors, then nothing is sent.
! 395:
! 396: Remarks: if @code{SM_popCMO} is sent by the @code{OxSendMessage[]} function, then the
! 397: OX stack machine returns the top of the stack to the @code{math2ox}.
! 398: Then, in order to receive the message, we need to call the @code{OxGet[]}
! 399: function always after executing @code{OxSendMessage[]}
! 400: @example
! 401: In[6] := OxGet[pid]
! 402: @end example
! 403:
! 404: If we do not use the @code{OxSendMessage} function and use the @code{OxPopCMO[]}
! 405: function, then we do not need to call the @code{OxGet[]}.
! 406: @example
! 407: In[5] := OxPopCMO[pid]
! 408: @end example
! 409:
! 410: Fourth, if we send a command expressed in the local language of the OX
! 411: server, then we need to call the @code{OxExecuteString[]} function.
! 412:
! 413: Last, let us close the connection.
! 414: @example
! 415: In[7] := OxClose[pid]
! 416: @end example
1.1 ohara 417:
1.5 ! ohara 418: @c @node Bibliography,,, Top
! 419: @c @unnumbered Bibliography
! 420: @node References,,, Top
! 421: @unnumbered References
! 422:
! 423: @enumerate
! 424: @item
! 425: M. Noro, N. Takayama:
! 426: Design and Implementation of OpenXM, 1996, 1997, 1998, 1999, 2000.
! 427:
! 428: @item
! 429: @code{http://www.math.kobe-u.ac.jp/OpenXM/}
! 430:
! 431: @item
! 432: M. Noro, K. Ohara, N. Takayama:
! 433: {Introduction to Open Asir}, 1999, Suusiki Shori, Vol 7, No 2,
! 434: 2--17. (ISBN4-87243-086-7, SEG Publishing, Tokyo). (in Japanese)
! 435:
! 436: @item
! 437: Stephen Wolfram:
! 438: {The Mathematica Book}, Third edition,
! 439: Wolfram Media/Cambridge University Press, 1996.
! 440:
! 441: @item
! 442: T. Miyachi:
! 443: {Mathematica Network Programming},
! 444: Iwanami Shoten Publishers, 1998. (in Japanese)
! 445: @end enumerate
1.1 ohara 446:
447: @node Index,,, Top
448: @unnumbered Index
449: @printindex fn
450: @printindex cp
451: @iftex
452: @vfill @eject
453: @end iftex
454: @summarycontents
455: @contents
456: @bye
457:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>