-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
82 additions
and
21 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,36 @@ | ||
!==============================================================================! | ||
subroutine Expand_Matrix(a, c) | ||
!------------------------------------------------------------------------------! | ||
!----------------------------------[Modules]-----------------------------------! | ||
use Matrix_Mod | ||
!------------------------------------------------------------------------------! | ||
implicit none | ||
!------------------------------------------------------------------------------! | ||
real, allocatable :: a(:,:) | ||
type(Matrix) :: c | ||
!------------------------------------------------------------------------------! | ||
integer :: row, col ! row used to be "i", col used to be "j" | ||
integer :: n, pos | ||
integer :: non_zeros | ||
!==============================================================================! | ||
|
||
n = c % n | ||
|
||
!---------------------! | ||
! Allocate memory ! | ||
!---------------------! | ||
allocate (a(n,n)); | ||
a = 0.0 | ||
|
||
!------------------------------! | ||
! Form the expanded matrix ! | ||
!------------------------------! | ||
pos = 1 | ||
do row = 1, n ! browse through rows | ||
do pos = c % row(row), c % row(row + 1) - 1 ! brows through columns | ||
col = c % col(pos) ! take the real column number | ||
a(row, col) = c % val(pos) | ||
end do | ||
end do | ||
|
||
end subroutine Expand_Matrix |
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,8 @@ | ||
interface | ||
subroutine Expand_Matrix(a, c) | ||
use Matrix_Mod | ||
implicit none | ||
real, allocatable :: a(:,:) | ||
type(Matrix) :: c | ||
end subroutine Expand_Matrix | ||
end interface |
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