First I think there is a problem with ccode doing what it is supposed to 
do.  Consider the following code -
(x,y,th) = symbols(r"x' y' \theta")

then
x' = ccode(x)
y' = ccode(y)
\theta = ccode(th)

I don't think x', y', and \theta are legal program variables in c.

Also I have looking at codegen examples and wish to know if the following 
conclusion is correct. If I have a python function (example) -
def W(x):
    s = 1
    for i in range(10): 
        s += x**i
   return s 

there is no simple way (if any) to convert it to -
double W(double x) 
{ 
  double s = 1; 
  int i; 
  for (i=0;i<10;++i)
  { 
    s = s+pow(x,i); 
  }
  return s; 
} 
On Saturday, March 18, 2023 at 11:14:20 AM UTC-4 moore...@gmail.com wrote:

> You can make custom printers for any SymPy function to return what you 
> desire. Subclass the C printer and overwrite/create methods for your 
> functions. The current c code printer does not target any specialized C 
> libraries (but that would be a nice addition!).
>
> Jason
> moorepants.info
> +01 530-601-9791 <(530)%20601-9791>
>
>
> On Sat, Mar 18, 2023 at 3:18 PM brombo <abrom...@gmail.com> wrote:
>
>> I have looked further and while ccode(expr) can export functions like 
>> sin, cox, exp it cannot export special functions such as bessel, elliptic, 
>> etc.. Is there a way to export special functions into c-code?
>>
>> On Saturday, March 18, 2023 at 9:52:48 AM UTC-4 brombo wrote:
>>
>>> Does the C code generator generate special function calls with the same 
>>> syntax that is used in the gsl (GNU Scientific Library).  For example is 
>>> the sympy call besselj(nu,z) translated to J(nu,z) etc.?
>>>
>> -- 
>> 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 sympy+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sympy/73a99292-df6c-420a-804a-b2a52dfae437n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/sympy/73a99292-df6c-420a-804a-b2a52dfae437n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/8dd42cf4-470d-4d78-9b99-71a617b0ff25n%40googlegroups.com.

Reply via email to