Skip to content

Commit

Permalink
Algorithm update
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Sep 25, 2019
1 parent a53f95c commit fb336d5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Source/Functions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,18 @@ FUNCTION identity(n) RESULT(A)
INTEGER, INTENT(IN) :: n
REAL(4), DIMENSION(n, n) :: A
INTEGER :: i
INTEGER :: j

! Build identity matrix
FORALL (i=1:n)
A(i, i) = 1.0
END FORALL
DO i=1,n
DO j = 1,n
IF (i == j) THEN
A(i,j) = 1.0
ELSE
A(i,j) = 0.0
ENDIF
ENDDO
ENDDO

END FUNCTION identity
!-------------------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit fb336d5

Please sign in to comment.