MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Is there an "inverse" of ToRules?


Mark,

Two ideas:

    {a->b,{c:>d}}/.r:Rule|RuleDelayed -> Equal

        {a==b,{c==d}}

    ToEquations[(Rule|RuleDelayed)[x_,y_]]:= x==y;
    ToEquations[z_]:= z;

    ToEquations//@{a->b,{c:>d}}

        {a==b,{c==d}}

You might want to flatten the outputs.

--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Mark S. Coleman" <mcoleman at bondspace.com> wrote in message
news:9pjgi4$3fr$1 at smc.vnet.net...
>
> Greetings,
>
> Is there an "inverse" to the ToRules function? That is, a function
> that converts rules to equations (expressed in == form), which could
> then be used in the Solve function?
>
> Thanks,
>
> Mark




  • Prev by Date: Speed me up! Limitation of FindMinimum?
  • Next by Date: Re: Is there an "inverse" of ToRules?
  • Previous by thread: Speed me up! Limitation of FindMinimum?
  • Next by thread: Re: Is there an "inverse" of ToRules?