Vector types

Marc Glisse marc.glisse at inria.fr
Fri Sep 21 20:38:46 CEST 2012


On Fri, 21 Sep 2012, Иван Вайгульт wrote:

> Hello all,
> I am working on known computional geometry problem (double description
> method). As you know, it is connected with vector operations. Let's
> consider std::vector<mpz_t>. Following the doccumentation, every element
> represents structure with couple sizes and pointers to allocated objects.
> This way is ineffective, every loop over this container will lost processor
> time due to cache misses. We can avoid it using linear memory, i.e. all
> the neighbours elements are alloocated in neighbours memory cells.

What if you need to resize a number? Did you measure that cache misses due 
to this vector take a significant proportion of the time?

(since you are using C++, I'd rather use vector<mpz_class>)

> So, the question: Is there any built-in structure that contatins vector of
> mpz_t objects satisfying cache issues I have listed above?

http://gmplib.org/manual/Integer-Special-Functions.html

-- 
Marc Glisse


More information about the gmp-discuss mailing list