[GiNaC-list] Term ordering and compiling C++ code

Martin Ettl ettl.martin at gmx.de
Wed May 26 23:45:29 CEST 2010


Hello Doug and all,

thank you for sharing your code. I think this should be included to ginac release. The ability to create c++-code is very imporant. I modified your version in order to support c++-templates. This means you can define the datatype, e.g.: T, long double, some custom type,....

e.g.: for long double type use the function:
gprint.setType("long double"); By default the double type is used, in order to not brake backwardcompatiblity.

What do you think about my modifications (see attachment)?

Best regards from Germany

Martin Ettl


-------- Original-Nachricht --------
> Datum: Tue, 25 May 2010 07:45:05 -0700 (PDT)
> Von: Doug <cape1232 at yahoo.com>
> An: GiNaC discussion list <ginac-list at ginac.de>
> Betreff: Re: [GiNaC-list] Term ordering and compiling C++ code

> Hi All,
> 
> Attached is the code for generating C/C++ code from a GiNaC expression
> that pulls out subexpressions and declares them up front so that they only
> have to be evaluated once.  The .hh file has documentation and a simple usage
> example.
> 
> I hope this is useful.
> 
> I used it to reduce 50MB of code to under 300K and improved the running
> time dramatically.
> 
> -Doug
> 
> Support NPR 20 seconds at a time.  www.twentysecondsatatime.org
> 
> 
> 
> 
>       

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GinacPrint.hh
Type: text/x-c++hdr
Size: 5712 bytes
Desc: not available
URL: <http://www.cebix.net/pipermail/ginac-list/attachments/20100526/179c6464/attachment.hh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GinacPrint.cc
Type: text/x-c++src
Size: 5517 bytes
Desc: not available
URL: <http://www.cebix.net/pipermail/ginac-list/attachments/20100526/179c6464/attachment.cc>


More information about the GiNaC-list mailing list