From FJ.J.Greenhalgh at gmail.com Fri Jul 12 08:24:05 2013 From: FJ.J.Greenhalgh at gmail.com (Frank Greenhalgh) Date: Fri, 12 Jul 2013 06:24:05 +0000 (UTC) Subject: [GiNaC-devel] Invitation to connect on LinkedIn Message-ID: <172988803.11968629.1373610245896.JavaMail.app@ela4-bed81.prod> LinkedIn ------------ I'd like to add you to my professional network on LinkedIn. - Frank Frank Greenhalgh Product Assurance - Math at IGT Reno, Nevada Area Confirm that you know Frank Greenhalgh: https://www.linkedin.com/e/-smpzss-hj102oyr-4s/isd/14926177951/MZjs48PJ/?hs=false&tok=35OM5O-f_0kRQ1 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/-smpzss-hj102oyr-4s/pQQaivesQERn6ZpSpQQtivesQEgGdrUG/goo/ginac-devel%40ginac%2Ede/20061/I4970025497_1/?hs=false&tok=3XZGvJKWX0kRQ1 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kisilv at maths.leeds.ac.uk Sat Jul 27 00:51:56 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Fri, 26 Jul 2013 23:51:56 +0100 Subject: [GiNaC-devel] Simplifying powers Message-ID: <22829.1374879116@krein.leeds.ac.uk> Dear All, The method power::eval() contains the following rules: // ^(*(...,x;c1),c2) -> *(^(*(...,x;1),c2),c1^c2) (c1, c2 numeric(), c1>0) // ^(*(...,x;c1),c2) -> *(^(*(...,x;-1),c2),(-c1)^c2) (c1, c2 numeric(), c1<0) Is there a good reason why c1 here shall be numeric? Cannot we simply check the positive/negative info flag for c1 for that simplification? Shall I prepare a patch for this? Currently we have: possymbol n("n"), m("m"); cout << "e=" << pow(pow(n,2),half) << endl; // -> n cout << "e=" << pow(pow(n*m,2),half) << endl; // -> sqrt(m^2*n^2) Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 From kisilv at maths.leeds.ac.uk Sun Jul 28 16:10:16 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Sun, 28 Jul 2013 15:10:16 +0100 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <22829.1374879116@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> Message-ID: <28938.1375020616@krein.leeds.ac.uk> Dear All, I propose a patch to power::expand(). It does not affect power::eval() and automatic rewriting rules. The patch expand expressions like (a*b*p)^c to (a*b)^c*p^c if p is positive and c is real. A simple check is added as well. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-an-expansion-law-in-power-expand-x-p-c-x-c-p-c-f.patch Type: text/x-diff Size: 3582 bytes Desc: Git patch URL: From kreckel at ginac.de Sun Jul 28 22:08:31 2013 From: kreckel at ginac.de (Richard B. Kreckel) Date: Sun, 28 Jul 2013 22:08:31 +0200 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <22829.1374879116@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> Message-ID: <51F57A3F.4080900@ginac.de> On 07/27/2013 12:51 AM, Vladimir V. Kisil wrote: > The method power::eval() contains the following rules: > > // ^(*(...,x;c1),c2) -> *(^(*(...,x;1),c2),c1^c2) (c1, c2 numeric(), c1>0) > // ^(*(...,x;c1),c2) -> *(^(*(...,x;-1),c2),(-c1)^c2) (c1, c2 numeric(), c1<0) > > Is there a good reason why c1 here shall be numeric? Cannot we simply check the > positive/negative info flag for c1 for that simplification? The way it is written, these rewriting rules apply to expairseq. The c1 and c2 stand for overall_coeff, which is of type numeric by definition. > Shall I prepare a patch for this? You may try. -richy. -- Richard B. Kreckel From alexei.sheplyakov at gmail.com Mon Jul 29 11:31:28 2013 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Mon, 29 Jul 2013 12:31:28 +0300 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <22829.1374879116@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> Message-ID: <20130729093128.GA28251@vargsbox.jinr.ru> Hello, Vladimir, > The method power::eval() contains the following rules: > > // ^(*(...,x;c1),c2) -> *(^(*(...,x;1),c2),c1^c2) (c1, c2 numeric(), c1>0) > // ^(*(...,x;c1),c2) -> *(^(*(...,x;-1),c2),(-c1)^c2) (c1, c2 numeric(), c1<0) > > Is there a good reason why c1 here shall be numeric? The idea is to pull the numeric factor out (so some cancellation can happen). Also this transformation is fast enough -- basically one need to replace the overall_coeff (of the mul object) with 1 (or -1), and multiply the result by a number (c1^c2, or (-c1)^c2). > Cannot we simply check the positive/negative info flag for c1 for that simplification? Because such a check is *much* slower. Say, if x in the above expression is a sum, one need to check every term (which is possibly recursive). To make it reasonably efficient we need to cache info_flags::positive. That is, introduce status_flags::positive and status_flags::negative, and set/reset them properly in eval(), expand() (and possibly other methods). > Shall I prepare a patch for this? You are welcome. Best regards, Alexei From alexei.sheplyakov at gmail.com Mon Jul 29 13:01:32 2013 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Mon, 29 Jul 2013 14:01:32 +0300 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <28938.1375020616@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> Message-ID: <20130729110132.GB28251@vargsbox.jinr.ru> Hi again, > + ex e1 = pow(5*pow(3*a*b*x*y*p*q,2),7*half*c).expand(); > + ex e2 = pow(p,7*c)*pow(q,7*c)*pow(pow(a*b*x*y,2),numeric(7,2)*c)*pow(45,numeric(7,2)*c); The idea looks good... > diff --git a/ginac/power.cpp b/ginac/power.cpp > index 9a8f7d5..d01a88f 100644 > --- a/ginac/power.cpp > +++ b/ginac/power.cpp > @@ -824,11 +824,38 @@ ex power::expand(unsigned options) const > > if (!is_exactly_a(expanded_exponent) || > !ex_to(expanded_exponent).is_integer()) { > - if (are_ex_trivially_equal(basis,expanded_basis) && are_ex_trivially_equal(exponent,expanded_exponent)) { > - return this->hold(); > - } else { > + if (is_exactly_a(expanded_basis) && expanded_exponent.info(info_flags::real)) { ... however the implementation is a bit inefficient. Even worse -- it makes power::expand() slower even if the above transformation is not applicable. Consider the following expression: ((1+x)^(2*eps)*(1+2*x)^(1+2*eps)*...(1+100*x)^(1+100*eps))^(4-2*eps) > + const mul &m = ex_to(expanded_basis); > + exvector prodseq, powseq; > + prodseq.reserve(m.seq.size() + 1); > + powseq.reserve(m.seq.size() + 1); > + epvector::const_iterator last = m.seq.end(); > + epvector::const_iterator cit = m.seq.begin(); > + bool possign=true; > + > + while (cit!=last) { > + ex e=m.recombine_pair_to_ex(*cit); > + if (e.info(info_flags::positive)) > + prodseq.push_back(power(e, expanded_exponent)); > + else if (e.info(info_flags::negative)) { > + prodseq.push_back(power(-e, expanded_exponent)); > + possign = !possign; So we check every term here (which might be quite expensive)... > + } else > + powseq.push_back(m.recombine_pair_to_ex(*cit)); This conversion is useless (mul(powseq) converts the exvector back to epvector). Perhaps powseq should be a epvector. > + ++cit; > + } > + > + if (m.overall_coeff.info(info_flags::positive)) > + prodseq.push_back(power(m.overall_coeff, expanded_exponent)); > + else if (m.overall_coeff.info(info_flags::negative)) { > + prodseq.push_back(power(-m.overall_coeff, expanded_exponent)); > + possign = !possign; > + } else > + powseq.push_back(m.overall_coeff); > + > + return (new mul(prodseq))->setflag(status_flags::dynallocated)*(new power((possign? _ex1 : _ex_1)*mul(powseq), expanded_exponent))->setflag(status_flags::dynallocated); Eventually the loop constructs the same expression, but it needs to be evaluated once again. > + } else > return (new power(expanded_basis,expanded_exponent))->setflag(status_flags::dynallocated | (options == 0 ? status_flags::expanded : 0)); > - } > } Therefore I think the patch should be improved. In particular, - info_flags::{positive,negative} should be cached (add yet another status_flags and maintain them) - the trivial case should be handled more carefully (i.e. the code should detect that the transformation is not applicable as early as possible, and return the original expression). Best regards, Alexei From kisilv at maths.leeds.ac.uk Mon Jul 29 14:11:01 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Mon, 29 Jul 2013 13:11:01 +0100 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <20130729110132.GB28251@vargsbox.jinr.ru> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> Message-ID: <20882.1375099861@krein.leeds.ac.uk> Dear Richy and Alexei, Many thanks for the commments, I will try to implement them. Meanwhile, here is another small proposition: to allow GiNaC the rewriting rule of exponents: (x^c1)^c2 -> x^(c1 * c2) for the additional case of c1=-1 and c2>0. It was explicitly forbidden in exam_powerlaws.cpp, but it seems to be a rudiment of old times, when GiNaC was not aware of positiveness. I am including the respective patch. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-the-case-of-c1-1-and-c2-0-to-the-rewriting-rule-.patch Type: text/x-diff Size: 2978 bytes Desc: Git patch URL: From kisilv at maths.leeds.ac.uk Mon Jul 29 18:25:25 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Mon, 29 Jul 2013 17:25:25 +0100 Subject: [GiNaC-devel] More rules to mul::info() Message-ID: <24430.1375115125@krein.leeds.ac.uk> Dear All, Looking into flags (as Alexei suggested) I noticed, that GiNaC is not aware about a product of two negative entries to be positive. I am attaching a patch to amend this. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Elaborate-mul-info.patch Type: text/x-diff Size: 3421 bytes Desc: Git patch URL: From kisilv at maths.leeds.ac.uk Mon Jul 29 21:12:39 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Mon, 29 Jul 2013 20:12:39 +0100 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <20130729110132.GB28251@vargsbox.jinr.ru> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> Message-ID: <26946.1375125159@krein.leeds.ac.uk> Dear All, Following Alexei's advises I rewrite the expansion of powers. The block is moved up, since it is more sensible to do this type of expansion before the basis of exponent was expanded. There is no other place in the code which check that *all* factors are sign-indefinite. Thus the respective flag is set within this block. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Add-an-expansion-law-in-power-expand.patch Type: text/x-diff Size: 5459 bytes Desc: Git patch URL: From kreckel at ginac.de Mon Jul 29 23:22:13 2013 From: kreckel at ginac.de (Richard B. Kreckel) Date: Mon, 29 Jul 2013 23:22:13 +0200 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <26946.1375125159@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> Message-ID: <51F6DD05.9040803@ginac.de> Vladimir, On 07/29/2013 09:12 PM, Vladimir V. Kisil wrote: > Following Alexei's advises I rewrite the expansion of > powers. The block is moved up, since it is more sensible to do this > type of expansion before the basis of exponent was expanded. There is > no other place in the code which check that *all* factors are > sign-indefinite. Thus the respective flag is set within this block. This patch does not compile. Have you tried it? (There are no status_flags::is_positive and status_flags::is_negative.) Best regards -richy. -- Richard B. Kreckel From kisilv at maths.leeds.ac.uk Mon Jul 29 23:41:01 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Mon, 29 Jul 2013 22:41:01 +0100 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <51F6DD05.9040803@ginac.de> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> Message-ID: <15216.1375134061@krein.leeds.ac.uk> Dear Richy, >>>>> On Mon, 29 Jul 2013 23:22:13 +0200, "Richard B. Kreckel" said: RK> This patch does not compile. Have you tried it? Yes, but in ginac-1.6.2 distro. For some reasons I cannot compile the current git depository. The problems are with tutorial.info and building debian packages. RK> (There are no RK> status_flags::is_positive and status_flags::is_negative.) I moved modified files to git directory manually and forget to include flags.h. The correct patch is attached now. On my computer I can compile all three commits together, then all GiNaC checks are passed as well as all exercises from my book. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Add-an-expansion-law-in-power-expand.patch Type: text/x-diff Size: 6260 bytes Desc: Git patch URL: From alexei.sheplyakov at gmail.com Tue Jul 30 12:09:32 2013 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Tue, 30 Jul 2013 13:09:32 +0300 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <15216.1375134061@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> Message-ID: <20130730100932.GA16055@vargsbox.jinr.ru> Hi, On Mon, Jul 29, 2013 at 10:41:01PM +0100, Vladimir V. Kisil wrote: > Subject: [PATCH 3/3] Add an expansion law in power::expand(). The expansion > (x*p)^c -> x^c*p^c is done for a positive expression p > and a real exponent c. The corresponding check is added > to exam_powerlaws. > > diff --git a/ginac/flags.h b/ginac/flags.h > index 8f8f25d..f4f0f6b 100644 > --- a/ginac/flags.h > +++ b/ginac/flags.h > @@ -197,6 +197,9 @@ public: > not_shareable = 0x0010, ///< don't share instances of this object between different expressions unless explicitly asked to (used by ex::compare()) > has_indices = 0x0020, > has_no_indices = 0x0040 // ! (has_indices || has_no_indices) means "don't know" > + is_positive = 0x0080, > + is_negative = 0x0100, > + purely_indefinite = 0x0200, // If set in a mul, then it does not contains any terms with determined signs, used in power::expand() > }; > }; The `purely_idefinite' flag is redundant (that is !(is_positive || is_negative) is equivalent to purely_indefinite). Also status_flags is quite a scarce resource (there are only 32 of them). Could you please skip that flag? Best regards, Alexei From kisilv at maths.leeds.ac.uk Tue Jul 30 12:52:09 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Tue, 30 Jul 2013 11:52:09 +0100 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <20130730100932.GA16055@vargsbox.jinr.ru> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> <20130730100932.GA16055@vargsbox.jinr.ru> Message-ID: <7585.1375181529@krein.leeds.ac.uk> Hi, >>>>> On Tue, 30 Jul 2013 13:09:32 +0300, Alexei Sheplyakov said: ASh> The `purely_idefinite' flag is redundant ASh> (that is !(is_positive || is_negative) is equivalent to purely_indefinite). Not quite so, the former is "contains some indefinite factors" (possibly, along with some positive/negative), the later is "consists of only indefinite factors" (so, no positive/negative factors inside). ASh> status_flags is quite a scarce resource (there are only 32 of ASh> them). It is true, for this reason I did not create flags for nonnegative/nonpositive. May be 64 flags can be possible at same later point? Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 From kisilv at maths.leeds.ac.uk Tue Jul 30 18:00:53 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Tue, 30 Jul 2013 17:00:53 +0100 Subject: [GiNaC-devel] Housekeeping work in inifcns.cpp Message-ID: <10163.1375200053@krein.leeds.ac.uk> Dear All, I made a bit of housekeeping work in inifcns.cpp: 1) Make abs_power aware on even powers, even if they are not numeric. 2) Add several hold() to returns, which cannot be processed further. I shall admit, that this can be misdone, so please check. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-Housekeeping-work-in-inifcns.cpp.patch Type: text/x-diff Size: 2462 bytes Desc: Git patch URL: From kisilv at maths.leeds.ac.uk Tue Jul 30 20:25:15 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Tue, 30 Jul 2013 19:25:15 +0100 Subject: [GiNaC-devel] Some more evaluation rules for abs() Message-ID: <12411.1375208715@krein.leeds.ac.uk> Dear All, I have added some more evaluation rules for abs(). They evaluate absolute values of powers and exponents. Simple checks are added as well. The effect is like this: realsymbol a("a"), b("b"), x("x"), y("y"); cout << abs(exp(x+I*y)).eval() << endl; // before: -> abs(exp(x+I*y)) // now: -> exp(x) cout << abs(pow(x+I*y,a+I*b)).eval() << endl; // before: -> abs((x+I*y)^(I*b+a)) // now: -> abs(x+I*y)^a Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-Some-more-evaluation-rules-for-abs.patch Type: text/x-diff Size: 1534 bytes Desc: Git patch URL: From git at ginac.de Tue Jul 30 21:06:13 2013 From: git at ginac.de (Alexei Sheplyakov) Date: Tue, 30 Jul 2013 21:06:13 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-385-gca11a8c Message-ID: <20130730190613.927A3F00529@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 ca11a8c1471ae650f0124db5e9bf48cc04f9d8f0 (commit) via b23a2dfdcd478b00a11c6c2184fbe197a3ac5bfb (commit) from e45f9fca76b81e01ffa5edc417c29538fa05147b (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 ca11a8c1471ae650f0124db5e9bf48cc04f9d8f0 Author: Vladimir V. Kisil Date: Sun Jul 28 23:25:01 2013 +0100 Add the case of c1=-1 and c2>0 to the rewriting rule of exponents: (x^c1)^c2 -> x^(c1 * c2) commit b23a2dfdcd478b00a11c6c2184fbe197a3ac5bfb Author: Alexei Sheplyakov Date: Sun Jul 28 18:43:06 2013 +0300 [bugfix] factor_univariate(): handle polinomials over rationals (no segfaults any more). ----------------------------------------------------------------------- Summary of changes: check/CMakeLists.txt | 1 + check/Makefile.am | 4 ++++ check/exam_powerlaws.cpp | 6 +++--- check/factor_univariate_bug.cpp | 21 +++++++++++++++++++++ ginac/factor.cpp | 12 +++++++++++- ginac/power.cpp | 7 ++++--- 6 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 check/factor_univariate_bug.cpp hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From alexei.sheplyakov at gmail.com Tue Jul 30 21:17:59 2013 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Tue, 30 Jul 2013 22:17:59 +0300 Subject: [GiNaC-devel] Simplifying powers In-Reply-To: <20882.1375099861@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <20882.1375099861@krein.leeds.ac.uk> Message-ID: <20130730191759.GA26562@vargsbox.jinr.ru> Hello again, > Many thanks for the commments, I will try to implement > them. Meanwhile, here is another small proposition: to allow GiNaC > the rewriting rule of exponents: > > (x^c1)^c2 -> x^(c1 * c2) I've committed this patch (with a minor adjustment). Best regards, Alexei From alexei.sheplyakov at gmail.com Tue Jul 30 21:23:26 2013 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Tue, 30 Jul 2013 22:23:26 +0300 Subject: [GiNaC-devel] Build issues (Was: Simplifying powers) In-Reply-To: <15216.1375134061@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> Message-ID: <20130730192326.GB26562@vargsbox.jinr.ru> Hi, Vladimir, > Yes, but in ginac-1.6.2 distro. For some reasons I cannot compile > the current git depository. The problems are with tutorial.info and > building debian packages. Could you elaborate please? (The problem is not going to be fixed unless someone complains). Best regards, Alexei From kisilv at maths.leeds.ac.uk Tue Jul 30 21:26:31 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Tue, 30 Jul 2013 20:26:31 +0100 Subject: [GiNaC-devel] Some more evaluation rules for abs() In-Reply-To: <12411.1375208715@krein.leeds.ac.uk> References: <12411.1375208715@krein.leeds.ac.uk> Message-ID: <13453.1375212391@krein.leeds.ac.uk> >>>>> On Tue, 30 Jul 2013 19:25:15 +0100, "Vladimir V. Kisil" said: VVK> Dear All, I have added some more evaluation rules for VVK> abs(). They evaluate absolute values of powers and VVK> exponents. Simple checks are added as well. Unfortunately, my previous patch contains a misprint in exam_inifcns.cpp, so the check failed. The correct version is attached now. -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-Some-more-evaluation-rules-for-abs.patch Type: text/x-diff Size: 1539 bytes Desc: Git patch URL: From kreckel at ginac.de Tue Jul 30 21:55:44 2013 From: kreckel at ginac.de (Richard B. Kreckel) Date: Tue, 30 Jul 2013 21:55:44 +0200 Subject: [GiNaC-devel] Build issues (Was: Simplifying powers) In-Reply-To: <20130730192326.GB26562@vargsbox.jinr.ru> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> <20130730192326.GB26562@vargsbox.jinr.ru> Message-ID: <51F81A40.3080304@ginac.de> Hi, On 07/30/2013 09:23 PM, Alexei Sheplyakov wrote: > Hi, Vladimir, > >> Yes, but in ginac-1.6.2 distro. For some reasons I cannot compile >> the current git depository. The problems are with tutorial.info and >> building debian packages. > > Could you elaborate please? (The problem is not going to be fixed unless > someone complains). I can reproduce it: ginac.texi:8682: raising the section level of @subsection which is too low I am going to research this tomorrow. (Texinfo 5.0 and 5.1 did break a couple of packages, unfortunately.) -richy. -- Richard B. Kreckel From kisilv at maths.leeds.ac.uk Tue Jul 30 22:03:07 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Tue, 30 Jul 2013 21:03:07 +0100 Subject: [GiNaC-devel] Build issues (Was: Simplifying powers) In-Reply-To: <20130730192326.GB26562@vargsbox.jinr.ru> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> <20130730192326.GB26562@vargsbox.jinr.ru> Message-ID: <14098.1375214587@krein.leeds.ac.uk> >>>>> On Tue, 30 Jul 2013 22:23:26 +0300, Alexei Sheplyakov said: Ash> Could you elaborate please? (The problem is not going to be Ash> fixed unless someone complains). I did: git clone git://www.ginac.de/ginac.git cd ginac zcat ../ginac_1.6.2-1.diff.gz | patch -p 1 autoreconf -i ./configure make That breaks with the following error: make[1]: Entering directory `/tmp/ginac/ginsh' /usr/bin/python ./ginsh_op_help.py -o ginsh_op_help.h ginsh.1 make[1]: *** No rule to make target `ginsh_parser.h', needed by `ginsh_parser.o'. Stop. Maybe, something crucial is missing from my installation, but I cannot see what it is exactly. If I copy ginsh_parser.h from ginac-1.6.2 distro the next error will be: make[2]: Entering directory `/tmp/ginac/doc/tutorial' ... ginac.texi:8682: raising the section level of @subsection which is too low make[2]: *** [ginac.info] Error 1 If I copy *.info files (with the updated time-stamp) from the distro make finishes fine. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 From kisilv at maths.leeds.ac.uk Tue Jul 30 23:29:59 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Tue, 30 Jul 2013 22:29:59 +0100 Subject: [GiNaC-devel] Build issues (Was: Simplifying powers) In-Reply-To: <14098.1375214587@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> <20130730192326.GB26562@vargsbox.jinr.ru> <14098.1375214587@krein.leeds.ac.uk> Message-ID: <15414.1375219799@krein.leeds.ac.uk> >>>>> On Tue, 30 Jul 2013 22:23:26 +0300, Alexei Sheplyakov said: ASh> Could you elaborate please? (The problem is not going to be ASh> fixed unless someone complains). One more observation, which may be not important, however. I am playing with functions.pl. After a serious modification command make && make check produce SegFault in many checks. However, after "make clean", everything compile and run without an error. Probably, my modifications introduced some binary incompatibilities, but changed functions.h did not call to recompile all pieces which are using it. I am not sure if this is an issue at all. -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 From alexei.sheplyakov at gmail.com Wed Jul 31 09:30:26 2013 From: alexei.sheplyakov at gmail.com (Alexei Sheplyakov) Date: Wed, 31 Jul 2013 10:30:26 +0300 Subject: [GiNaC-devel] Some more evaluation rules for abs() In-Reply-To: <12411.1375208715@krein.leeds.ac.uk> References: <12411.1375208715@krein.leeds.ac.uk> Message-ID: <20130731073026.GC27993@vargsbox.jinr.ru> Hello, On Tue, Jul 30, 2013 at 07:25:15PM +0100, Vladimir V. Kisil wrote: > I have added some more evaluation rules for abs(). They evaluate > absolute values of powers and exponents. Simple checks > are added as well. The effect is like this: > > realsymbol a("a"), b("b"), x("x"), y("y"); > > cout << abs(exp(x+I*y)).eval() << endl; > // before: -> abs(exp(x+I*y)) > // now: -> exp(x) No objections here. > cout << abs(pow(x+I*y,a+I*b)).eval() << endl; > // before: -> abs((x+I*y)^(I*b+a)) > // now: -> abs(x+I*y)^a I feel so stupid but Z^A = exp(A log(Z)) = exp((Re(A) + I Im(A)) (ln|Z| + I arg(Z))) = exp(Re(A) ln|Z| - Im(A) arg(Z) + I (Im(A) ln|Z| + Re(A) arg(Z))) = exp(Re(A) ln|Z| - Im(A) arg(Z)) exp(I(Im(A) ln|Z| + Re(A) arg(Z))) Hence |Z^A| = exp(Re(A) ln|Z| - Im(A) arg(Z)) = |Z|^Re(A) exp(-Im(A) arg(Z)) In particular |(-1)^I| = | exp(I (I Pi)) | = |exp(-Pi)| = exp(-Pi) What I'm doing wrong? Best regards, Alexei From kisilv at maths.leeds.ac.uk Wed Jul 31 11:14:09 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Wed, 31 Jul 2013 10:14:09 +0100 Subject: [GiNaC-devel] Some more evaluation rules for abs() In-Reply-To: <20130731073026.GC27993@vargsbox.jinr.ru> References: <12411.1375208715@krein.leeds.ac.uk> <20130731073026.GC27993@vargsbox.jinr.ru> Message-ID: <28369.1375262049@krein.leeds.ac.uk> Dear Alexei, >>>>> On Wed, 31 Jul 2013 10:30:26 +0300, Alexei Sheplyakov said: ASh> Hence |Z^A| = exp(Re(A) ln|Z| - Im(A) arg(Z)) = |Z|^Re(A) ASh> exp(-Im(A) arg(Z)) Thanks for pointing out my error. Since, this evaluation can lead to a more complex expression in general, I reduced it to two cases Im(A)=0 or arg(Z=0). The corrected patch is attached. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-Some-more-evaluation-rules-for-abs.patch Type: text/x-diff Size: 2418 bytes Desc: Git patch URL: From kisilv at maths.leeds.ac.uk Wed Jul 31 16:32:55 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Wed, 31 Jul 2013 15:32:55 +0100 Subject: [GiNaC-devel] Expand method in functions Message-ID: <1211.1375281175@krein.leeds.ac.uk> Dear All, So far we had pow(2,a+b).expand() -> pow(2,a)*pow(2,b), but exp(a+b).expand() -> exp(a+b). It will be also nice to have abs(a*b).expand() -> abs(a)*abs(b) and log(a*b).expand() -> log(a) + log(b) (for positive a and b, of course). Thus, I am proposing a patch for this. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0006-Add-specific-tailored-expand-to-GiNaC-functions.patch Type: text/x-diff Size: 12730 bytes Desc: Git patch URL: From kisilv at maths.leeds.ac.uk Wed Jul 31 18:18:19 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Wed, 31 Jul 2013 17:18:19 +0100 Subject: [GiNaC-devel] Log evaluation Message-ID: <3018.1375287499@krein.leeds.ac.uk> Dear All, I propose to add the evaluation rule log(p^a) -> a*log(p) if p>0 and a is real. The patch (including the respective check) is attached. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0007-Additional-log-evaluation-rule.patch Type: text/x-diff Size: 1470 bytes Desc: Git patch URL: From git at ginac.de Wed Jul 31 22:44:29 2013 From: git at ginac.de (Richard B. Kreckel) Date: Wed, 31 Jul 2013 22:44:29 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-388-g073bf40 Message-ID: <20130731204430.02A44F004B4@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 073bf40a73e419a3dbcb6dfa190947ce2cc3bdce (commit) via 1c760f15dc031c29db4bb857e3d70980b55437dc (commit) via c19c2786ec3345720f0358a08bf8f781dcde0f02 (commit) from ca11a8c1471ae650f0124db5e9bf48cc04f9d8f0 (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 073bf40a73e419a3dbcb6dfa190947ce2cc3bdce Author: Richard Kreckel Date: Wed Jul 31 20:42:16 2013 +0000 Add support for Texinfo-5.0. Recent versions of Texinfo complained about misplaced @subsection. Change them into @appendixsection. commit 1c760f15dc031c29db4bb857e3d70980b55437dc Author: Richard Kreckel Date: Tue Jul 30 18:19:49 2013 +0000 Shut up recent texinfo warning. It seems like dircategory has to come before the first node. commit c19c2786ec3345720f0358a08bf8f781dcde0f02 Author: Richard Kreckel Date: Mon Jul 29 08:05:22 2013 +0000 Shut up recent automake warning. 'INCLUDES' was the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS'). ----------------------------------------------------------------------- Summary of changes: doc/examples/ginac-examples.texi | 7 ++++--- doc/tutorial/ginac.texi | 4 ++-- ginsh/Makefile.am | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From kreckel at ginac.de Wed Jul 31 22:46:24 2013 From: kreckel at ginac.de (Richard B. Kreckel) Date: Wed, 31 Jul 2013 22:46:24 +0200 Subject: [GiNaC-devel] Build issues (Was: Simplifying powers) In-Reply-To: <51F81A40.3080304@ginac.de> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> <20130730192326.GB26562@vargsbox.jinr.ru> <51F81A40.3080304@ginac.de> Message-ID: <51F977A0.7010202@ginac.de> On 07/30/2013 09:55 PM, Richard B. Kreckel wrote: >>> Yes, but in ginac-1.6.2 distro. For some reasons I cannot compile >>> the current git depository. The problems are with tutorial.info and >>> building debian packages. >> >> Could you elaborate please? (The problem is not going to be fixed unless >> someone complains). > > I can reproduce it: > ginac.texi:8682: raising the section level of @subsection which is too low > I am going to research this tomorrow. (Texinfo 5.0 and 5.1 did break a > couple of packages, unfortunately.) This is fixed now. -richy. -- Richard B. Kreckel From kreckel at ginac.de Wed Jul 31 23:33:00 2013 From: kreckel at ginac.de (Richard B. Kreckel) Date: Wed, 31 Jul 2013 23:33:00 +0200 Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-379-gbf0d265 In-Reply-To: <20120717050314.67E2AF00524@cebix.net> References: <20120717050314.67E2AF00524@cebix.net> Message-ID: <51F9828C.2060108@ginac.de> Hi Alexei! On 07/17/2012 07:03 AM, Alexei Sheplyakov wrote: > commit eded9cd9d5df793c1ea5a1f766eff261ded46bde > Author: Alexei Sheplyakov > Date: Sun May 29 17:15:42 2011 +0300 > > [build] Move archive version info into version.h (for non autotools build). > > The canonical location for all version info is the ginac/version.h file > now (so we can have two build systems without duplicating the version info > in configure.ac and CMakeLists.txt). 'make dist' fails now because it still wants ginac/version.h.in Cheers -richy. -- Richard B. Kreckel From git at ginac.de Wed Jul 31 23:37:18 2013 From: git at ginac.de (Richard B. Kreckel) Date: Wed, 31 Jul 2013 23:37:18 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-389-g8bd8ced Message-ID: <20130731213718.EFFD1F0052A@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 8bd8cedd086aeaf08630d5357af37151e1d06d06 (commit) from 073bf40a73e419a3dbcb6dfa190947ce2cc3bdce (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 8bd8cedd086aeaf08630d5357af37151e1d06d06 Author: Richard Kreckel Date: Wed Jul 31 21:33:44 2013 +0000 Fix build from git repository. To make automake aware of lex and yacc files, they must be renamed. ----------------------------------------------------------------------- Summary of changes: ginsh/CMakeLists.txt | 13 ++++++------- ginsh/Makefile.am | 7 ++++--- ginsh/{ginsh_lexer.ll => ginsh_lexer.lpp} | 4 ++-- ginsh/{ginsh_parser.yy => ginsh_parser.ypp} | 0 4 files changed, 12 insertions(+), 12 deletions(-) rename ginsh/{ginsh_lexer.ll => ginsh_lexer.lpp} (98%) rename ginsh/{ginsh_parser.yy => ginsh_parser.ypp} (100%) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From kreckel at ginac.de Wed Jul 31 23:43:08 2013 From: kreckel at ginac.de (Richard B. Kreckel) Date: Wed, 31 Jul 2013 23:43:08 +0200 Subject: [GiNaC-devel] Build issues (Was: Simplifying powers) In-Reply-To: <14098.1375214587@krein.leeds.ac.uk> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> <20130730192326.GB26562@vargsbox.jinr.ru> <14098.1375214587@krein.leeds.ac.uk> Message-ID: <51F984EC.3080501@ginac.de> On 07/30/2013 10:03 PM, Vladimir V. Kisil wrote: > make[1]: Entering directory `/tmp/ginac/ginsh' > /usr/bin/python ./ginsh_op_help.py -o ginsh_op_help.h ginsh.1 > make[1]: *** No rule to make target `ginsh_parser.h', needed by `ginsh_parser.o'. Stop. Fixed now, too. -richy. -- Richard B. Kreckel From kisilv at maths.leeds.ac.uk Wed Jul 31 11:09:41 2013 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Wed, 31 Jul 2013 10:09:41 +0100 Subject: [GiNaC-devel] Build issues (Was: Simplifying powers) In-Reply-To: <20130731082451.GD27993@vargsbox.jinr.ru> References: <22829.1374879116@krein.leeds.ac.uk> <28938.1375020616@krein.leeds.ac.uk> <20130729110132.GB28251@vargsbox.jinr.ru> <26946.1375125159@krein.leeds.ac.uk> <51F6DD05.9040803@ginac.de> <15216.1375134061@krein.leeds.ac.uk> <20130730192326.GB26562@vargsbox.jinr.ru> <14098.1375214587@krein.leeds.ac.uk> <20130731082451.GD27993@vargsbox.jinr.ru> Message-ID: <28263.1375261781@krein.leeds.ac.uk> Dear Alexei, >>>>> On Wed, 31 Jul 2013 11:24:51 +0300, Alexei Sheplyakov said: ASh> It looks like bison is missing (the configure script should ASh> have printed the corresponding warning). Could you please send ASh> your config.log file? Bison is present, as far as I can see. So, I am attaching the config.log and giving the output of autoreconf below. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835 ================================================================= libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'. libtoolize: copying file `config/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'. libtoolize: copying file `m4/libtool.m4' libtoolize: copying file `m4/ltoptions.m4' libtoolize: copying file `m4/ltsugar.m4' libtoolize: copying file `m4/ltversion.m4' libtoolize: copying file `m4/lt~obsolete.m4' configure.ac:31: installing 'config/config.guess' configure.ac:31: installing 'config/config.sub' configure.ac:21: installing 'config/install-sh' configure.ac:21: installing 'config/missing' check/Makefile.am: installing 'config/depcomp' parallel-tests: installing 'config/test-driver' doc/examples/Makefile.am:8: installing 'config/texinfo.tex' doc/tutorial/Makefile.am:4: installing 'config/mdate-sh' ginsh/Makefile.am:7: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') configure.ac: installing 'config/ylwrap' -------------- next part -------------- A non-text attachment was scrubbed... Name: config.log Type: text/x-makefile Size: 88158 bytes Desc: Log file URL: