I came across some old NASA Fortran subroutines for inverting small
matrices. Basically, no loops just long equations for each cell (and a determinant). So efficient for speed, not memory. Interestingly for
5x5 matrix, there are extra lines like
A11=A(1,1)
A12=A(1,2)
then the scalar variables are used thereafter. So I presume the 25
copy operations are offset by faster access later using scalar instead
of indexed array fetch?
I came across some old NASA Fortran subroutines for inverting small matrices. Basically, no loops just long equations for each cell (and a determinant). So efficient for speed, not memory. Interestingly for 5x5 matrix, there are extra lines like
A11=A(1,1)
A12=A(1,2)
then the scalar variables are used thereafter. So I presume the 25 copy operations are offset by faster access later using scalar instead of
indexed array fetch?
Woozy Song <suzyw0ng@outlook.com> schrieb:
I came across some old NASA Fortran subroutines for inverting small
matrices. Basically, no loops just long equations for each cell (and a
determinant). So efficient for speed, not memory. Interestingly for 5x5
matrix, there are extra lines like
A11=A(1,1)
A12=A(1,2)
then the scalar variables are used thereafter. So I presume the 25 copy
operations are offset by faster access later using scalar instead of
indexed array fetch?
I very much doubt this would make a difference for modern optimizing compilers.
Do these routines actually invert matrices? This is rarely needed.
What is the dimension of these matrices?
Thomas Koenig wrote:
Woozy Song <suzyw0ng@outlook.com> schrieb:
I came across some old NASA Fortran subroutines for inverting small
matrices. Basically, no loops just long equations for each cell (and a
determinant). So efficient for speed, not memory. Interestingly for 5x5
matrix, there are extra lines like
A11=A(1,1)
A12=A(1,2)
then the scalar variables are used thereafter. So I presume the 25 copy
operations are offset by faster access later using scalar instead of
indexed array fetch?
I very much doubt this would make a difference for modern optimizing
compilers.
Do these routines actually invert matrices? This is rarely needed.
What is the dimension of these matrices?
dimensions 3x3 to 6x6. I have seen similar snippets elsewhere, but only
for 3x3 and 4x4. I presume there are niche algorithms that do lots of
small matrix inversions.
So if it doesn't gain anything, I guess it was to make the code text
less unwieldly replacing 6 characters with 3.
Thomas Koenig wrote:
Woozy Song <suzyw0ng@outlook.com> schrieb:
I came across some old NASA Fortran subroutines for inverting small
matrices. Basically, no loops just long equations for each cell (and a
determinant). So efficient for speed, not memory. Interestingly for 5x5
matrix, there are extra lines like
A11=A(1,1)
A12=A(1,2)
then the scalar variables are used thereafter. So I presume the 25 copy
operations are offset by faster access later using scalar instead of
indexed array fetch?
I very much doubt this would make a difference for modern optimizing
compilers.
Do these routines actually invert matrices? This is rarely needed.
What is the dimension of these matrices?
dimensions 3x3 to 6x6. I have seen similar snippets elsewhere, but only
for 3x3 and 4x4. I presume there are niche algorithms that do lots of
small matrix inversions.
So if it doesn't gain anything, I guess it was to make the code text
less unwieldly replacing 6 characters with 3.
Woozy Song <suzyw0ng@outlook.com> schrieb:
I came across some old NASA Fortran subroutines for inverting small
matrices. Basically, no loops just long equations for each cell (and a
determinant). So efficient for speed, not memory. Interestingly for 5x5
matrix, there are extra lines like
A11=A(1,1)
A12=A(1,2)
then the scalar variables are used thereafter. So I presume the 25 copy
operations are offset by faster access later using scalar instead of
indexed array fetch?
I very much doubt this would make a difference for modern optimizing compilers.
Do these routines actually invert matrices? This is rarely needed.
What is the dimension of these matrices?
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,113 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 492335:46:20 |
| Calls: | 14,238 |
| Files: | 186,312 |
| D/L today: |
3,564 files (1,160M bytes) |
| Messages: | 2,514,866 |