These are chat archives for symengine/symengine

Jun 2015
Ondřej Čertík
Jun 14 2015 03:52
@bluescarni thanks, that's interesting. We use unordered_map, I wonder if std::unordered_map or std::unordered_set is faster.
@Sumith1896 try to play with using a shorter integer as well.
Sumith Kulal
Jun 14 2015 09:41
I'll use std::size_t for storing the packed exponents
and try out std::unordered_set too
Francesco Biscani
Jun 14 2015 12:38
@certik I would expect them to be mostly equivalent. The difference is in mostly the way in which you manage the elements: in the set you are storing a single type (the term), int the map you are storing monomials and mapping coefficients to them.
Piranha has one particular optimisation in hash_set with respect to unordered_set: it stores the first element of each bucket within the array of buckets directly. This means that, statistically, most terms can be stored in the set without ever using dynamic memory allocation
Francesco Biscani
Jun 14 2015 14:24
@Sumith1896 The constructor from mpz_t is committed to master
I also added the expand2b performance test
just as an experiment, I ran the test through valgrind in order to see how it was going with memory allocations in the hash set
valgrind reports 2568 total memory allocations to store the 6272 terms result
the breakdown in the hash set for the result is the following:
3625 buckets have only one term (so they do not use any dynamic memory)
1196 buckets have 2 terms
85 buckets have 3 terms
Francesco Biscani
Jun 14 2015 15:07
well to be precise 2568 is the grand total of memory allocations required to compute the result, which in addition to the storage includes some bookkeeping overhead from the multiplication algorithm, thread management, etc.
Ondřej Čertík
Jun 14 2015 17:37
@bluescarni that's very good. I thought you use a perfect hashing algorithm? So all buckets should have just one term?
Francesco Biscani
Jun 14 2015 18:33
@certik it depends what you intend with perfect hash. As it is implemented, Kronecker codification gives you a unique correspondence between a vector of exponents and a (big) integral, but then you have to reduce the integral to the size of the hash set
Abinash Meher
Jun 14 2015 20:41
Does anyone know if there is a main function in symengine library?
Abinash Meher
Jun 14 2015 21:15
I don't think so. nm libsymengine.a | grep -i main returned nothing
Ondřej Čertík
Jun 14 2015 23:01
@abinashmeher999 No, there is no main function in the library. Libraries do not have a main function, only programs.
Ondřej Čertík
Jun 14 2015 23:19

@abinashmeher999 can you post step by step instructions how to compile it?
I checked out #414 and did:

$ sudo apt-get install rake bundler
$ cmake -DWITH_RUBY=yes .
$ make
$ cd src/ruby
$ rake
rake aborted!
cannot load such file -- rake/extensiontask
/home/ondrej/repos/symengine/src/ruby/Rakefile:8:in `<top (required)>'
(See full trace by running task with --trace)

How do I install the rake/extensiontask? I wasn't able to find it online.