MathGroup Archive 2005

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

Search the Archive

Re: NestList

  • To: mathgroup at
  • Subject: [mg61462] Re: NestList
  • From: "Jens-Peer Kuska" <kuska at>
  • Date: Wed, 19 Oct 2005 02:17:23 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <dj264l$b6h$>
  • Sender: owner-wri-mathgroup at


and something like

f[Sequence @@ Reverse[Take[l1,-2]]]

will not do it ??


"Dr A.H. Harker" <a.harker at> schrieb im 
Newsbeitrag news:dj264l$b6h$1 at
| Dear All,
|         I suspect I have missed something, but 
what I would really like is
| a function similar to NestList, but where I can 
specify a function f that
| takes more than one argument. Then, if at any 
step of the new function the
| list of previous results is ll, whereas NestList 
will append to ll
| f[ll[[-1]]], the new function would return 
|  Of course I can do this with the existing 
NestList, but as far as I can
| see only by defining my f to work with a list 
{last,lastbutone,...}, in
| which case I end up storing a lot of duplicate 
information in the
| accumulated list.
|  The particular application I have in mind is a 
simple finite difference
| solution of the wave equation, where I might 
want to use NestList rather
| than Nest so that I can animate the results. If 
the simulation involves two
| spatial dimensions, storing duplicate copies of 
the information is a
| significant problem. In fact in my application 
it's better to collect the
| animation frames at rather lower frequency than 
they are calculated, to get
| a reasonable compromise between accuracy and 
visual impact, so I tend not to
| use NestList, but might this extension be useful 
in other areas. Or have I
| just missed a clever trick?
| Tony Harker
| Department of Physics and Astronomy
| University College London
| Gower Street
| WC1E  6BT
| (44)(0)207 679 3404
| a.harker at

  • Prev by Date: Memory use by NMaximize (and NMinimize)
  • Next by Date: Re: Re: Function, Command, Operator, Object...etc.
  • Previous by thread: Re: NestList
  • Next by thread: Speeding up Vector Comparison