I am trying to create a cvxopt.spmatrix object (see cvxopt doc) in Julia using PyCall. However, if I run the following code:
using PyCall
@pyimport cvxopt as cvx
I = [0.0 1 3 1 5 2 6 3 4 5 4 5 6 5 6]
J = [0.0 0 0 1 1 2 2 3 3 3 4 4 4 5 6]
B = cvx.spmatrix(0.1,I,J)
I get the following error message:
ERROR: LoadError: PyError (ccall(@pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, arg, C_NULL)) TypeError('invalid array type',)
I believe this is because the PyCall Wrapper converts the Julia arrays I,J to a Python array that is incompatible with the spmatrix constructor. I think it wants a Python-list.
I know there is a Julia interface for cvx, but I need the spmatrix for a different purpose. Any ideas how to solve this? Thank you very much for your help!