hashing/std:less on mpz

Andrey Vul andrey.vul at gmail.com
Thu Oct 8 07:43:35 CEST 2009


Is there a way to hash mpz types into a operator< -compatible way?
I want to memoize the Ackermann function by using std::map<pr,mpz_class>, where
struct pr { mpz_class x, y;
bool operator<(pr& o) {
if (x==0.x)
return y < o.y;
else
return x < o.x;
};

Is there a gmp function for comparing mpz to mpz?


-- 
Andrey Vul
andrey dot vul at gmail dot com
andrey dot vul at utoronto dot ca

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Google is your friend.


More information about the gmp-discuss mailing list