Re: How to parse result from Reduce[ ] function

• To: mathgroup at smc.vnet.net
• Subject: [mg73253] Re: [mg73246] How to parse result from Reduce[ ] function
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Fri, 9 Feb 2007 02:13:46 -0500 (EST)

```soln=Element[C[1], Integers]&&x==358537039003+2964364736430689 C[
1]&&y==28744265823+237656026328741 C[1]&&p==205319+1697566324 C[1];

CoefficientList[soln[[4,2]],C[1]]

{205319,1697566324}

CoefficientList[p/.ToRules[Rest[soln]],C[1]]

{205319,1697566324}

CoefficientList[p/.ToRules[Simplify[soln,Element[C[1], Integers]]],C[1]]

{205319,1697566324}

Cases[soln,p==e_:>CoefficientList[e,C[1]]][[1]]

{205319,1697566324}

Cases[Cases[soln,p==e_:>e],_?NumericQ,3]

{205319,1697566324}

Take[Cases[soln,_?NumericQ,4],-2]

{205319,1697566324}

Bob Hanlon

---- Anton Vrba <antonvrba at yahoo.com> wrote:
> Hi,
>
> The output of a Reduce[...] function call is
>
> C[1](element)Integers &&
> x==358537039003+2964364736430689 C[1] &&
> y==28744265823+237656026328741 C[1] &&
> p==205319+1697566324 C[1]
>
> but I want to use the values  after the p== i.e. 205319 and 1697566324 for further calculation in my program
>
> How do I obtain these? other than by manual cut and paste.
>