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

Home » Public Forums » archive » Accelerating a one-line program doing matrix multiplication
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: Accelerating a one-line program doing matrix multiplication [message #72757 is a reply to message #72696] Wed, 29 September 2010 08:24 Go to previous message
Axel Martínez is currently offline  Axel Martínez
Messages: 22
Registered: June 2010
Junior Member
On Sep 29, 4:49 pm, chris <rog...@googlemail.com> wrote:
> On 29 Sep., 12:48, Axel M <axe...@gmail.com> wrote:
>
>> I have to admit that I did not understand this proposed use of
>> REPLICATE:
>
>>>> sometimes (replicate({temp:input},newsize)).(0) is faster then rebin
>
>> But it brought me a related question in mind: does IDL have a
>> "REPLICATE" function for vectors instead of scalar values? I am using
>> REBIN, but REBIN is thought for more advanced uses and probably
>> suboptimal for a "replicate-like" use... right?
>
> Yes, it has as I mentioned uncommented above:
>
> sometimes (replicate({temp:input},newsize)).(0) is faster then rebin
>
> -> this means:
>
> IDL> a=findgen(3)
> IDL> print,a
>      0.000000      1.00000      2.00000
> IDL> print, rebin(a,3,5)
>      0.000000      1.00000      2.00000
>      0.000000      1.00000      2.00000
>      0.000000      1.00000      2.00000
>      0.000000      1.00000      2.00000
>      0.000000      1.00000      2.00000
> IDL> print, (replicate({temp:a},5)).(0)
>      0.000000      1.00000      2.00000
>      0.000000      1.00000      2.00000
>      0.000000      1.00000      2.00000
>      0.000000      1.00000      2.00000
>      0.000000      1.00000      2.00000
>
> Regards
>
> CR

Thanks!!

Great, I did not know about this construction, and honestly I do not
understand how it works (is there any documentation about it?).
Anyways, I tried it, and unfortunately I saw that it needed ~20%
longer (the complete function, not the rebin only). So, it is not
faster.. but it is great though.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to pass NCDF files name to text files names?
Next Topic: while running mdefringe.pro

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

Current Time: Sun Oct 12 13:11:12 PDT 2025

Total time taken to generate the page: 1.04416 seconds