Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4891

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

From Ray Koopman <koopman@sfu.ca>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: help to make code run faster (mathematica v8.01)
Date 2011-09-12 08:29 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j4kftd$kic$1@smc.vnet.net> (permalink)
References <j4fhn1$2em$1@smc.vnet.net> <j4i6a7$c0a$1@smc.vnet.net>

Show all headers | View raw


On Sep 11, 4:33 am, Ray Koopman <koop...@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.}]

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

help to make code run faster (mathematica v8.01) kristoph <kristophs.post@web.de> - 2011-09-10 11:29 +0000
  Re: help to make code run faster (mathematica v8.01) Ray Koopman <koopman@sfu.ca> - 2011-09-11 11:33 +0000
    Re: help to make code run faster (mathematica v8.01) Ray Koopman <koopman@sfu.ca> - 2011-09-12 08:29 +0000
    Re: help to make code run faster (mathematica v8.01) kristoph <kristophs.post@web.de> - 2011-09-13 11:27 +0000

csiph-web