MathGroup Archive 2008

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

Search the Archive

Re: List concatenation speed

  • To: mathgroup at
  • Subject: [mg87589] Re: List concatenation speed
  • From: "Szabolcs HorvÃt" <szhorvat at>
  • Date: Mon, 14 Apr 2008 05:41:01 -0400 (EDT)
  • References: <>

On Sun, Apr 13, 2008 at 6:32 PM, Carlos Felippa
<Carlos.Felippa at> wrote:
> Hi,
>  The problem with your solution is that the p's are not
>  available synchronously. They are Graphics objects, some quite
>  complicated, computed sequientally and catenated to form the Show[]
>  list. If I knew their number in advance I could use a Table
>  pre-reservation, say Table[0,{numberofobjects}],
>  to speed collocation.  (I guess I could try that with
>  an overestimate and then do a Take)

Table[] generates the elements sequentially, so it might still be
applicable to the problem.  There are some other functions too, which
collect partial results (NestList, FoldList, FixedPointList are a few
examples).  If it is not possible to express the algorithm with any of
these functions, there is still a fast way to collect results: Sow[]
and Reap[].  They are much faster than Append/AppendTo.


  • Prev by Date: Re: Tooltip with ListPointPlot3D
  • Next by Date: Re: List concatenation speed
  • Previous by thread: Re: List concatenation speed
  • Next by thread: Re: List concatenation speed