You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tril - lower triangular part of an array triu - upper triangular part of an array
Return a copy of the lower/upper triangular part of a rank-2 array. The elements below/above the k-th diagonal are replaced with zeroes (default k=0)
Useful to recover the lower or upper part of a matrix factorization.
Interface
interface tril
modulefunctiontril_rsp(A) result(L)
real(sp), intent(in) :: A(:,:)
real(sp) :: L(size(A,1),size(A,2))
endfunctionmodulefunctiontril_k_rsp(A,k) result(L)
real(sp), intent(in) :: A(:,:)
integer, intent(in) :: k
real(sp) :: L(size(A,1),size(A,2))
endfunction
! .. repeat for all real and integer kinds ..
end interface
Analogous interface for triu. The interfaces would go to the file stdlib_experimental_linalg.f90. Implementations would go to the submodule stdlib_experimental_linalg_trilu.f90.
Point for discussion: two separate functions (without or with diagonal) as shown above or only a single interface using the present intrinsic?
I was working on some Kalman filter stuff today, and I realized this would be useful to check I am calling the right sequence of BLAS and LAPACK routines.
triu and tril
tril
- lower triangular part of an arraytriu
- upper triangular part of an arrayReturn a copy of the lower/upper triangular part of a rank-2 array. The elements below/above the
k
-th diagonal are replaced with zeroes (defaultk=0
)Useful to recover the lower or upper part of a matrix factorization.
Interface
Analogous interface for
triu
. The interfaces would go to the filestdlib_experimental_linalg.f90
. Implementations would go to the submodulestdlib_experimental_linalg_trilu.f90
.Point for discussion: two separate functions (without or with diagonal) as shown above or only a single interface using the
present
intrinsic?Other languages
Julia
MATLAB
Python (NumPy)
C++
Other
tril!(M)
andtriu!(M)
syntax for this purpose.The text was updated successfully, but these errors were encountered: