Coefficient sizes [was: Re: [PPL-devel] Tinderbox status]

Roberto Bagnara bagnara at cs.unipr.it
Thu Sep 22 11:54:27 CEST 2005


Matthew Mundell wrote:
>>>4) the matasciidumpload1 test fails for some choices of the
>>>    Coefficient type.
>>
>>This is just from the size of random numbers being generated in the
>>test.  I'm on it.
> 
> 
> For this test I'd like to generate a positive random number within the
> bounds of the coefficient type.  This requires the size of the
> coefficient type.  Is there an existing way to this size?
> 
> I've thought of defining a directive in configure.ac, say
> COEFFICIENT_RAW_TYPE, and then calculating the random number as
> follows.
> 
>     #if defined(NATIVE_INTEGERS) || defined(CHECKED_INTEGERS)
>           tem = rand() % std::numeric_limits<COEFFICIENT_RAW_TYPE>::max();
>     #else
>           tem = rand();
>     #endif
> 
> Is there a better way to do this?

I don't think this is the right way to do it.  Why do you need to modify
configure.ac?  We should have the specializations of std::numeric_limits
also for checked numbers (I am sure I raised this point with Abramo
in the past).  If we don't have them, we should add them.

Abramo?  Are they done?  If not, do you prefer to add them or to give
some pointers to Matthew about how/where to add them?
Ciao,

    Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the PPL-devel mailing list