MathGroup Archive 2006

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

Search the Archive

Re: Insulating data from code


Thanks, everybody. That was instructive.

For short lists, with Length@Flatten@B < 100 or so,
a version of J. Siehler's code is clearly fastest:

partitionedAz[A_, B_] /; Length@A >= Length@Flatten@B :=
              ReplacePart[B, A, Position[B,_,{-1},Heads->False],
                          Transpose@{Range@Length@Flatten@B}]

For longer lists, a two-stage version of my code is a little faster:

copyPartishun[A_, B_] /; Length@A >= Length@Flatten@B :=
              Map[A[[#]]&, Block[{i=0},Map[++i&,B,{-1}]] ,{-1}]


  • Prev by Date: Installation error
  • Next by Date: Re: Unit sphere triangulation
  • Previous by thread: Re: Insulating data from code
  • Next by thread: queuing network model