Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: simple question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99709] Re: [mg99649] simple question
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Mon, 11 May 2009 06:28:35 -0400 (EDT)
  • References: <200905100916.FAA09849@smc.vnet.net>
  • Reply-to: drmajorbob at bigfoot.com

I think you need something like

NestWhile[g, startinglist, Most@#1 =!= Most@#2 &, 2]

or

FixedPoint[g, startinglist, SameTest -> (Most@#1 == Most@#2 &)]

Bobby

On Sun, 10 May 2009 04:16:16 -0500, Francisco Gutierrez  
<fgutiers2002 at yahoo.com> wrote:

> Dear Sirs:
> I have a function whose output is of the form {{a,b,c},{d,e,f},k}
> That is, a list of length 3, of which the first two parts are lists and  
> the last part is a number
> Now, I want to iterate it, with the following termination criterion:  
> stop if the first two parts of the output are identical in two  
> successive runs.
> The intuitive (or naively intuitive if you want) way of attacking the  
> problem, I think, is the following:
> NestWhile[f,startinglist,UnsameQ[{#[[1]],#[[2]]}&,2]
> But it does not work.
> What is the solution?
> Fg
>



-- 
DrMajorBob at bigfoot.com


  • References:
  • Prev by Date: Re: simple Question
  • Next by Date: Re: Problem with 3d graphics on Linux
  • Previous by thread: simple question
  • Next by thread: simple Question