-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #798 from perazz/determinant
linalg: determinant
- Loading branch information
Showing
9 changed files
with
621 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
program example_determinant | ||
use stdlib_kinds, only: dp | ||
use stdlib_linalg, only: det, linalg_state_type | ||
implicit none | ||
type(linalg_state_type) :: err | ||
|
||
real(dp) :: d | ||
|
||
! Compute determinate of a real matrix | ||
d = det(reshape([real(dp)::1,2,3,4],[2,2])) | ||
|
||
print *, d ! a*d-b*c = -2.0 | ||
|
||
end program example_determinant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
program example_determinant2 | ||
use stdlib_kinds, only: dp | ||
use stdlib_linalg, only: operator(.det.) | ||
implicit none | ||
|
||
real(dp) :: d | ||
|
||
! Compute determinate of a real matrix | ||
d = .det.reshape([real(dp)::1,2,3,4],[2,2]) | ||
|
||
print *, d ! a*d-b*c = -2.0 | ||
|
||
end program example_determinant2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.