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


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

Optimizing For loop statement

From "tarpanelli@libero.it" <tarpanelli@libero.it>
Newsgroups comp.soft-sys.math.mathematica
Subject Optimizing For loop statement
Date 2013-02-21 03:26 +0000
Message-ID <kg445l$r5b$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


Hello, here below you can find a piece of Mathematica code:
...
For[i=3,i<=n,i++,
s=sigma[a,b,c]
vol=ReplacePart[vol,{{i,1}->x[[i]],{i,2}->s}];
Clear[b];
b=Interpolation[vol];
];
 
where sigma is a module which take as input parameters two scalars (a,c) and one interpolating function (b).
What I need is to update the data (vol), on which the interpolating function is built, according to the new result of the module sigma which takes, itsself, the interpolating function as input parameter.
 
I see that the For loop statement is really time-consuming, and I would like to know if it is possible to ptimize it.
thanks a lot
Paolo

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


Thread

Optimizing For loop statement "tarpanelli@libero.it" <tarpanelli@libero.it> - 2013-02-21 03:26 +0000
  Re: Optimizing For loop statement David Bailey <dave@removedbailey.co.uk> - 2013-02-22 06:05 +0000

csiph-web