MathGroup Archive 2000

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

Search the Archive

Re: FixedPoint vs. FixedPointList


 Thanks to all that replied, (and to those who thought about the problem
and couldn't find a solution, I thank you too for your time).

 I have gotten two solutions to the problem of counting how many times f
is applied in 

 FixedPoint[f,x], without using FixedPointList

 One solution, proposed by Bob Hanlon and Andrzej Kozlowski, is

 
 FixedPoint[(counter++;f[#])&,x]

 where counter is initialized to zero or one.

 Another solution, proposed by Fred Simons, is

 FixedPoint[f,x, SameTest :> (counter++;yourtest&)]

 I must admit that both solutions kept me confused for a while. I
believe I understand now that the reason they work is because the
expressions before the semicolon produce no output. Thanks again. Otto
Linsuain. 


  • Prev by Date: Re: fade to mauve
  • Next by Date: Re: Plotting Surfaces from data
  • Previous by thread: RE: FixedPoint vs. FixedPointList
  • Next by thread: Re: FixedPoint vs. FixedPointList