SetTriu
This subroutine sets the lower triangular part of matrix.
Interface
- ܀ Interface
- ️܀ See example
- ↢
MODULE PURE SUBROUTINE SetTriu(A, lu, diagNo)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(INOUT) :: A(:, :)
INTEGER(I4B), OPTIONAL, INTENT(IN) :: diagNo
!! diagonal number, default = 0
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: lu(:, :)
END SUBROUTINE SetTriu
This example shows the use of SetTriu.
program main
use easifemBase
implicit none
Testing for Square matrix
REAL( Real32 ) :: A( 4, 4 ), lu(4, 4), B(4,4)
CALL RANDOM_NUMBER(A); A = A*10
CALl Display(MdEncode(A), "A = " // CHAR_LF // CHAR_LF)
See results
A =
2.859 | 5.5172 | 1.6403 | 5.7708 |
8.8695 | 6.974 | 5.6426 | 0.80722 |
6.8828 | 4.0238 | 9.9846 | 9.9341 |
2.7916 | 1.4534 | 5.1318 | 2.3856 |
B = 0.0
CALL GetTriu(A=A, diagNo=0, lu=lu)
CALL SetTriu(A=B, diagNo=0, lu=lu)
CALL Display(MdEncode(B), "diagNo=0, = " // CHAR_LF // CHAR_LF )
See results
diagNo=0, =
2.859 | 5.5172 | 1.6403 | 5.7708 |
0 | 6.974 | 5.6426 | 0.80722 |
0 | 0 | 9.9846 | 9.9341 |
0 | 0 | 0 | 2.3856 |
B = 0.0
CALL GetTriu(A=A, diagNo=1, lu=lu)
CALL SetTriu(A=B, diagNo=1, lu=lu)
CALL Display(MdEncode(B), "diagNo=1, = " // CHAR_LF // CHAR_LF )
See results
diagNo=1, =
0 | 5.5172 | 1.6403 | 5.7708 |
0 | 0 | 5.6426 | 0.80722 |
0 | 0 | 0 | 9.9341 |
0 | 0 | 0 | 0 |
end program main