Matrix inversion in Ivy #138
Replies: 6 comments
-
Thanks. If someone didn't keep asking for other features :), my plan was to implement it this week. But: I want to do Moore-Penrose general inversion, although Gauss-Jordan elimination is one of the steps for that. By the way, are you just playing with ivy or do you have a real use for it? |
Beta Was this translation helpful? Give feedback.
-
A built-in implementation would, of course, be even better.
Mainly, I play around with it, learn, and try to solve code "katas" with it when it seems to fit well. But it has been my desktop calculator for everyday calculations for some time. |
Beta Was this translation helpful? Give feedback.
-
By the way, your id operator is very clear, but one conventional and slightly more obscure method is 3 3 rho 1 0 0 0 which is also 3 3 rho 4 take 1 and can be expressed several ways; here's one that doesn't need parentheses: op id n = n n rho 1, n take 0 |
Beta Was this translation helpful? Give feedback.
-
I learned it from this 1975 APL demonstration.
Thank you, this is clearly more efficient, as indicated by |
Beta Was this translation helpful? Give feedback.
-
I have now pushed an implementation to GitHub. Commit 6e13ebc |
Beta Was this translation helpful? Give feedback.
-
Thank you, that looks great! I'm closing the discussion, even though it's just a "Show and tell," as there is likely no further need for discussion on this matter. |
Beta Was this translation helpful? Give feedback.
-
Should anyone require it, here's an implementation of matrix inversion via Gauss-Jordan elimination in Ivy, similar to this APL implementation.
Example usage:
Beta Was this translation helpful? Give feedback.
All reactions