[BACK]Return to primadec.m CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_math / lib

Annotation of OpenXM/src/ox_math/lib/primadec.m, Revision 1.2

1.2     ! ohara       1: (* $OpenXM: OpenXM/src/ox_math/lib/primadec.m,v 1.1 1999/12/15 03:40:36 ohara Exp $ *)
1.1       ohara       2:
                      3: (*
                      4: usage:
                      5: $ math
                      6: Mathematica 3.0 for Linux
                      7: Copyright 1988-97 Wolfram Research, Inc.
                      8:  -- Motif graphics initialized --
                      9:
                     10: In[1]:= <<primadec.m
                     11: In[2]:= primadec[{x^2-3*x+2},{x}]
                     12: Out[2]= {{{-1 + x}, {-1 + x}}, {{-2 + x}, {-2 + x}}}
                     13: *)
                     14:
1.2     ! ohara      15: asirRtostr[x_] := Module[
        !            16:        {list = {}, i, s},
1.1       ohara      17:        If[ x[[0]] === List,
                     18:          list = Append[list, " [ " ];
                     19:          If[ Length[x] > 0 ,
                     20:                list = Append[list, asirRtostr[ x[[1] ] ] ];
                     21:                For[i=2, i<= Length[x], i++,
                     22:                   list = Append[list, " , "];
                     23:                   list = Append[list, asirRtostr[ x[[i]] ] ]
                     24:                        ]
                     25:                  ];
                     26:          list = Append[list, " ] "];
                     27:          s = StringJoin[list],
                     28:          s = ToString[x, InputForm]
                     29:                ]
                     30:        ]
                     31:
                     32: primadec[polys_List, vars_List] := Block[
                     33:        {s},
                     34:        s = StringJoin[
                     35:                {"m_rtostr(primadec( ", asirRtostr[polys], " , ",  asirRtostr[vars], " ));"}];
                     36:        OxExecuteString[s];
                     37:        ToExpression[OxPopString[]]
                     38:        ]
                     39:
                     40: Install[Environment["OpenXM_HOME"] <> "/bin/math2ox"]
                     41: OxStart["ox_asir"]

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