Glynn Clements wrote: > > Hamish wrote: >> Markus Neteler wrote: >> > since v.what.rast is (for me) extremely slow, I have added >> > cover map support to r.random. >> .. >> > PS: v.what.rast still running on just 300k points while I >> > implemented above :-) Anyone who could make v.what.rast faster? >> >> Maybe it's the qsort(), maybe it's the i,j loop within a loop. > > The loop is certainly inefficient. Rather than shifting the entire > array down every time it finds a duplicate, it should keep separate > source and destination indices, e.g. (untested): > > for (i = j = 0; j < point_cnt; j++) > if (cache[i].cat != cache[j].cat) > cache[++i] = cache[j]; > else > cache[i].count++; > point_cnt = i + 1; > > -- > Glynn Clements <[EMAIL PROTECTED]> >
I am afraid to say that I don't know how to implement the suggestion in v.what.rast... Markus -- View this message in context: http://www.nabble.com/r.random%3A-now-with-optional-cover-map-parameter-tf4634057.html#a13330648 Sent from the Grass - Dev mailing list archive at Nabble.com. _______________________________________________ grass-dev mailing list grass-dev@grass.itc.it http://grass.itc.it/mailman/listinfo/grass-dev