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

Home » Public Forums » archive » Expanding array with counts from another array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Expanding array with counts from another array [message #51519] Thu, 23 November 2006 07:05
G. Lichtenberg is currently offline  G. Lichtenberg
Messages: 2
Registered: November 2006
Junior Member
Hi -
I have a the following problem:
I have two vectors, V with occurring values and C with the number of times
the values occur (both in the correct order and V sorted). I know want to
create an expanded array that contains for each element of V C copies
(loopless if possible). Let's say

V = [3,10,666]
C = [1,2,3]
=>
R = [3,10,10,666,666,666]

(For those who are interested: I use V and C to store a much larger array in
a compact way, but have to expand it again to assign the correct counts to
individual detector pixels - if that makes any sense to you. And I have of
course not three but tens of thousands of values)

I am pretty sure that a solution was probably posted ages ago already, but
could not find it yet. Pointers to a solution are appreciated.

TIA
gl
--
G. Lichtenberg
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Is it really more efficient to work with arrays than FOR loops?
Next Topic: moving average of a large array

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

Current Time: Wed Oct 08 19:43:41 PDT 2025

Total time taken to generate the page: 0.00614 seconds