Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3941 > unrolled thread

Re: From Reduce to List

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-07-24 07:21 +0000
Last post2011-07-24 07:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: From Reduce to List DrMajorBob <btreat1@austin.rr.com> - 2011-07-24 07:21 +0000

#3941 — Re: From Reduce to List

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-07-24 07:21 +0000
SubjectRe: From Reduce to List
Message-ID<j0gh50$bcv$1@smc.vnet.net>
(a == 1001 && b == 1001000) || (a == 1002 &&
     b == 501000) || (a == 1004 && b == 251000) /. {Or -> List,
   And -> List, Equal[_, x_] :> x}

{{1001, 1001000}, {1002, 501000}, {1004, 251000}}

or

expr = (a == 1001 && b == 1001000) || (a == 1002 &&
      b == 501000) || (a == 1004 && b == 251000);
{a, b} /. List[expr // ToRules]

{{1001, 1001000}, {1002, 501000}, {1004, 251000}}

Bobby

On Sat, 23 Jul 2011 18:54:16 -0500, Harvey P. Dale <hpd1@nyu.edu> wrote:

> 	What is the easiest and most efficient way to transform the
> output from Reduce into a list of values?  For example, if Reduce
> produces
> (a==1001&&b==1001000)||(a==1002&&b==501000)||(a==1004=
> &&b==251000) and I
> want {{1001,1001000},{1002,501000},{1004,251000}}, what is the best way
> to go from the former to the latter?
>
> 	Harvey
>
> Harvey P. Dale
> University Professor of Philanthropy and the Law
> Director, National Center on Philanthropy and the Law
> 139 MacDougal Street
> New York, N.Y. 10012-1076
> Tel: 212-998-6161
> Fax: 212-995-3149
>


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web