[BACK]Return to m.oxweave CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-contrib / packages / doc

Diff for /OpenXM/src/asir-contrib/packages/doc/Attic/m.oxweave between version 1.1 and 1.6

version 1.1, 2003/05/19 05:15:52 version 1.6, 2004/03/05 15:56:40
Line 1 
Line 1 
 /* $OpenXM$ */  /* $OpenXM: OpenXM/src/asir-contrib/packages/doc/m.oxweave,v 1.5 2004/03/05 15:30:50 ohara Exp $ */
 /* Use oxweave to generate documents on this source code  /* Use oxweave to generate documents on this source code
    Use iso-2022 to write this file. No default use of GL and GR is allowed.     Use iso-2022 to write this file. No default use of GL and GR is allowed.
 */  */
   
   
 /*&C-texi  /*&C
 @c DO NOT EDIT THIS FILE   oxmath.texi  It is automatically generated  @c DO NOT EDIT THIS FILE   oxmath.texi  It is automatically generated
 @c from asir-contrib/packages/doc/m.oxweave  @c from asir-contrib/packages/doc/m.oxweave
 @node Mathematica Functions,,, Top  @node Mathematica Functions,,, Top
   @menu
   * mathematica.start::
   * mathematica.tree_to_string::
   * mathematica.rtomstr::
   @end menu
   
   
 */  */
 /*&jp-texi  /*&ja
 @chapter Mathematica $BH!?t(B  @chapter Mathematica $BH!?t(B
   
 $B$3$N@a$G$O(B Mathematica $B$N(B ox $B%5!<%P(B @code{ox_math}  $B$3$N@a$G$O(B Mathematica $B$N(B ox $B%5!<%P(B @code{ox_math}
Line 20 
Line 27 
   
 $BCm0U(B: @code{ox_reset} $B$OF0$+$J$$(B.  $BCm0U(B: @code{ox_reset} $B$OF0$+$J$$(B.
 */  */
 /*&eg-texi  /*&en
 @chapter Mathematica Functions  @chapter Mathematica Functions
   
 This chapter describes  interface functions for  This chapter describes  interface functions for
Line 32  The file @file{m} is at @file{$(OpenXM_HOME)/lib/asir-
Line 39  The file @file{m} is at @file{$(OpenXM_HOME)/lib/asir-
   
 Note: @code{ox_reset} does not work.  Note: @code{ox_reset} does not work.
 */  */
 /*&C-texi  /*&C
 @example  @example
 @include opening.texi  @include opening.texi
 [258] load("m")$  [258] load("m")$
 m Version 19991113. m.start, m.tree_to_string, m.n_Eigenvalues  m Version 19991113. mathematica.start, mathematica.tree_to_string, mathematica.n_Eigenvalues
 [259] m.start();  [259] mathematica.start();
 ox_math has started.  ox_math has started.
 ox_math: Portions copyright 2000 Wolfram Research, Inc.  ox_math: Portions copyright 2000 Wolfram Research, Inc.
 See OpenXM/Copyright/Copyright.mathlink  for details.  See OpenXM/Copyright/Copyright.mathlink  for details.
 0  0
 [260] m.n_Eigenvalues([[1,2],[4,5]]);  [260] mathematica.n_Eigenvalues([[1,2],[4,5]]);
 [-0.464102,6.4641]  [-0.464102,6.4641]
 @end example  @end example
 */  */
   
 /*&C-texi  /*&C
 @noindent  @noindent
 @code{Mathematica} is the trade mark of Wolfram Research Inc.  @code{Mathematica} is the trade mark of Wolfram Research Inc.
 This package requires Mathmatica Version 3.0, so you need  This package requires Mathmatica Version 3.0, so you need
Line 64  Author of @code{ox_math}: Katsuyoshi Ohara,  
Line 71  Author of @code{ox_math}: Katsuyoshi Ohara,  
 */  */
   
   
 /*&jp-texi  /*&ja
 @section $BH!?t0lMw(B  @section $BH!?t0lMw(B
 */  */
 /*&eg-texi  /*&en
 @section Functions  @section Functions
 */  */
 /*&jp-texi  /*&ja
 @menu  @node mathematica.start,,, Mathematica Functions
 * m.start::  @subsection @code{mathematica.start}
 @end menu  @findex mathematica.start
 @node m.start,,, Mathematica Functions  
 @subsection @code{m.start}  
 @findex m.start  
 @table @t  @table @t
 @item m.start()  @item mathematica.start()
 ::  Localhost $B$G(B @code{ox_math} $B$r5/F0$9$k(B.  ::  Localhost $B$G(B @code{ox_math} $B$r5/F0$9$k(B.
 @end table  @end table
   
Line 94  Author of @code{ox_math}: Katsuyoshi Ohara,  
Line 98  Author of @code{ox_math}: Katsuyoshi Ohara,  
 @item $B<1JLHV9f$O(B @code{M_proc} $B$K3JG<$5$l$k(B.  @item $B<1JLHV9f$O(B @code{M_proc} $B$K3JG<$5$l$k(B.
 @end itemize  @end itemize
 */  */
 /*&eg-texi  /*&en
 @menu  @node mathematica.start,,, Mathematica Functions
 * m.start::  @subsection @code{mathematica.start}
 @end menu  @findex mathematica.start
 @node m.start,,, Mathematica Functions  
 @subsection @code{m.start}  
 @findex m.start  
 @table @t  @table @t
 @item m.start()  @item mathematica.start()
 ::  Start  @code{ox_math} on the localhost.  ::  Start  @code{ox_math} on the localhost.
 @end table  @end table
   
Line 118  Integer
Line 119  Integer
 @item The descriptor is stored in the variable @code{M_proc}.  @item The descriptor is stored in the variable @code{M_proc}.
 @end itemize  @end itemize
 */  */
 /*&C-texi  /*&C
 @example  @example
 P = m.start()  P = mathematica.start()
 @end example  @end example
 */  */
 /*&jp-texi  /*&ja
 @table @t  @table @t
 @item $B;2>H(B  @item $B;2>H(B
 @code{ox_launch}  @code{ox_launch}
 @end table  @end table
 */  */
 /*&eg-texi  /*&en
 @table @t  @table @t
 @item Reference  @item Reference
 @code{ox_launch}  @code{ox_launch}
Line 140  P = m.start()
Line 141  P = m.start()
   $B0J2<$G(BMathematica $B$r8F$V$?$a$NJd=u4X?t$rDj5A$9$k(B.    $B0J2<$G(BMathematica $B$r8F$V$?$a$NJd=u4X?t$rDj5A$9$k(B.
 */  */
   
 /*&jp-texi  /*&ja
 @menu  @node mathematica.tree_to_string,,, Mathematica Functions
 * m.tree_to_string::  @subsection @code{mathematica.tree_to_string}
 @end menu  @findex mathematica.tree_to_string
 @node m.tree_to_string,,, Mathematica Functions  
 @subsection @code{m.tree_to_string}  
 @findex m.tree_to_string  
 @table @t  @table @t
 @item m.tree_to_string(@var{t})  @item mathematica.tree_to_string(@var{t})
 ::  ox_math $B$NLa$9(B Mathematica $B$NLZ9=B$%G!<%?(B @var{t} $B$r(B @code{asir} $B7A<0$K(B  ::  ox_math $B$NLa$9(B Mathematica $B$NLZ9=B$%G!<%?(B @var{t} $B$r(B @code{asir} $B7A<0$K(B
 $B$J$*$9(B.  $B$J$*$9(B.
 @end table  @end table
Line 173  ox_math $B$NLa$9(B Mathematica $B$NLZ9=B$%G!<%?(B 
Line 171  ox_math $B$NLa$9(B Mathematica $B$NLZ9=B$%G!<%?(B 
    $B$+$($k(B.     $B$+$($k(B.
 @end itemize  @end itemize
 */  */
 /*&eg-texi  /*&en
 @menu  @node mathematica.tree_to_string,,, Mathematica Functions
 * m.tree_to_string::  @subsection @code{mathematica.tree_to_string}
 @end menu  @findex mathematica.tree_to_string
 @node m.tree_to_string,,, Mathematica Functions  
 @subsection @code{m.tree_to_string}  
 @findex m.tree_to_string  
 @table @t  @table @t
 @item m.tree_to_string(@var{t})  @item mathematica.tree_to_string(@var{t})
 ::  translates Mathematica tree data  @var{t} into a string that can  ::  translates Mathematica tree data  @var{t} into a string that can
 be understandable by @code{asir} as far as possible.  be understandable by @code{asir} as far as possible.
 @end table  @end table
Line 210  be understandable by @code{asir}.
Line 205  be understandable by @code{asir}.
   @code{m_(the key word)}.    @code{m_(the key word)}.
 @end itemize  @end itemize
 */  */
 /*&C-texi  /*&C
 @example  @example
 [267] m.start();  [267] mathematica.start();
 0  0
 [268] ox_execute_string(0,"Expand[(x-1)^2]");  [268] ox_execute_string(0,"Expand[(x-1)^2]");
 0  0
 [269] A=ox_pop_cmo(0);  [269] A=ox_pop_cmo(0);
 [Plus,1,[Times,-2,x],[Power,x,2]]  [Plus,1,[Times,-2,x],[Power,x,2]]
 [270] m.tree_to_string(A);  [270] mathematica.tree_to_string(A);
 (1)+((-2)*(x))+((x)^(2))  (1)+((-2)*(x))+((x)^(2))
 [271] eval_str(@@);  [271] eval_str(@@);
 x^2-2*x+1  x^2-2*x+1
 @end example  @end example
 */  */
 /*&C-texi  /*&C
 @example  @example
 [259] m.tree_to_string(["List",1,2]);  [259] mathematica.tree_to_string(["List",1,2]);
 [1 , 2]  [1 , 2]
 [260] m.tree_to_string(["Plus",2,3]);  [260] mathematica.tree_to_string(["Plus",2,3]);
 (2)+(3)  (2)+(3)
 [261] m.tree_to_string(["Complex",2.3,4.55]);  [261] mathematica.tree_to_string(["Complex",2.3,4.55]);
 m.complex(2.3 , 4.55)  mathematica.complex(2.3 , 4.55)
 [362] m.tree_to_string(["Plus",["Complex",1.2,3.5],1/2]);  [362] mathematica.tree_to_string(["Plus",["Complex",1.2,3.5],1/2]);
 (m.complex(1.2 , 3.5))+(1/2)  (mathematica.complex(1.2 , 3.5))+(1/2)
 [380] eval_str(@@);  [380] eval_str(@@);
 (1.7+3.5*@i)  (1.7+3.5*@@i)
 @end example  @end example
 */  */
 /*&jp-texi  /*&ja
 @table @t  @table @t
 @item $B;2>H(B  @item $B;2>H(B
 @code{ox_pop_cmo}, @code{eval_str}, @code{m.rtomstr}  @code{ox_pop_cmo}, @code{eval_str}, @code{mathematica.rtomstr}
 @end table  @end table
 */  */
 /*&eg-texi  /*&en
 @table @t  @table @t
 @item Reference  @item Reference
 @code{ox_pop_cmo}, @code{eval_str}, @code{m.rtomstr}  @code{ox_pop_cmo}, @code{eval_str}, @code{mathematica.rtomstr}
 @end table  @end table
 */  */
 /*&jp  /*&jp
Line 261  m.complex(2.3 , 4.55)
Line 256  m.complex(2.3 , 4.55)
    $BJQ$($k(B.     $BJQ$($k(B.
 */  */
   
 /*&jp-texi  /*&ja
 @menu  @node mathematica.rtomstr,,, Mathematica Functions
 * m.rtomstr::  @subsection @code{mathematica.rtomstr}
 @end menu  @findex mathematica.rtomstr
 @node m.rtomstr,,, Mathematica Functions  
 @subsection @code{m.rtomstr}  
 @findex m.rtomstr  
 @table @t  @table @t
 @item m.rtomstr(@var{t})  @item mathematica.rtomstr(@var{t})
 ::  @var{t} $B$r$J$k$Y$/(B Mathematica $B$NM}2r2DG=$JJ8;zNs$KJQ$($k(B.  ::  @var{t} $B$r$J$k$Y$/(B Mathematica $B$NM}2r2DG=$JJ8;zNs$KJQ$($k(B.
 @end table  @end table
   
Line 287  m.complex(2.3 , 4.55)
Line 279  m.complex(2.3 , 4.55)
    $B$3$N4X?t$O$3$NJQ49$r$*$3$J$&(B.     $B$3$N4X?t$O$3$NJQ49$r$*$3$J$&(B.
 @end itemize  @end itemize
 */  */
 /*&eg-texi  /*&en
 @menu  @node mathematica.rtomstr,,, Mathematica Functions
 * m.rtomstr::  @subsection @code{mathematica.rtomstr}
 @end menu  @findex mathematica.rtomstr
 @node m.rtomstr,,, Mathematica Functions  
 @subsection @code{m.rtomstr}  
 @findex m.rtomstr  
 @table @t  @table @t
 @item m.rtomstr(@var{t})  @item mathematica.rtomstr(@var{t})
 ::  translate the object @var{t} into a string that can be understandable  ::  translate the object @var{t} into a string that can be understandable
 by Mathematica as far as possible.  by Mathematica as far as possible.
 @end table  @end table
Line 315  but @code{Mathematica} uses @code{@{}, @code{@}}.
Line 304  but @code{Mathematica} uses @code{@{}, @code{@}}.
 This function makes this sort of translations.  This function makes this sort of translations.
 @end itemize  @end itemize
 */  */
 /*&C-texi  /*&C
 @example  @example
 [259] m.rtomstr([1,2,3]);  [259] mathematica.rtomstr([1,2,3]);
 {1,2,3}  @{1,2,3@}
 [260] m.rtomstr([[1,x,x^2],[1,y,y^2]]);  [260] mathematica.rtomstr([[1,x,x^2],[1,y,y^2]]);
 @{@{1,x,x^2@},@{1,y,y^2@}@}  @{@{1,x,x^2@},@{1,y,y^2@}@}
 @end example  @end example
 */  */
 /*&jp-texi  /*&ja
 $B$b$&0l$DNc$r$"$2$h$&(B.  $B$b$&0l$DNc$r$"$2$h$&(B.
 $B<!$N4X?t(B @code{m.inverse(M)} $B$O(B @code{ox_math}  $B<!$N4X?t(B @code{mathematica.inverse(M)} $B$O(B @code{ox_math}
 $B$r$h$s$G9TNs(B @code{M} $B$N5U9TNs$r7W;;$9$k4X?t$G$"$k(B.  $B$r$h$s$G9TNs(B @code{M} $B$N5U9TNs$r7W;;$9$k4X?t$G$"$k(B.
 @code{m.inverse(M)} $B$O<!$N$h$&$K(B @code{r_tostr(M)} $B$rMQ$$$F(B  @code{mathematica.inverse(M)} $B$O<!$N$h$&$K(B @code{r_tostr(M)} $B$rMQ$$$F(B
 asir $B$N9TNs$r(B Mathematica $B7A<0$KJQ49$7$F$+$i(B  asir $B$N9TNs$r(B Mathematica $B7A<0$KJQ49$7$F$+$i(B
 @code{ox_execute_string} $B$G(B Mathematica $B$K5U9TNs$r7W;;(B  @code{ox_execute_string} $B$G(B Mathematica $B$K5U9TNs$r7W;;(B
 $B$5$;$F$$$k(B.  $B$5$;$F$$$k(B.
 */  */
 /*&eg-texi  /*&en
 Let us see one more example.  Let us see one more example.
 The following function @code{m.inverse(M)} outputs  The following function @code{mathematica.inverse(M)} outputs
 the inverse matrix of the matrix @code{M} by calling @code{ox_math}.  the inverse matrix of the matrix @code{M} by calling @code{ox_math}.
 It translates @code{asir} matrix @code{M} into a Mathematica expression  It translates @code{asir} matrix @code{M} into a Mathematica expression
 by @code{r_tostr(M)}  by @code{r_tostr(M)}
 and makes Mathematica compute the inverse matrix of @code{M} by  and makes Mathematica compute the inverse matrix of @code{M} by
 @code{ox_execute_string}.  @code{ox_execute_string}.
 */  */
 /*&C-texi  /*&C
 @example  @example
 def inverse(M) @{  def inverse(M) @{
   P = 0;    P = 0;
   A = m.rtomstr(M);    A = mathematica.rtomstr(M);
   ox_execute_string(P,"Inverse["+A+"]");    ox_execute_string(P,"Inverse["+A+"]");
   B = ox_pop_cmo(B);    B = ox_pop_cmo(B);
   C = m.tree_to_string(B);    C = mathematica.tree_to_string(B);
   return(eval_str(C));    return(eval_str(C));
 @}  @}
   
 [269] M=[[1,x,x^2],[1,y,y^2],[1,z,z^2]];  [269] M=[[1,x,x^2],[1,y,y^2],[1,z,z^2]];
 [[1,x,x^2],[1,y,y^2],[1,z,z^2]]  [[1,x,x^2],[1,y,y^2],[1,z,z^2]]
 [270] A=m.inverse(M)$  [270] A=mathematica.inverse(M)$
 [271] red(A[0][0]);  [271] red(A[0][0]);
 (z*y)/(x^2+(-y-z)*x+z*y)  (z*y)/(x^2+(-y-z)*x+z*y)
 @end example  @end example
 */  */
 /*&jp-texi  /*&ja
 @table @t  @table @t
 @item $B;2>H(B  @item $B;2>H(B
 @code{ox_execute_string}, @code{ToExpression}(Mathematica),  @code{ox_execute_string}, @code{ToExpression}(Mathematica),
 @code{m.tree_to_string}  @code{mathematica.tree_to_string}
 @end table  @end table
 */  */
 /*&eg-texi  /*&en
 @table @t  @table @t
 @item Reference  @item Reference
 @code{ox_execute_string}, @code{ToExpression}(Mathematica),  @code{ox_execute_string}, @code{ToExpression}(Mathematica),
 @code{m.tree_to_string}  @code{mathematica.tree_to_string}
 @end table  @end table
 */  */
 /*&jp  /*&jp
   $B4X?t(B \verb+ m.rtomstr(L) + $B$O(B asir $B7A<0$N%*%V%8%'%/%H(B L $B$r$J$k$Y$/(B    $B4X?t(B \verb+ mathematica.rtomstr(L) + $B$O(B asir $B7A<0$N%*%V%8%'%/%H(B L $B$r$J$k$Y$/(B
   Mathematica $B$,M}2r$G$-$k7A$NJ8;zNs$KJQ49$9$k(B.    Mathematica $B$,M}2r$G$-$k7A$NJ8;zNs$KJQ49$9$k(B.
   $B$?$H$($P(B, $B%j%9%H(B, $B%Y%/%H%k(B, $B9TNs(B $B$O(B asir $B$G$O(B {\tt [}, {\tt ]}    $B$?$H$($P(B, $B%j%9%H(B, $B%Y%/%H%k(B, $B9TNs(B $B$O(B asir $B$G$O(B {\tt [}, {\tt ]}
   $B$G0O$`$,(B, Mathematica $B$G$O(B, {\tt \{ }, {\tt \}} $B$G0O$`(B.    $B$G0O$`$,(B, Mathematica $B$G$O(B, {\tt \{ }, {\tt \}} $B$G0O$`(B.
Line 382  def inverse(M) @{
Line 371  def inverse(M) @{
   $BNc(B:    $BNc(B:
   {\footnotesize    {\footnotesize
   \begin{verbatim}    \begin{verbatim}
    [262] m.rtomstr([1,2,3]);     [262] mathematica.rtomstr([1,2,3]);
    {1,2,3}     {1,2,3}
    [375] A = newvect(3,[x+2,"Hello",[1/2,3]]);     [375] A = newvect(3,[x+2,"Hello",[1/2,3]]);
    [ x+2 Hello [1/2,3] ]     [ x+2 Hello [1/2,3] ]
    [376] m.rtomstr(A);     [376] mathematica.rtomstr(A);
    {x+2,Hello,{1/2,3}}     {x+2,Hello,{1/2,3}}
   \end{verbatim}    \end{verbatim}
   }    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>