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

Home » Public Forums » archive » faster then where possible?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
faster then where possible? [message #66276] Thu, 07 May 2009 08:06 Go to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
Hi,
i'm searching for some alternative approaches to compute the following
"much" faster:

-> matrix1 has m columns and n rows, matrix2 has 2 columns and n rows
-> the values in matrix2 are NOT in matrix1, but within the min-max-
range of matrix1

szm1=size(matrix1,/dimensions)
szm2=size(matrix2,/dimensions)
index={ind:ptr_new()}
indices=replicate(index,szm2[1])

for j=0ull,szm1[1] do begin
helpindex= where(matrix1[*,j] ge matrix2[0,j] and matrix1[*,j] le
matrix2[1,j],c)
if c gt 0 then begin
indices[j] = ptr_new(uintarr(c))
(*indices)[j]=helpindex
endif else continue
endfor

It seems to be a typical Nearest-Neighbor-Problem, but all alternative
approaches I tried were always slower. Maybe someone here has a good
idea?

Thank you and best regards

Christian
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 7.1 True color postscript
Next Topic: Re: What is the advantage for IDL to run in background?

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

Current Time: Thu Oct 09 22:06:37 PDT 2025

Total time taken to generate the page: 0.15910 seconds