spectral

Parallel algorithm question

Discussion created by spectral on Aug 5, 2011

I explain my needs...

I have an array of 200000 int values, and the first byte contains a 'type/key', something like that :

#define TYPE_1 1
#define TYPE_2 2
#define TYPE_3 4
#define TYPE_4 8 
#define TYPE_5 16 

I would like to count the number of keys by types (number of TYPE_1, TYPE_2, ...).

So, I think that I can use a scan, or there is a better solution ?

Also, my goal is to :
- sort all the int values based on the type
- retreive the number of int/key by type (so here I have 5 values to retreive) 

Maybe there is a way to put this directly in my sort algorithm ?

BTW, for now I use the CLPP library. I will extend it to support this case.

So, if you have some ideas ????

Thanks

Outcomes