Hi, GiNaC 1.3.1 is out and available. The changes are: - integral() and eval_integ() can be used from ginsh. - Integrals can be series-expanded. - Fixed a library initialization problem. - GiNaC compiles from tarball even if lex/flex is missing. - Fixed bugs in canonicalize_clifford(), clifford_prime() and clifford_to_lst(). - clifford_moebius_map(), remove_dirac_ONE() and LaTeX output of Clifford objects now care about representation labels. - Fixed bug in gcd. - Better output for slashed expressions. As always, this release can be downloaded from ftp://ftpthep.physik.uni-mainz.de/pub/GiNaC/ Enjoy, Jens
Hello! gcd(a, b, &ca, &cb) seems to [almost] always return gcd (and co-factors) in expanded form. Program below demonstrates this: /** * gcd_demo.cpp Demonstrate bug/feature of GiNaC's gcd */ #include <iostream> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main(int argc, char** argv) { symbol x("x"); symbol y("y"); ex ca, cb; ex a = pow(pow(y,2)-pow(x,2), 10); ex b = pow(pow(x,4)-pow(y,4), 12); ex g = gcd(a, b, &ca, &cb, false); cout << "----------------------------------------------------------" << endl; cout << "a = " << a << endl; cout << "b = " << b << endl; cout << "GCD(a, b) = " << g << endl; cout << "a co-factor = " << ca << endl; cout << "b co-factor = " << cb << endl; cout << "---------------------------------------------------------" << endl; return 0; } The output of this program is ---------------------------------------------------------- a = (y^2-x^2)^10 b = (-y^4+x^4)^12 GCD(a, b) = -120*y^14*x^6+45*y^4*x^16-10*y^2*x^18+45*y^16*x^4-252*y^10*x^10+x^20+y^20+210*y^8*x^12-10*y^18*x^2-120*y^6*x^14+210*y^12*x^8 a co-factor = 1 b co-factor = 22*y^10*x^18+y^28+10*y^26*x^2+x^28+22*y^18*x^10+10*y^2*x^26-264*y^14*x^14+121*y^8*x^20-165*y^16*x^12+43*y^4*x^24+121*y^20*x^8+100*y^6*x^22-165*y^12*x^16+100*y^22*x^6+43*y^24*x^4 --------------------------------------------------------- Sometimes this [mis]feature causes .normal() to do a lot of unnecessary job (in particular, if the expression consists of terms with denominators like \prod(m_i^2-m_j^2)^n), so even with small expressions (about 500 terms) .normal() takes *really* long. Attached patch fixes this behaviour, thus the program above will print ---------------------------------------------------------- a = (y^2-x^2)^10 b = (-y^4+x^4)^12 GCD(a, b) = (-y^2+x^2)^10 a co-factor = 1 b co-factor = (-y^2+x^2)^2*(y^2+x^2)^12 --------------------------------------------------------- -- Best regards, Alexei
participants (2)
-
Jens Vollinga
-
varg@theor.jinr.ru