Ondrej Certik wrote: > I suggest you first hack on the C code generation that you need. I am > sure if you work on this in a general way, Luke will help out too, as > he needs it in pydy too. And I'll help too, since this is something > that is needed. > > As to fixing the issues #1399 and #1400 in cse(), of course any help > is appreciated. But I think it's not a show stopper for now --- it > just makes the C function a bit more complicated than it has to be, > but once the cse() is improved, it will work. >
That is indeed a wise thought. I'll get back to the cse code later. I've noticed that next to the ccode function, there is also a module sympy.utilities.compilef, which contains several related routines, e.g. to generate and compile c routines based on lambda expressions, and to evaluate C functions an a range of numbers. There are many good things in this module, but I would prefer to separate the different concerns. We should focus on a module that just generates C code and tackle other issues such as compilation and evaluation an a range of numbers in different places. I think that a code generator is a bit more than what ccode does. A code generator should generate something compilable, including function declarations, parameters with data types, local variables, return statement, header files, and so on. I'll make an onset for this in a seperate module, ccodegen.py, that will extensively use the ccode function. In a later phase, we can think of a fortran analogon. I've also taken a quick look at the codegen implementation of Mark Dewing: https://quameon.svn.sourceforge.net/svnroot/quameon/trunk/codegen This is also a good source of inspiration, and a previous version of this code is able to generate c code: http://www.markdewing.com/prog_in_math/intro.xhtml This seems to be rather advanced. This code generator writes entire programs with functions calling each other. I would already be happy with a relatively simple code generator that writes a library of independent routines. cheers, Toon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---
begin:vcard fn:Toon Verstraelen n:Verstraelen;Toon org:Ghent University;Center for Molecular Modeling adr:;;Proeftuinstraat 86;Ghent;;9000;Belgium email;internet:toon.verstrae...@ugent.be title:ir. tel;work:+32 (0) 9 264 65 56 tel;home:+32 (0) 9 351 56 05 x-mozilla-html:FALSE url:http://molmod.ugent.be version:2.1 end:vcard