Is there a way to pass a numpy array to C ++ / SWIG just by using a pointer to the first element? I have a C ++ function that anticipates a 3-on-N matrix, which is expected to be stored in a columnar indexed contiguous memory. Therefore, the function call takes the following parameters:
( double *mat3Xin, double *mat3Xout, int numTrip)
where numTrip is the dimension N of the matrix (i.e., the number of triplets). Since the input and output are the same size, I do not require this to be transmitted. Is there a way to easily handle this in SWIG without using the built-in swig rename function and creating a helper function that accepts additional parameters? Swig numpy interface required for matrices? I am currently scattering the matrices in a helper function, which then calls the renamed version of the original function, however it starts tediously converting all the functions in my existing library into this form.
Thanks,
source
share