My only real requirement is that it generate something that can be compiled
and then wrapped with ctypes. I haven't checked out theano yet, but I'll
take a look. I'm hoping to eventually be able to loosen the ctypes
requirement too, since the real underlying requirement is to have a
function pointer i can pass to fortran code in place of a python callback.
Does this sound like something theano would help with?


On Tue, Oct 8, 2013 at 2:38 PM, Matthew Rocklin <[email protected]> wrote:

> If you don't need human readable code the Theano solution should handle
> all of this just fine by the way.
>
>
> On Tue, Oct 8, 2013 at 1:37 PM, Ondřej Čertík <[email protected]>wrote:
>
>> On Tue, Oct 8, 2013 at 2:32 PM, Nathan Woods <[email protected]>
>> wrote:
>> > I'm getting a compiler error using "gcc -c integrand.c".
>> >
>> > integrand.c: In function ‘integrand’:
>> > integrand.c:13:11: error: expected expression before ‘if’
>> >
>> > The generated C-code is :
>> >
>> >
>> /******************************************************************************
>> >  *                      Code generated with sympy 0.7.2
>> > *
>> >  *
>> > *
>> >  *              See http://www.sympy.org/ for more information.
>> > *
>> >  *
>> > *
>> >  *                       This file is part of 'project'
>> > *
>> >
>> >
>> ******************************************************************************/
>> > #include "integrand.h"
>> > #include <math.h>
>> >
>> > double integrand(double t, double x, double y) {
>> >
>> >    return if (x < 0.5) {
>>
>> ^^^ I see, obviously the printing of Piecewise() is wrong.
>>
>>
>> >
>> >       t*x*y + pow(x, 2) + pow(y, 2) + cos(t) - 1
>>
>> ^^^ this is wrong too.
>>
>> >    }
>> >    else if (x >= 0.5) {
>> >       t*x*y + pow(x, 2) + pow(y, 2) + cos(t)
>> >    };
>> >
>> > }
>>
>> I started fixing it here:
>>
>> https://github.com/sympy/sympy/pull/2524
>>
>>
>>
>> Ondrej
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sympy.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to