comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Quickest method for calculation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Quickest method for calculation [message #71060 is a reply to message #71059] Mon, 24 May 2010 07:39 Go to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On May 24, 7:25 am, jaz <jazpear...@gmail.com> wrote:
> Due to the size of the simulations i'm running, my programs are
> incredibly memory intensive.
>
> As a result, some of the calculations are taking quite a large amount
> of time to compute. Here is an example:
>
> These are the array sizes:-
>
> top_tem = fltarr(200000,2002)
> y.rho = fltarr(200000,2002)
> temperature =  fltarr(200000,2002)
>
> and this is one of the calculations i do, which takes quite a while:
>
> top_tem = TEMPORARY(top_tem) + (y.rho^2.0 * temperature)
>
> i use TEMPORARY so that it doesn't eat up much memory.
> But, is there a better way to do this calculation? Would it be better
> to break it up somehow?
>
> Any advice would be great.

Well, you can use the += operator, I dunno if that will help.
However, instead of squaring, you should do y.rho*y.rho.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Landsat HDF
Next Topic: SAVE again

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Tue Oct 21 22:48:08 PDT 2025

Total time taken to generate the page: 3.04801 seconds