Replies: 1 comment
|
The numerical results are consistent; the difference is in CasADi's stored sparsity pattern. Binary operations currently dispatch as follows: scalar left operand to
Therefore, the 1-by-1 result looks like a sparsity consistency or optimization gap rather than an incorrect numerical result. For numeric |
0 replies
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.
Dear all,
I found what is, in my opinion, an inconsistent behaviour in computing the element-wise power of a sparse matrix with scalar exponent compared to the same power with matrix exponent:
DM(1,1).^1) returns a dense zero.DM(2,2).^1) returns a sparse zero matrix.DM(2,2).^DM.ones(2,2)) returns a dense zero matrix.I would think that all three expressions should return the same result (namely -- but that might be a separate discussion -- a sparse zero matrix).
Is this behaviour intended?
I am using CasADi v3.7.2 with MATLAB R2024a on an Apple M3 with MacOS Tahoe 26.5.1.
Thanks!
All reactions