SciPy sparse matrix as input format for the jacobian for a linear constraint #422
Replies: 1 comment 1 reply
-
What you're describing is correct, pyOptSparse's sparse matrix format is preferred, and you can use e.g. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm a little confused about the use of the SciPy sparse matrix format when specifying the jacobian for a linear constraint. The documentation states that "We have created a linked list sparse matrix using scipy.sparse. Any SciPy sparse matrix format can be accepted. ". However, when I provide a Scipy sparse matrix I get a warning message that is issued by the ConvertToCOO function
"UserWarning: Using scipy.sparse matrices with pyOptSparse is VERY STRONGLY discouraged. Please use the simplified pyOptSparse format which allows for fixed sparsity structure and explicit zeros in the matrix. There is no way to guarantee a fixed sparsity structure with scipy matrices which is what the underlying optimizers require. Using scipy.sparse matrices may cause unexpected errors."
When I first convert my SciPy sparse matrix to pyOptSparse format, for example by using the convertToCSR function, I have no warning message but I'm not sure it's the intended use.
Many thanks,
Ruben
Beta Was this translation helpful? Give feedback.
All reactions