Replies: 5 comments 2 replies
-
It seems he wrote the matrix library. Let's call him @mikanystrom |
Beta Was this translation helpful? Give feedback.
1 reply
-
Use the LU decomposition library from caltech-other, for example.
https://www2.cpfs.mpg.de/~kasinath/pqm1/lecturenotes/lecture1/NumericalRecipesinF77.pdf
read Section 2.3.
…On Fri, Sep 9, 2022 at 4:02 PM pwd96m4a ***@***.***> wrote:
There are two matrix libraries. One is from caltech-other (written by the
one you mentioned) and one from m3-libs linearalgebra. Can't find the
inverse matrix function on either of them.
—
Reply to this email directly, view it on GitHub
<#1072 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKYNJNYCJ4CTTFPOUJ4IV3V5O6YFANCNFSM6AAAAAAQIRQRK4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
On Sat, 10 Sep 2022, pwd96m4a wrote:
Is there any ready to use functions? It's straight forward on Python,
just call the only one function and it's done. What you can't make
things simpler and just work?
There is the 'arithmetic' package and a binding to LAPACK.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Usually you don't actually want to invert a matrix, except on an exam.
If you're trying to solve a system of equations, there are better
algorithms. Gauss-Jordan for example. LU is even better. Multiplying by
the inverse is far inferior to either both in terms of speed and precision
(partly because the determinant is a high power for large matrices, 1/D can
overflow or underflow quite easily).
If the matrix has special properties, such that it actually makes sense to
invert it, usually you want to use even more specialized algorithms.
In any case, the section of Numerical Recipes i referenced shows how to use
LU to invert a matrix if for some strange reason that's what you really
want. It's a couple of lines of code.
Mika
…On Sun, Sep 11, 2022, 2:55 AM pwd96m4a ***@***.***> wrote:
Is there any ready to use functions? It's straight forward on Python, just
call the only one function and it's done. What you can't make things
simpler and just work?
—
Reply to this email directly, view it on GitHub
<#1072 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKYNJLTU54LTT4TPWL6IA3V5UUZPANCNFSM6AAAAAAQIRQRK4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
hah.. yes there is a Matrix library in there that I wrote.
There are as many ways to invert a matrix as there are to skin a cat...
each having different purposes.
https://github.com/modula3/cm3/blob/master/caltech-other/matrix/src/LU.m3
https://github.com/modula3/cm3/blob/master/caltech-other/matrix/src/LU2.mg
There is a comment on line 14. It's a reference, really. Obviously this
code didn't actually come from a Fortran book. But it works the same.
I think there's a Fortran implementation in here, too, compiled to assembly
language on i386, I think. Hmm.. I guess it doesn't use the Fortran code
on amd64.
There's also SVD, and if you look around, I think there's probably Cholesky
decomposition as well.
Now, what are you trying to do with matrix inversion? Usually that's just
part of some larger algorithm. There's a Newton root finder in the same
directory. The secant method is implemented somewhere else, and some fancy
multi-dimensional optimizers...
Mika
…On Fri, Sep 9, 2022 at 3:48 AM jpgpng ***@***.***> wrote:
It seems he wrote the matrix library. Let's call him @mikanystrom
<https://github.com/mikanystrom>
—
Reply to this email directly, view it on GitHub
<#1072 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKYNJNOJGORI6XETQAGHALV5MIXLANCNFSM6AAAAAAQIRQRK4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
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.
-
Is there any built-in functions to do so?
Beta Was this translation helpful? Give feedback.
All reactions