New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to concatenate a cp.Variable vector #2328
Comments
This is not a bug. The behavior is the same as numpy. Try using the bmat function and make all elements 2 dimensional. For example, |
Thanks, it works this way. However, just for information, numpy is a bit smarter.
Error:
Same example with numpy works fine:
Output correct:
|
That's good to know. We will make it work in cvxpy then. |
For reference |
bmat also returns a matrix object and not an ndarray, so will probably be
discouraged moving forward. It would be prudent for us to make an analog of
NumPy’s block function.
…On Wed, Feb 14, 2024 at 5:58 PM Steven Diamond ***@***.***> wrote:
For reference numpy.bmat does not handle scalars gracefully like
numpy.block.
—
Reply to this email directly, view it on GitHub
<#2328 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACRLIFFW5ETYKRYBXQH2Y2DYTU6PXAVCNFSM6AAAAABB6R5SMWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBUHEZDCMRQGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Describe the bug
I'm trying to make an LMI constraint like:
[[scalar, variable2D'],
[variable2D, identity2D]] >>0
but is impossible due to the fact that the solver does not concatenate the elements. The entire matrix at the end has a shape = (2,2) and not (3,3) as expected.
To Reproduce
Expected behavior
c_vert
must be a vector with 3 elements. First one as known scalar and second ones fromx
variable vector.Output
Version
The text was updated successfully, but these errors were encountered: