Re: [GiNaC-list] Term ordering and compiling C++ code
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@yahoo.com> An: GiNaC discussion list <ginac-list@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
Beautiful. Thanks! --- On Wed, 5/26/10, Martin Ettl <ettl.martin@gmx.de> wrote: From: Martin Ettl <ettl.martin@gmx.de> ... What do you think about my modifications (see attachment)?
participants (2)
-
Doug
-
Martin Ettl