       Re: Parse results from Solve

• To: mathgroup at smc.vnet.net
• Subject: [mg73935] Re: Parse results from Solve
• From: Bhuvanesh <lalu_bhatt at yahoo.com>
• Date: Sat, 3 Mar 2007 01:10:17 -0500 (EST)

```One way is to use Select:

In:= sols= {{x->0,y->0},{x->1,y->2}};

In:= Select[sols, x!=y /. # &]

Out= {{x -> 1, y -> 2}}

In:= Select[sols, y>1 /. # &]

Out= {{x -> 1, y -> 2}}

In:= ?Select
Select[list, crit] picks out all elements ei of list for which crit[ei] is True.
Select[list, crit, n] picks out the first n elements for which crit[ei] is True.

If you want to turn the result into something that Reduce could use, you could do something like:

Or@@Map[And@@#&, sols /. Rule->Equal]

This changes the rules to equalities, turns the inner lists into conjunctions (And) and the outer one into a disjunction (Or).

In:= Or@@Map[And@@#&, sols /. Rule->Equal]

Out= (x == 0 && y == 0) || (x == 1 && y == 2)

Bhuvanesh,
Wolfram Research.

```

• Prev by Date: Re: Problems with simplify and Sqrt[a^2]
• Next by Date: Re: Parse results from Solve
• Previous by thread: Re: Parse results from Solve
• Next by thread: Re: Parse results from Solve