Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 16 23:10
    mseri starred bluescarni/piranha
  • Jul 08 11:19
    krishnakumarg1984 starred bluescarni/piranha
  • Jun 14 07:08
    d-vyd commented #148
  • Jun 14 06:17
    bluescarni commented #148
  • Jun 14 06:15
    bluescarni commented #148
  • Jun 14 05:35
    d-vyd commented #148
  • Jun 14 00:57
    ajacquey starred bluescarni/piranha
  • Jun 13 11:42
    bluescarni commented #148
  • Jun 08 09:40
    d-vyd commented #148
  • Jun 07 16:05
    d-vyd commented #148
  • Jun 07 13:37
    bluescarni commented #148
  • Jun 07 13:36
    bluescarni commented #148
  • Jun 05 06:54
    d-vyd opened #148
  • May 19 22:47
    orkolorko starred bluescarni/piranha
  • Apr 01 13:13
    mikeheddes commented #147
  • Apr 01 13:04
    bluescarni commented #147
  • Mar 30 09:18
    mikeheddes synchronize #147
  • Mar 30 07:43
    mikeheddes edited #147
  • Mar 29 17:27
    bluescarni edited #147
  • Mar 29 16:51
    mikeheddes edited #147
Andrew Corrigan
@andrewcorrigan
when you do: it->m_key.print(oss_key, args); what is m_key's actual type?
where is that print function coming from?
Francesco Biscani
@bluescarni
m_key is a piranha::monomial<int>. The print() function is a method of the piranha::monomial<int> class
Andrew Corrigan
@andrewcorrigan
oh ok
so does every monomial in a polynomial store exponents for every single variable ?
it looks like each monomial is printed using the full polynomial.get_symbol_set()
Francesco Biscani
@bluescarni
yes. monomials are essentially just dense vectors of exponents
Andrew Corrigan
@andrewcorrigan
I think it's making sense :smile:
Francesco Biscani
@bluescarni
in order to "know" the name of the variable to which an exponent correponds, the print() function needs to also the symbol set to be passed to it
Andrew Corrigan
@andrewcorrigan
I see that now, thank you
Francesco Biscani
@bluescarni
otherwise, from the monomial's point of view it's just a sequence of numerical exponents
sure np
if you have good ideas for a customisable printing API, please share :)
Andrew Corrigan
@andrewcorrigan
come to think of it, I think it's easier to just traverse the polynomial
not just for printing
Francesco Biscani
@bluescarni
yeah probably... btw, the terms are unordered in the polynomial, so if you need to print the lowest degree terms first (for instance), you'll have to sort the terms. One possible way is to traverse the polynomial storing pointers to the terms in a vector, and then sort that vector according to whatever sorting order you need
Andrew Corrigan
@andrewcorrigan
oh ok, I'm not too worried about that
but thanks for explaining that
before I forget, is this: https://arxiv.org/abs/0907.2076 the paper to cite?
Francesco Biscani
@bluescarni
there's no paper (yet) for the modern version of piranha unfortunately. I have registered a DOI with zenodo, so for the time being this should be used for citation https://zenodo.org/record/246239
there's a bibtex export thingie on the bottom right of the page
Andrew Corrigan
@andrewcorrigan
got it
Francesco Biscani
@bluescarni
cheers
Andrew Corrigan
@andrewcorrigan
sorry, one more question
I noticed that the print method in monomial changed
I think the newer version loops over with: for (decltype(args.size()) i = 0; std::get<1>(sbe) != std::get<2>(sbe); ++i, ++std::get<1>(sbe), ++it_args) { vs. the older version which loops over with for (typename base::size_type i = 0u; i < this->size(); ++i) {
When I print out the dereference of it_args using the older code, it prints out like: name = '_dx(1)'
instead of just _dx(1)
which approach is preferable?
Francesco Biscani
@bluescarni
the symbol name is just _dx(1) right? (without the quotes)
ah right I see now. In the curren git version of piranha, symbols have become just plain strings, so when you print them you just print the plain content of the string representing that symbol
in earlier versions the symbol was a separate class, and its overloaded operator would place '' quotes around the symbol name when printed to screeen
Andrew Corrigan
@andrewcorrigan
which would you recommend I use?
I'd prefer to stick with the newer version
Francesco Biscani
@bluescarni
I think that's better yes.
Andrew Corrigan
@andrewcorrigan

I tried the newer version, but hit some errors trying to build: ```CMake Error at CMakeLists.txt:89 (find_package):
By not providing "Findmp++.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "mp++", but
CMake did not find one.

Could not find a package configuration file provided by "mp++" (requested
version 0.8) with any of the following names:

mp++Config.cmake
mp++-config.cmake

```

Francesco Biscani
@bluescarni
The most recent version of piranha now depends on the mp++ library, which is available here https://github.com/bluescarni/mppp
Francesco Biscani
@bluescarni
let me know if you need help with that
Andrew Corrigan
@andrewcorrigan
Thank you.
Andrew Corrigan
@andrewcorrigan
Does Piranha guarantee anything about the signs of rational numbers:
for example, if I have a positive rational number r, does that imply both r.den() and r.num() are positive?
if I have a negative rational number r, is there any guarantee that only r.num() is negative? or could den() be negative instead?
Francesco Biscani
@bluescarni
rationals are always represented in a canonical form: denominator is strictly positive, numerator and denominator are coprime. Only the numerator can be signed.
Andrew Corrigan
@andrewcorrigan
thanks!
Christopher Iliffe Sprague
@cisprague
Can Phiranna do symbolic optimisation?
Francesco Biscani
@bluescarni
@cisprague piranha does not have any optimsation functionality implemented, it just does symbolic manipulation of certain classes of objects.
Andrew Corrigan
@andrewcorrigan
Following up on multi-threading: I noticed that internally Piranha uses threads, mutex, etc. When I run my code, I also noticed that the speed-up maxed out at approximately 2x even when many cores are available, and for an operation that appears to be embarrassingly parallel. I understand the limitations of multi-threading (n cores does not necessarily lead to n-fold speedups), but wanted to clarify:
Is Piranha attempting to use multiple threads by default? If so, is it possible to disable that, so that I can attempt multi-threading exclusively at a higher-level, from within my application?
Francesco Biscani
@bluescarni

@andrewcorrigan yes, piranha does use multithreading internally. At the moment, it is effective for very large sparse polynomial multiplications, and in theory it should have some heuristic to decide that, if the workload is too small, it is not worth it to enable the parallel code path. However, the heuristic could probably be improved.

In any case, you can set the number of threads to 1 in the global settings, this should disable the use of threads.

#include <piranha/settings.hpp>

piranha::settings::set_n_threads(1);

This should do it.

Andrew Corrigan
@andrewcorrigan
thanks!