From jrheinlaender at gmx.de Wed Jun 7 18:26:47 2017 From: jrheinlaender at gmx.de (=?UTF-8?Q?Jan_Rheinl=c3=a4nder?=) Date: Wed, 7 Jun 2017 18:26:47 +0200 Subject: [GiNaC-devel] Substitution of wildcards Message-ID: Hi, I'm wondering what is going on here (ginsh output): > subs($1 * x + 1/2 * x^2 * $2, match(a * x + b, $1 + x * $2)); b*a+1/2*a^3 What happened to "x" ? The match by itself correctly finds > match(a * x + b, $1 + x * $2); {$2==a,$1==b} but the substitution result is weird. Greetings, Jan From kisilv at maths.leeds.ac.uk Fri Jun 9 17:58:37 2017 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Fri, 09 Jun 2017 16:58:37 +0100 Subject: [GiNaC-devel] Substitution of wildcards In-Reply-To: References: Message-ID: <10599.1497023917@math-pc2069.leeds.ac.uk> >>>>> On Wed, 7 Jun 2017 18:26:47 +0200, Jan Rheinl?nder said: JR> Hi, I'm wondering what is going on here (ginsh output): >> subs($1 * x + 1/2 * x^2 * $2, match(a * x + b, $1 + x * $2)); JR> b*a+1/2*a^3 JR> What happened to "x" ? The match by itself correctly finds >> match(a * x + b, $1 + x * $2); JR> {$2==a,$1==b} JR> but the substitution result is weird. According to the GiNaC tutorial: "* A single wildcard matches any expression. " Thus, the wildcard $2 matches to x, then the expression $1 * $2 + 1/2 * $2^2 * $2 is substituted using {$2==a,$1==b}. -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/ From kisilv at maths.leeds.ac.uk Mon Jun 12 16:42:21 2017 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Mon, 12 Jun 2017 15:42:21 +0100 Subject: [GiNaC-devel] Substitution of wildcards In-Reply-To: <10599.1497023917@math-pc2069.leeds.ac.uk> References: <10599.1497023917@math-pc2069.leeds.ac.uk> Message-ID: <25417.1497278541@math-pc2069.leeds.ac.uk> >>>>> On Fri, 09 Jun 2017 16:58:37 +0100, "Vladimir V. Kisil" said: >>>>> On Wed, 7 Jun 2017 18:26:47 +0200, Jan Rheinl?nder said: JR> Hi, I'm wondering what is going on here (ginsh output): >>> subs($1 * x + 1/2 * x^2 * $2, match(a * x + b, $1 + x * $2)); JR> b*a+1/2*a^3 JR> What happened to "x" ? The match by itself correctly finds The effect, which you are expecting, is achieved by by subs_options::no_pattern #include using namespace std; using namespace GiNaC; int main(){ realsymbol x("x"), a("a"), b("b"); wildcard w0(0), w1(1); exmap repl; (a * x + b).match(w0 + x * w1,repl); cout << (w0 * x + pow(x,2) * w1 / 2).subs(repl,subs_options::no_pattern) << endl; // -> b*x+1/2*a*x^2 } -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/ From jrheinlaender at gmx.de Sat Jun 17 09:25:19 2017 From: jrheinlaender at gmx.de (=?UTF-8?Q?Jan_Rheinl=c3=a4nder?=) Date: Sat, 17 Jun 2017 09:25:19 +0200 Subject: [GiNaC-devel] Compiler warnings in CLN Message-ID: <8072a939-567e-f505-0962-8ba2880f0643@gmx.de> Hi, in cln/string.h it says: -------------------- namespace cln { struct cl_string; ^^^^ .... private: // Friend declarations. They are for the compiler. Just ignore them. friend class cl_string; ^^^ ----------------------- and the meticulous MSVC-compiler gives this a warning: warning C4099: "cln::cl_string": Geben Sie den zuerst unter Verwendung von "struct" und jetzt unter Verwendung von "class" gesehenen Namen ein meaning that we should decide whether cl_string is a class or a struct. Is there any interest in eliminating this kind of warning? Then I could put together a list. Greetings, Jan From jrheinlaender at gmx.de Mon Jun 19 18:24:21 2017 From: jrheinlaender at gmx.de (=?UTF-8?Q?Jan_Rheinl=c3=a4nder?=) Date: Mon, 19 Jun 2017 18:24:21 +0200 Subject: [GiNaC-devel] is_exactly_a Message-ID: Hi, the GiNaC documentation says: In contrast, 'is_exactly_a(e)' allows you to check whether the top-level object of an expression 'e' is an instance of the GiNaC class 'T', not including parent classes. Shouldn't this read "not including subclasses"? Otherwise, I don't understand what the documentation wants to say. Greetings, Jan From kisilv at maths.leeds.ac.uk Wed Jun 21 12:24:48 2017 From: kisilv at maths.leeds.ac.uk (Vladimir V. Kisil) Date: Wed, 21 Jun 2017 11:24:48 +0100 Subject: [GiNaC-devel] is_exactly_a In-Reply-To: References: Message-ID: <22506.1498040688@math-pc2069.leeds.ac.uk> Dear Jan, >>>>> On Mon, 19 Jun 2017 18:24:21 +0200, Jan Rheinl?nder said: JR> In contrast, 'is_exactly_a(e)' allows you to check whether JR> the top-level object of an expression 'e' is an instance of the JR> GiNaC class 'T', not including parent classes. JR> Shouldn't this read "not including subclasses"? Otherwise, I JR> don't understand what the documentation wants to say. Consider: varidx k(symbol("k"),2); cout << is_a(k) << endl; // -> 1 cout << is_exactly_a(k) << endl; // -> 0 So, varidx k is an instance of idx, but not exactly idx---since the parent class idx of the class varidx is not included in the test is_exactly_a. The wording seems to be right to me. Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/ From kreckel at in.terlu.de Fri Jun 23 11:13:11 2017 From: kreckel at in.terlu.de (Richard B. Kreckel) Date: Fri, 23 Jun 2017 11:13:11 +0200 Subject: [GiNaC-devel] Compiler warnings in CLN In-Reply-To: <8072a939-567e-f505-0962-8ba2880f0643@gmx.de> References: <8072a939-567e-f505-0962-8ba2880f0643@gmx.de> Message-ID: On 06/17/2017 09:25 AM, Jan Rheinl?nder wrote: > Is there any interest in eliminating this kind of warning? Then I could > put together a list. Sure! You may also consider sending a patch right away. -richy. -- Richard B. Kreckel