Floating point code problems

Justin Hickey jhickey at impact1.hpcc.nectec.or.th
Wed Jan 21 06:44:46 EST 1998


Bill

On Jan 14,  9:07am, Bill Brown wrote:
> Subject: Re: Floating point code problems
> Jazzman,
>
> Try using a value greater than your number of rows on the command
> line for v.to.rast ( rows=value ).  I remember seeing that error
> before and I think it worked OK when I used a big rows= value.
>
> I don't remember seeing your problem with r.mask/r.reclass.
>
> Bill
> brown at gis.uiuc.edu
>-- End of excerpt from Bill Brown

Thanks for the work around for v.to.rast, it seems to work fine. Hopefully
Baylor University will fix this problem in their GRASS 5.0 release.

For those of you who are using the floating point code version of GRASS, I
found the bug in r.reclass. Basically, the author was calling G_calloc with a
single argument (like a G_malloc call) instead of the two required by G_calloc.
The fix is as follows:

Line 28 of the file $GIS/src/raster/r.reclass/inter/maketable.c was changed
from

char_table = (char **) G_calloc((max-min+1) * sizeof(char *));

to

char_table = (char **) G_malloc((max-min+1) * sizeof(char *));

The Gmakefile in the r.reclass/inter/ directory actually makes the r.mask
command as well, so this fix takes care of both r.mask and r.reclass. This type
of problem produced an error on my system but it will not necessarily produce
errors on others. I recommend that floating point version users check to make
sure that this problem is fixed on their systems.

Thanks again Bill for your help. It is greatly appreciated.

-- 
Sincerely,

Jazzman (a.k.a. Justin Hickey)  e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do.  ---Anonymous

Jazz and Trek Rule!!!
==================================================================



More information about the grass-user mailing list