You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nevermind, I get it now. I think you can solve it by modifying the casting priorities in SWIG. They decide in which order checks are made. Sparsity should have lower priority than DM. MATLAB uses the same typemaps
Changing casting priorities is opening a can of worms. vertcat(spA,spB) would then return type DM because of (possibly dubious) upconversion in our SWIG.
Activity
jgillis commentedon Mar 4, 2023
But what if we want SX?
Is DM a useful common ground?
jgillis commentedon Mar 4, 2023
The following passes:
So DM makes sense
jgillis commentedon Mar 4, 2023
Check if C++ variants match up
jgillis commentedon Mar 4, 2023
veccat,vertcat,horzcat,diagcatshould all fall back to DM when receiving empty arguments.jgillis commentedon Mar 4, 2023
Do we give shape
(0,1)also tovertcat,(1,0)tohorzcatand(0,0)to diagcat? Or just in the case ofveccat?jgillis commentedon Mar 4, 2023
Matlab?
jaeandersson commentedon Mar 5, 2023
Yeah, why would we want to cast [] to Sparsity?
jaeandersson commentedon Mar 5, 2023
Nevermind, I get it now. I think you can solve it by modifying the casting priorities in SWIG. They decide in which order checks are made. Sparsity should have lower priority than DM. MATLAB uses the same typemaps
jgillis commentedon Mar 5, 2023
Changing casting priorities is opening a can of worms.
vertcat(spA,spB)would then return typeDMbecause of (possibly dubious) upconversion in our SWIG.jaeandersson commentedon Mar 5, 2023
I don't think we should cast Sparsity to DM. Isn't that constructor explicit?
issue #2549: veccat/vertcat/horzcat/diagcat with empty argument list