MathGroup Archive 2009

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

Search the Archive

Can I do this faster?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102962] Can I do this faster?
  • From: Andreas <aagas at ix.netcom.com>
  • Date: Thu, 3 Sep 2009 05:39:42 -0400 (EDT)

I start with two 2 dimensional lists.  The have equal depths, but may
or may not have equal lengths.  Possible data looks like this:

list1 = RandomReal[{0, 1}, {1500, 3}];
list2 = RandomReal[ExponentialDistribution[2], {1000, 3}];

The following produces the results I need, but takes longer to run
than I'd like:

Rest[FoldList[Times, 1,  Transpose[(t = #; 1 + Inner[Times, t, # - 1,
Plus] & /@ list1) & /@
    list2]]]

Any suggestions rewriting this so I can make it run faster?

Thanks.



  • Prev by Date: re-grouping expressions in mathematica
  • Next by Date: Re: Bug in Solve?
  • Previous by thread: Re: re-grouping expressions in mathematica
  • Next by thread: Re: Can I do this faster?