From lasaruk at uni-passau.de Mon Nov 8 11:39:11 2010 From: lasaruk at uni-passau.de (Aless Lasaruk) Date: Mon, 8 Nov 2010 11:39:11 +0100 Subject: [GiNaC-devel] CLN linker issue Message-ID: <688E4C4C-3386-4963-9A21-9770FDD498B9@uni-passau.de> Dear GiNaC developers, i have noticed that the default build of GiNaC from the release tars does not seem to link against the CLN-library. My configuration: Mac OSX Leopard GiNaC 1.5.8 release (from scratch: untar, configure, make, make install). GNU from mac ports. This results in strange linker behaviour, when working with the "numeric" class: Undefined symbols: "cln::cl_free_heap_object(cln::cl_heap*)", referenced from: cln::cl_gc_dec_pointer_refcount(cln::cl_heap*) in numeric.cpp.o ld: symbol(s) not found collect2: ld returned 1 exit status I suppose, this linker error is heavy to understand for beginners, so i suggest to fix or document this issue. With best regards, Aless -- Aless Lasaruk Scientific Assistant, FORWISS Room 204, ITZ, Innstrasse 43 Universit?t Passau D-94030 Passau (Germany) Mail: lasaruk at uni-passau.de Tel.: +49(0)851/509-3173 Fax : +49(0)851/509-3142 From alexei.sheplyakov at gmail.com Mon Nov 8 15:36:52 2010 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Mon, 8 Nov 2010 16:36:52 +0200 Subject: [GiNaC-devel] msvc support patches Message-ID: <20101108143641.GA10822@vargsbox.jinr.ru> Hello, Jens, could you please pull from git://github.com/AlexeiSheplyakov/GiNaC.git master.msvc.support The following changes since commit cbb93fadabbd56ba006902967b15b2b2aebb037c: mul: algebraic_subs_mul(), has(): don't write beyond the end of array (2010-10-09 18:39:41 +0200) are available: Jan Rheinl?nder (7): clifford: fix a few GCCisms (or, not). symmetry::compare_same_type(): const-correctness fix Add few defines for msvc (__func__, __alignof__). [msvc] Work around strange scoping and name mangling rules. [msvc] Yet another compiler bug work around. [msvc] msvc cannot handle string constants above 16k Omit extra qualification (as in struct foo f() vs foo f()). check/time_uvar_gcd.cpp | 35 +++++++++++++++++++++++------------ ginac/clifford.cpp | 6 +++--- ginac/compiler.h | 5 +++++ ginac/ex.h | 12 +++++++++++- ginac/exprseq.cpp | 6 ++++++ ginac/parser/parse_binop_rhs.cpp | 2 +- ginac/parser/parser.cpp | 3 +-- ginac/polynomial/collect_vargs.cpp | 2 +- ginac/symmetry.cpp | 2 +- 9 files changed, 52 insertions(+), 21 deletions(-) Best regards, Alexei From alexei.sheplyakov at gmail.com Mon Nov 8 15:41:06 2010 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Mon, 8 Nov 2010 16:41:06 +0200 Subject: [GiNaC-devel] [PATCH] power::series(): handle some (trivial) singularities of the exponent... Message-ID: <20101108144106.GA11247@vargsbox.jinr.ru> ... so GiNaC can expand expressions like cos(x)^(sin(x)/x) // (x -> 0) (1 + x)^(1/x) // x -> 0 and so on. --- ginac/pseries.cpp | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/ginac/pseries.cpp b/ginac/pseries.cpp index 4a8d7d6..c290fe0 100644 --- a/ginac/pseries.cpp +++ b/ginac/pseries.cpp @@ -1116,6 +1116,29 @@ ex power::series(const relational & r, int order, unsigned options) const must_expand_basis = true; } + bool exponent_is_regular = true; + try { + exponent.subs(r, subs_options::no_pattern); + } catch (pole_error) { + exponent_is_regular = false; + } + + if (!exponent_is_regular) { + ex l = exponent*log(basis); + // this == exp(l); + ex le = l.series(r, order, options); + // Note: expanding exp(l) won't help, since that will attempt + // Taylor expansion, and fail (because exponent is "singular") + // Still l itself might be expanded in Taylor series. + // Examples: + // sin(x)/x*log(cos(x)) + // 1/x*log(1 + x) + return exp(le).series(r, order, options); + // Note: if l happens to have a Laurent expansion (with + // negative powers of (var - point)), expanding exp(le) + // will barf (which is The Right Thing). + } + // Is the expression of type something^(-int)? if (!must_expand_basis && !exponent.info(info_flags::negint) && (!is_a(basis) || !is_a(exponent))) -- 1.7.2.3 From git at ginac.de Tue Nov 9 09:07:20 2010 From: git at ginac.de (Richard B. Kreckel) Date: Tue, 9 Nov 2010 09:07:20 +0100 (CET) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-253-g1d73fed Message-ID: <20101109080720.B5115F001C7@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via 1d73fed17debbc88819dc7f84a4a2e608d8eb978 (commit) from 052f124551d2b78104b0de2008db6b8819713625 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1d73fed17debbc88819dc7f84a4a2e608d8eb978 Author: Alexei Sheplyakov Date: Tue Nov 9 08:27:47 2010 +0100 power::series(): handle someg (trivial) singularities of the exponent... ... so GiNaC can expand expressions like cos(x)^(sin(x)/x) // (x -> 0) (1 + x)^(1/x) // x -> 0 and so on. [Reported by Camille Gillot.] (cherry picked from commit 079c558d4f9758cd2777a2808a02d64cb1f70c8e) ----------------------------------------------------------------------- Summary of changes: check/exam_pseries.cpp | 18 ++++++++++++++++++ ginac/pseries.cpp | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Tue Nov 9 09:07:20 2010 From: git at ginac.de (Richard B. Kreckel) Date: Tue, 9 Nov 2010 09:07:20 +0100 (CET) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-234-g079c558 Message-ID: <20101109080720.CE4FFF00149@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via 079c558d4f9758cd2777a2808a02d64cb1f70c8e (commit) from cbb93fadabbd56ba006902967b15b2b2aebb037c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 079c558d4f9758cd2777a2808a02d64cb1f70c8e Author: Alexei Sheplyakov Date: Tue Nov 9 08:27:47 2010 +0100 power::series(): handle someg (trivial) singularities of the exponent... ... so GiNaC can expand expressions like cos(x)^(sin(x)/x) // (x -> 0) (1 + x)^(1/x) // x -> 0 and so on. [Reported by Camille Gillot.] ----------------------------------------------------------------------- Summary of changes: check/exam_pseries.cpp | 18 ++++++++++++++++++ ginac/pseries.cpp | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From kreckel at ginac.de Tue Nov 9 09:13:20 2010 From: kreckel at ginac.de (Richard B. Kreckel) Date: Tue, 09 Nov 2010 09:13:20 +0100 Subject: [GiNaC-devel] CLN linker issue In-Reply-To: <688E4C4C-3386-4963-9A21-9770FDD498B9@uni-passau.de> References: <688E4C4C-3386-4963-9A21-9770FDD498B9@uni-passau.de> Message-ID: <4CD902A0.2070609@ginac.de> Hi! On 11/08/2010 11:39 AM, Aless Lasaruk wrote: > i have noticed that the default build of GiNaC from the release tars > does not seem to link against the CLN-library. > > My configuration: > > Mac OSX Leopard This must be a Mac OSX issue because, on Linux, it does link against libcln just fine. > I suppose, this linker error is heavy to understand for beginners, so i > suggest to fix or document this issue. If you sent a patch, we will have a look at it. -richy. -- Richard B. Kreckel From alexei.sheplyakov at gmail.com Tue Nov 23 17:31:45 2010 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Tue, 23 Nov 2010 18:31:45 +0200 Subject: [GiNaC-devel] [PATCH] [bugfix] chinrem_gcd: handle polynomials over rationals properly. Message-ID: <20101123163145.GA30584@vargsbox.jinr.ru> * extract_integer_content(): integer_content() can also return a rational number, e.g if the expression is a polynomial over rationals (in this case expr/content is polynomial over integers with integer content being 1). Therefore check if integer_content() is really an integer (and if it's not just return 1, GCD for polynomials over a field is defined up to arbitrary element of the field). This fixes possible segfault when computing GCD of polynomials over rationals (this is not theoretical, see the added test case). --- check/bugme_chinrem_gcd.cpp | 18 ++++++++++++++++-- ginac/polynomial/mgcd.cpp | 10 ++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/check/bugme_chinrem_gcd.cpp b/check/bugme_chinrem_gcd.cpp index d3c0330..87c718c 100644 --- a/check/bugme_chinrem_gcd.cpp +++ b/check/bugme_chinrem_gcd.cpp @@ -38,13 +38,27 @@ static const std::string p1_srep("\ static const std::string p2_srep("\ 1882371920+29943249139*x^9-21558061051*x^35+24497174109*x^69+3363043648*x^25+5186524611*x^98-17753230977*x^56+16461882236*x^72+11039962159*x^11-85814533599*x^43-12986831645*x^85+4813620791*x^29-2133682609*x^2+9141433582*x^88-14841292646*x^13+19494168654*x^51-426278523*x^15-18246235652*x^59-12424469513*x^16-14414308862*x^38-16262001424*x^75+1584505491*x^3+6616907060*x^46+9411879011*x^91+7056872613*x^20+29675566382*x^78-48441925739*x^54+12038293769*x^33-22463329638*x^65+21957440404*x^41+26252749471*x^81-28689993421*x^24+1190623161*x^94-3323333429*x^62+778770195*x^68-23673866858*x^49+10263027507*x^97+29115114125*x^28-34230002076*x^36-217623403*x^71-6344703601*x^84+2789684836*x^100-44973929094*x^57-6061422988*x^44+18964048763*x^87+3160532878*x^8-8039690791*x^19-5750277357*x^74+5544486596*x^23+1800283356*x^90-8174921854*x^52+2577247520*x^64-1088265300*x^10+18566882873*x^39+12678193001*x^77-7204610489*x^27+9980611956*x^60+12672890141*x^80+4463462090*x^12-30937311949*x^47-3883570155*x^93+7561875663*x^14-3850452489*x^55+20714527103*x^31-9973372012*x^34+440594870*x^67+10385086102*x^96-20693764726*x^63+11049483001*x^18-11578701274*x^70-5548876327*x^42+20393397488*x^83+20531692560*x^50+1309311388*x^99-7521320830*x-2750892631*x^37-6001481047*x^73+7149046134*x^22+10287410396*x^86+7332053562*x^58-1135211878*x^4-7420079075*x^45+9742202475*x^89-214559874*x^26+29530802947*x^30-2280622009*x^32-4237029618*x^5+13760397067*x^76+18073788685*x^53+2485463829*x^40+1889202286*x^79+8841198971*x^6+13562767020*x^92+110919258*x^7+6961020716*x^61+11700952246*x^17-13528331424*x^66-19801882818*x^21+25061328813*x^82+1553111326*x^48+4638169279*x^95"); -int main(int argc, char** argv) +static void check_poly_cra() { - cout << "checking for bugs in poly_cra() " << flush; parser the_parser; ex p1 = the_parser(p1_srep); ex p2 = the_parser(p2_srep); ex g = chinrem_gcd(p1, p2); +} + +static void check_extract_integer_content() +{ + parser readme; + ex A = readme("1/282901891126422365*(x + y)"); + ex B = readme("165888/282901891126422365*(x - y)"); + ex g = chinrem_gcd(A, B); +} + +int main(int argc, char** argv) +{ + cout << "checking for bugs in poly_cra() and friends " << flush; + check_poly_cra(); + check_extract_integer_content(); cout << "not found."; return 0; } diff --git a/ginac/polynomial/mgcd.cpp b/ginac/polynomial/mgcd.cpp index 24da934..5b9da12 100644 --- a/ginac/polynomial/mgcd.cpp +++ b/ginac/polynomial/mgcd.cpp @@ -30,6 +30,9 @@ #include // std::accumulate #include +#include +#include +#include namespace GiNaC { @@ -37,6 +40,13 @@ static cln::cl_I extract_integer_content(ex& Apr, const ex& A) { static const cln::cl_I n1(1); const numeric icont_ = A.integer_content(); + if (cln::instanceof(icont_.to_cl_N(), cln::cl_RA_ring)) { + Apr = (A/icont_).expand(); + // A is a polynomail over rationals, so GCD is defined + // up to arbitrary rational number. + return n1; + } + GINAC_ASSERT(cln::instanceof(icont_.to_cl_N(), cln::cl_I_ring)); const cln::cl_I icont = cln::the(icont_.to_cl_N()); if (icont != 1) { Apr = (A/icont_).expand(); -- 1.7.2.3 From git at ginac.de Tue Nov 23 21:54:16 2010 From: git at ginac.de (Richard B. Kreckel) Date: Tue, 23 Nov 2010 21:54:16 +0100 (CET) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-254-gd41f753 Message-ID: <20101123205416.B3408F00134@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via d41f7533018d9f9444c98466432e4d84deedaa04 (commit) from 1d73fed17debbc88819dc7f84a4a2e608d8eb978 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d41f7533018d9f9444c98466432e4d84deedaa04 Author: Alexei Sheplyakov Date: Tue Nov 23 17:45:52 2010 +0100 [bugfix] chinrem_gcd: handle polynomials over rationals properly. * extract_integer_content(): integer_content() can also return a rational number, e.g if the expression is a polynomial over rationals (in this case expr/content is polynomial over integers with integer content being 1). Therefore check if integer_content() is really an integer (and if it's not just return 1, GCD for polynomials over a field is defined up to arbitrary element of the field). This fixes possible segfault when computing GCD of polynomials over rationals (this is not theoretical, see the added test case). Thanks to Ernst Moritz Hahn for reporting this bug. (cherry picked from commit 3d09388a8ea144a19949c216fae43ccba92e47aa) ----------------------------------------------------------------------- Summary of changes: check/bugme_chinrem_gcd.cpp | 18 ++++++++++++++++-- ginac/polynomial/mgcd.cpp | 10 ++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Tue Nov 23 21:54:16 2010 From: git at ginac.de (Richard B. Kreckel) Date: Tue, 23 Nov 2010 21:54:16 +0100 (CET) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-235-g3d09388 Message-ID: <20101123205416.E6B16F00079@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via 3d09388a8ea144a19949c216fae43ccba92e47aa (commit) from 079c558d4f9758cd2777a2808a02d64cb1f70c8e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3d09388a8ea144a19949c216fae43ccba92e47aa Author: Alexei Sheplyakov Date: Tue Nov 23 17:45:52 2010 +0100 [bugfix] chinrem_gcd: handle polynomials over rationals properly. * extract_integer_content(): integer_content() can also return a rational number, e.g if the expression is a polynomial over rationals (in this case expr/content is polynomial over integers with integer content being 1). Therefore check if integer_content() is really an integer (and if it's not just return 1, GCD for polynomials over a field is defined up to arbitrary element of the field). This fixes possible segfault when computing GCD of polynomials over rationals (this is not theoretical, see the added test case). Thanks to Ernst Moritz Hahn for reporting this bug. ----------------------------------------------------------------------- Summary of changes: check/bugme_chinrem_gcd.cpp | 18 ++++++++++++++++-- ginac/polynomial/mgcd.cpp | 10 ++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations