[GRASS-dev] r3.univar

Hi devs,
i have written a new raster3d module named r3.univar.
The code is mostly identical with r.univar from Hamish.

I have replaced the qsort with a heapsort function,
because qsort is in the worst case scenario quite slow on large datasets.

Maybe we can put heapsort as library functions into the
grass library, so r.univar and other modules can use them too?
Or is this function already present in grass?

The new module is available here:
http://www-pool.math.tu-berlin.de/~soeren/grass/modules/r3.univar.tar.bz2

Best regards
Soeren

I haven't looked at any of the code, but if as you say it is mostly identical to r.univar then perhaps it might be possible to compile r.univar and r3.univar from the same directory, as is done for r.mapcalc and r3.mapcalc? It would save cloning of code in the source distribution, make bugfixes easier - and an easy way for you to share that new function.
Just an idea,

Paul

On Sat, 17 Feb 2007, [ISO-8859-15] Sören Gebbert wrote:

Hi devs,
i have written a new raster3d module named r3.univar.
The code is mostly identical with r.univar from Hamish.

I have replaced the qsort with a heapsort function,
because qsort is in the worst case scenario quite slow on large datasets.

Maybe we can put heapsort as library functions into the
grass library, so r.univar and other modules can use them too?
Or is this function already present in grass?

The new module is available here:
http://www-pool.math.tu-berlin.de/~soeren/grass/modules/r3.univar.tar.bz2

Best regards
Soeren

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

Hi Paul,
i was thinking about this too, but for a fast functional prototype
i implemented it separately.

Merging is a good idea, i will do it.

Soeren

Paul Kelly schrieb:

I haven't looked at any of the code, but if as you say it is mostly identical to r.univar then perhaps it might be possible to compile r.univar and r3.univar from the same directory, as is done for r.mapcalc and r3.mapcalc? It would save cloning of code in the source distribution, make bugfixes easier - and an easy way for you to share that new function.
Just an idea,

Paul

On Sat, 17 Feb 2007, [ISO-8859-15] Sören Gebbert wrote:

Hi devs,
i have written a new raster3d module named r3.univar.
The code is mostly identical with r.univar from Hamish.

I have replaced the qsort with a heapsort function,
because qsort is in the worst case scenario quite slow on large datasets.

Maybe we can put heapsort as library functions into the
grass library, so r.univar and other modules can use them too?
Or is this function already present in grass?

The new module is available here:
http://www-pool.math.tu-berlin.de/~soeren/grass/modules/r3.univar.tar.bz2

Best regards
Soeren

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

Sören Gebbert wrote:

Hi devs,
i have written a new raster3d module named r3.univar.

It is great to see the r3.* modules maturing well. Thanks!

I have replaced the qsort with a heapsort function,
because qsort is in the worst case scenario quite slow on large datasets.

Maybe we can put heapsort as library functions into the
grass library, so r.univar and other modules can use them too?
Or is this function already present in grass?

see this thread re s.cellstats's qisort() :
http://thread.gmane.org/gmane.comp.gis.grass.devel/14833/focus=15039

I am not responsible for exteneded stats in r.univar so I won't comment
beyond what's found in that thread.

Hamish

Hi all,

2007/2/19, Hamish <hamish_nospam@yahoo.com>:

I am not responsible for exteneded stats in r.univar so I won't comment
beyond what's found in that thread.

qsort is not good for this purpose AFAIK, I vote for merging your code
to r.univar module. Anyway great work Soeren.

Martin

Hamish

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *