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

Home » Public Forums » archive » Re: Matrix expansion performance
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: Matrix expansion performance [message #43263 is a reply to message #43248] Tue, 29 March 2005 01:55 Go to previous messageGo to previous message
Ricardo Bugalho is currently offline  Ricardo Bugalho
Messages: 22
Registered: March 2005
Junior Member
"Kenneth P. Bowman" <kpb@null.com> wrote in message
news:kpb-E62DD6.07500028032005@news.tamu.edu...
> In article <d28tre$j32$1@pegasus.fccn.pt>,
> "Ricardo Bugalho" <rbugalho@ibili.uc.pt> wrote:
>
>> I have a matrix A (m,n) is and I want to create a matrix B(m,n,p) such
>> that
>> each B(*,*,i) slice equals A. p is very large and n is usually smaller
>> than
>> m so I have:

>
> This should be quite fast, if I understand your problem correctly:

I think I didn't make clear the ranges of m,n and p.
In the problem I have at hand, m is always 8, n is usually 5 (min 1, max 16)
and p is in the range of 10,000 to 100,000.
Looping over p is a BadThing(tm) due to IDL's high interpretation overhead.

>
> B = BYTARR(m,n,p)
> FOR k = 0, p-1 DO B[0,0,k] = A
>
> This will avoid subscript arrays and should access memory efficiently on
> most machines.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Line-Mouse widget tool
Next Topic: IDLWAVE Manuals: Your Support Needed

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

Current Time: Fri Oct 10 22:42:42 PDT 2025

Total time taken to generate the page: 1.12545 seconds