[GRASS-dev] [GRASS GIS] #2272: Improve consistency in random generator usage
GRASS GIS
trac at osgeo.org
Fri Oct 24 00:00:52 PDT 2014
#2272: Improve consistency in random generator usage
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Default | Version: svn-releasebranch70
Keywords: random | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):
* priority: critical => major
Comment:
Downgrading priority (or to be closed?).
Replying to [comment:3 neteler]:
> For the record, from grass-dev:
>
> On Sun, Jul 27, 2014 at 1:58 AM, Glynn Clements wrote:
> > Cases which haven't been changed are:
>
> > lib/raster3d/test/test_put_get_value_large_file.c. This appears to be
> > a test case; does it matter?
>
> > include/iostream/quicksort.h uses random() or rand() to select a pivot
> > for the quicksort algorithm. That file has no dependency on lib/gis
> > (or anything else, except for <stdlib.h> for random/rand), and I
> > didn't want to add one unnecessarily.
>
> > Again, this shouldn't affect the result, but there may be performance
> > issues if the size of the array being sorted is significantly larger
> > than RAND_MAX (in this situation, the algorithm will be O(n^2) even in
> > the best case).
>
> > Unless there's a specific reason not to, it may be better to simply
> > replace all uses of that file with std::sort() from <algorithm>.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2272#comment:5>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list