Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f39bf52
add source file
perazz May 23, 2024
c0da712
working implementation
perazz May 23, 2024
92b1ac5
reorganize as `submodule`
perazz May 23, 2024
e9a3f5b
add tests
perazz May 23, 2024
b233156
option for pre-allocated pivot indices
perazz May 23, 2024
dc0127b
add examples
perazz May 23, 2024
75a5a23
document `.inv.A`
perazz May 23, 2024
bf0dfd3
document `invert`
perazz May 23, 2024
db90b37
document `inv`
perazz May 23, 2024
6a1c397
typo
perazz May 23, 2024
e10e4c4
test for singular matrix; activate `complex` matrix tests
perazz May 27, 2024
db714bb
Merge branch 'master' into matrix_inverse
perazz May 28, 2024
5f320f9
subroutine version, non in-place
perazz Jun 5, 2024
47ee61a
test subroutine version, non in-place
perazz Jun 5, 2024
e2159bc
`.inv.` operator: `error stop` on issues
perazz Jun 5, 2024
b23c811
Merge branch 'master' into matrix_inverse
perazz Jun 6, 2024
8b138f7
add non-in-place subroutine example
perazz Jun 21, 2024
513d77b
rename example programs
perazz Jun 21, 2024
5d7d7ba
Update doc/specs/stdlib_linalg.md
perazz Jun 21, 2024
63006d2
Update doc/specs/stdlib_linalg.md
perazz Jun 21, 2024
41f502e
Update doc/specs/stdlib_linalg.md
perazz Jun 21, 2024
860cbb0
Update doc/specs/stdlib_linalg.md
perazz Jun 21, 2024
80a7742
new test: random SPD matrix (real, complex)
perazz Jun 21, 2024
3c0bcdb
Update doc/specs/stdlib_linalg.md
perazz Jun 21, 2024
505f30a
lwork: overflow-safer evaluation
perazz Jun 21, 2024
d0af9be
`operator(.inv.)`: return `NaN`s on exceptions
perazz Jun 21, 2024
40062c4
Merge branch 'matrix_inverse' of github.com:perazz/stdlib into matrix…
perazz Jun 21, 2024
406e170
typo: set complex NaN
perazz Jun 21, 2024
3e7c82e
lstsq: explain singular values better
perazz Jun 21, 2024
a292e9d
Update stdlib_linalg.md
perazz Jun 27, 2024
8b52b1a
Merge branch 'master' into matrix_inverse
perazz Jun 30, 2024
7386d2d
Update src/stdlib_linalg.fypp
perazz Jul 2, 2024
35efbe8
Merge branch 'fortran-lang:master' into matrix_inverse
perazz Jul 5, 2024
bb3f7e4
remove `xdp` restriction
perazz Jul 5, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add non-in-place subroutine example
  • Loading branch information
perazz committed Jun 21, 2024
commit 8b138f714761455dd7c787b5867b579dbb60e58f
1 change: 1 addition & 0 deletions example/linalg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ADD_EXAMPLE(is_triangular)
ADD_EXAMPLE(inverse1)
ADD_EXAMPLE(inverse2)
ADD_EXAMPLE(inverse3)
ADD_EXAMPLE(inverse4)
ADD_EXAMPLE(outer_product)
ADD_EXAMPLE(trace)
ADD_EXAMPLE(state1)
Expand Down
22 changes: 22 additions & 0 deletions example/linalg/example_inverse4.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
! Matrix inversion example: subroutine interface
program example_inverse4
use stdlib_linalg_constants, only: dp
use stdlib_linalg, only: invert,eye
implicit none

real(dp) :: A(2,2), Am1(2,2)

! Input matrix (NB Fortran is column major! input columns then transpose)
A = transpose(reshape( [4, 3, &
3, 2], [2,2] ))

! Invert matrix
call invert(A,Am1)

print *, ' |',Am1(1,:),'|' ! | -2 3 |
print *, ' inv(A)= |',Am1(2,:),'|' ! | 3 -4 |

! Final check
print *, 'CHECK passed? ',matmul(A,Am1)==eye(2)

end program example_inverse4