MathGroup Archive 2011

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

Search the Archive

Re: help to make code run faster (mathematica v8.01)


On Sep 11, 4:33 am, Ray Koopman <koop... at sfu.ca> wrote:
>
> Think in terms of vectors:
>
> 1.5 Times @@ Transpose@Subsets[fit["FitResiduals"],{2}] .
>   Clip[1. - ((Subtract @@ Transpose@Subsets[reg,{2}])/h)^2, {0.,1.}]

This is about 10% faster. There are several variants of this that are
just about as fast, so experiment a little.

(-1.5/h^2) Times @@ Transpose@Subsets[fit["FitResiduals"],{2}] .
  Clip[(Subsets[reg,{2}].{1.,-1.})^2 - h^2, {-h^2,0.}]




  • Prev by Date: Step increase in Table
  • Next by Date: Re: Texture in version 8, fine, but don't export...?
  • Previous by thread: Re: help to make code run faster (mathematica v8.01)
  • Next by thread: Re: help to make code run faster (mathematica v8.01)