the c++ function
gmp_randclass::gmp_randclass()
is obsolete and should be deleted , is that all of the code below ? or what
Thanks
Jason
In mpirxx.h at line 3211 we have the following
class gmp_randclass
{
private:
gmp_randstate_t state;
// copy construction and assignment not allowed
gmp_randclass(const gmp_randclass &);
void operator=(const gmp_randclass &);
public:
// constructors and destructor
gmp_randclass(gmp_randalg_t alg, unsigned long int size)
{
switch (alg)
{
case GMP_RAND_ALG_LC: // no other cases for now
default:
gmp_randinit_lc_2exp_size(state, size);
break;
}
}
// gmp_randinit_default
gmp_randclass(__gmp_randinit_default_t* f) { f(state); }
// gmp_randinit_lc_2exp
gmp_randclass(__gmp_randinit_lc_2exp_t* f,
mpz_class z, unsigned long int l1, unsigned long int l2)
{ f(state, z.get_mpz_t(), l1, l2); }
// gmp_randinit_lc_2exp_size
gmp_randclass(__gmp_randinit_lc_2exp_size_t* f,
unsigned long int size)
{
if (f (state, size) == 0)
throw std::length_error ("gmp_randinit_lc_2exp_size");
}
~gmp_randclass() { gmp_randclear(state); }
// initialize
void seed(); // choose a random seed some way (?)
void seed(unsigned long int s) { gmp_randseed_ui(state, s); }
void seed(const mpz_class &z) { gmp_randseed(state, z.get_mpz_t()); }
// get random number
__gmp_expr<mpz_t, __gmp_urandomb_value> get_z_bits(unsigned long int l)
{ return __gmp_expr<mpz_t, __gmp_urandomb_value>(state, l); }
__gmp_expr<mpz_t, __gmp_urandomb_value> get_z_bits(const mpz_class &z)
{ return get_z_bits(z.get_ui()); }
__gmp_expr<mpz_t, __gmp_urandomm_value> get_z_range(const mpz_class &z)
{ return __gmp_expr<mpz_t, __gmp_urandomm_value>(state, z); }
__gmp_expr<mpf_t, __gmp_urandomb_value> get_f(unsigned long int prec = 0)
{ return __gmp_expr<mpf_t, __gmp_urandomb_value>(state, prec); }
};
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"mpir-devel" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/mpir-devel?hl=en
-~----------~----~----~----~------~----~------~--~---