Go to the first, previous, next, last section, table of contents.


m_rtostr

m_rtostr(t)
:: translate the object t into a string that can be understandable by Mathematica as far as possible.
return
String
t
Object
[259] m_rtostr([1,2,3]);
{1,2,3}
[260] m_rtostr([[1,x,x^2],[1,y,y^2]]);
{{1,x,x^2},{1,y,y^2}}

Let us see one more example. The following function m_Inverse(M) outputs the inverse matrix of the matrix M by calling ox_math. It translates asir matrix M into a Mathematica expression by r_tostr(M) and makes Mathematica compute the inverse matrix of M by ox_execute_string.

def m_Inverse(M) {
  P = 0;
  A = m_rtostr(M);
  ox_execute_string(P,"Inverse["+A+"]");
  B = ox_pop_cmo(B);
  C = m_tree_to_string(B);
  return(eval_str(C));
}

[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]]
[270] A=m_Inverse(M)$
[271] red(A[0][0]);
(z*y)/(x^2+(-y-z)*x+z*y)
Reference
ox_execute_string, ToExpression(Mathematica), m_tree_to_string


Go to the first, previous, next, last section, table of contents.