File: [local] / OpenXM / src / ox_math / lib / primadec.m (download)
Revision 1.2, Fri Dec 17 02:21:41 1999 UTC (24 years, 9 months ago) by ohara
Branch: MAIN
Changes since 1.1: +3 -3
lines
I have fixed a simple bug of asirRtostr[].
|
(* $OpenXM: OpenXM/src/ox_math/lib/primadec.m,v 1.2 1999/12/17 02:21:41 ohara Exp $ *)
(*
usage:
$ math
Mathematica 3.0 for Linux
Copyright 1988-97 Wolfram Research, Inc.
-- Motif graphics initialized --
In[1]:= <<primadec.m
In[2]:= primadec[{x^2-3*x+2},{x}]
Out[2]= {{{-1 + x}, {-1 + x}}, {{-2 + x}, {-2 + x}}}
*)
asirRtostr[x_] := Module[
{list = {}, i, s},
If[ x[[0]] === List,
list = Append[list, " [ " ];
If[ Length[x] > 0 ,
list = Append[list, asirRtostr[ x[[1] ] ] ];
For[i=2, i<= Length[x], i++,
list = Append[list, " , "];
list = Append[list, asirRtostr[ x[[i]] ] ]
]
];
list = Append[list, " ] "];
s = StringJoin[list],
s = ToString[x, InputForm]
]
]
primadec[polys_List, vars_List] := Block[
{s},
s = StringJoin[
{"m_rtostr(primadec( ", asirRtostr[polys], " , ", asirRtostr[vars], " ));"}];
OxExecuteString[s];
ToExpression[OxPopString[]]
]
Install[Environment["OpenXM_HOME"] <> "/bin/math2ox"]
OxStart["ox_asir"]