Skip to content
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

Remove casadi.MX #89

Merged
merged 5 commits into from
Jun 25, 2024
Merged

Remove casadi.MX #89

merged 5 commits into from
Jun 25, 2024

Conversation

Giulero
Copy link
Collaborator

@Giulero Giulero commented Jun 21, 2024

I did some tests using casadi.MX, and I figured out that that MX is not really elastic. For example, a "numeric MX" (an MX filled with numbers) cannot be converted to a DM, while a "numeric SX" can.
Also, MX and SX cannot be converted to each other.

On the other hand, passing through a casadi.Function allows the user to choose the type of the input and have the output of the same type, i.e.

a_sx = cs.SX.sym('a')
b_sx = cs.SX.sym('b')

fun = cs.Function('fun', [a,b], [a+b])

c_sx = fun(a_sx, b_sx)

a_mx = cs.MX.sym('a')
b_mx = cs.MX.sym('b')
 
c_mx = fun(a_mx, b_mx)

# this should be possible also with casadi.DM and numpy 

For this reason (and also because I've not implemented sufficient tests) I want to revert #84, for now, and just do the computation with casadi.SX and exploit the casadi.Function.

@Giulero
Copy link
Collaborator Author

Giulero commented Jun 25, 2024

Thanks @GiulioRomualdi!

Cc @traversaro, @S-Dafarra I had to revert #84, the MX support needs more development.

@Giulero Giulero merged commit 393abd8 into main Jun 25, 2024
15 checks passed
@Giulero Giulero deleted the remove-mx branch June 25, 2024 09:28
@S-Dafarra
Copy link
Member

Also, MX and SX cannot be converted to each other.

I think that the conversion from MX to SX should be possible with expand 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants