[GiNaC-list] GiNaC-list Digest, Vol 93, Issue 4

Gunnar Birke gunnar.birke at online.de
Mon Sep 30 17:19:40 CEST 2013


On 26.09.2013 12:00, ginac-list-request at ginac.de wrote:
> Send GiNaC-list mailing list submissions to
> 	ginac-list at ginac.de
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://www.cebix.net/mailman/listinfo/ginac-list
> or, via email, send a message with subject or body 'help' to
> 	ginac-list-request at ginac.de
>
> You can reach the person managing the list at
> 	ginac-list-owner at ginac.de
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of GiNaC-list digest..."
>
>
> Today's Topics:
>
>     1. Re: user defined functions and constants (Vladimir V. Kisil)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 26 Sep 2013 09:34:40 +0100
> From: "Vladimir V. Kisil" <kisilv at maths.leeds.ac.uk>
> To: GiNaC discussion list <ginac-list at ginac.de>, Gunnar Birke
> 	<gunnar.birke at online.de>
> Cc: "Vladimir V. Kisil" <kisilv at maths.leeds.ac.uk>
> Subject: Re: [GiNaC-list] user defined functions and constants
> Message-ID: <18176.1380184480 at krein.leeds.ac.uk>
>
> 	Hi,
>
>>>>>> On Sat, 21 Sep 2013 20:07:12 +0200, Gunnar Birke <gunnar.birke at online.de> said:
>      GB> the map, then call subs() with it.  Enable the same support for
>      GB> functions however seems very difficult, as functions can only
>      GB> defined at compile time with a macro.  And using subs() seems a
>      GB> bit silly with functions:
>
>      Unfortunately, I did not understand the difficulty which you were
>    talking about. May be you was mislead by name of GiNaC::function
>    class? For your example, you do not need o define f(x) and g(x,y) as
>    GiNaC::function. They may be happily defined as an GiNaC::ex containing
>    GiNaC::realsymbol x and y. I think, this will be sufficient for most of
>    your purposes.
>
>    Best wishes,
>    Vladimir
Well, my problem is that I don't understand how I turn an GiNaC::ex 
containing f(2) into an GiNaC::ex 2*3+2 in the case that f(x) is some 
GiNaC::ex 3*x + 2 where x is a symbol object. How do I tell GiNaC, that 
f(x) means 3*x+2 at runtime from the moment on the user defined f(x) in 
this manner. What I (think I) understood is that I can define functions 
with DECLARE_FUNCTION and REGISTER_FUNCTION at compile time and that I 
can have an expression GiNaC::ex f, which contains something like 3*x+2 
where x is a symbol. So far so good, but how can I handle things like f(2)?


More information about the GiNaC-list mailing list