CCodeGen: Convert all arguments to InOutArguments.

15 views
Skip to first unread message

Michael Afanasiev

unread,
Jul 6, 2015, 11:28:00 AM7/6/15
to sy...@googlegroups.com
Hello,

I'm using CCodeGen from sympy.utilities.codegen, and it's working great. I'd like to make all the arguments of a given expression InOutArguments, so that they are passed by reference in the corresponding C code. I haven't quite been able to figure this out by reading the documentation. A code snippit as it stands goes like:

# Make mass matrix.
mass_matrix
= N.T * N
mass_matrix_C
= CCodeGen(project='mass_matrix')
routines
= []
for x in range(order+1):
   
for y in range(order+1):


        name
= 'mm_%d%d' % (x, y)
        routines
.append(mass_matrix_C.routine(
            name
, mass_matrix[x,y], argument_sequence=None))            
       
mass_matrix_C
.write(routines, 'mass_matrix', to_files=True)
exit()

Is there something I can modify here? 

Thanks for any help!

Mike.
Reply all
Reply to author
Forward
0 new messages