Hi,
I thought I could mention the module we have created for inlining C/C+
+ code
in Python.
You can use it like this:
from instant import inline
add_func = inline("double add(double a, double b){ return a+b; }")
print "The sum of 3 and 4.5 is ", add_func(3, 4.5)
We combine this with the code-generation utilites in GiNaC/Swinginac
to make sort of "Just-in-time compilation"
of finite element python code. This is why I was curious about C code
generation in sympy.
It is a very small module created on top of SWIG. You can find it at
www.fenics.org/instant.
Kent
On 30 Nov, 16:40, "Ondrej Certik" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just tried this experiment:
>
> http://permalink.gmane.org/gmane.comp.python.cython.devel/311
>
> It's a Cython code, which gets compiled to pure C, compiled with gcc,
> this produces a clean *.so file, which you just import in python.
> It creates a user defined class, which SymPy knows how to work with
> (it expands it, calculates a limit, etc.) and it works.
>
> I am not sure it can speed SymPy up, because most of the time is spent
> by creating new classes, etc. But this should allow us to
> easily and nicely integrate any pure C solution, that we might come with.
>
> Ondrej
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---