Re: FixedPoint vs. FixedPointList
- To: mathgroup at smc.vnet.net
- Subject: [mg24442] Re: [mg24384] FixedPoint vs. FixedPointList
- From: Otto Linsuain <linsuain+ at andrew.cmu.edu>
- Date: Tue, 18 Jul 2000 00:58:42 -0400 (EDT)
- References: <B594CE45.759F%andrzej@tuins.ac.jp>
- Sender: owner-wri-mathgroup at wolfram.com
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.