MathGroup Archive 2012

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

Search the Archive

Re: fast summing alternative?


On Oct 9, 10:34 pm, Ray Koopman <koop... at sfu.ca> wrote:
> On Oct 8, 9:48 pm, Ray Koopman <koop... at sfu.ca> wrote:> On Oct 7, 11:59
>>
>> tab2 = Transpose @ With[{negnewMat = - newMat}, MapThread[
>>        Dot, {weights, UnitStep[# + negnewMat]} ]& /@ sortMat ]
>
> This should be faster:
>
> tab3 = Transpose[ MapThread[Dot,{weights,#}]& /@ Partition[
>        UnitStep[Plus@@Transpose@Tuples@{sortMat,-newMat}], bNum] ]

This may be marginally faster yet:

tab4 = Transpose@Developer`PartitionMap[ MapThread[Dot,{weights,#}]&,
       UnitStep[Plus@@Transpose@Tuples@{sortMat,-newMat}], bNum]



  • Prev by Date: trouble with obtaining eigenvalue of parametric matrix
  • Next by Date: Simple question on DisplayFormulaNumber cells
  • Previous by thread: Re: fast summing alternative?
  • Next by thread: Grouping graphics that are transformed together