d_check_tridiag Function

function d_check_tridiag(Amat) result(Mcheck)

Arguments

Type IntentOptional Attributes Name
real(kind=8), dimension(:,:) :: Amat

Return Value logical


Calls

proc~~d_check_tridiag~2~~CallsGraph proc~d_check_tridiag~2 d_check_tridiag assert_shape assert_shape proc~d_check_tridiag~2->assert_shape

Source Code

function d_check_tridiag(Amat) result(Mcheck)
  real(8),dimension(:,:)                       :: Amat
  logical,dimension(size(Amat,1),size(Amat,2)) :: Lmat
  logical                                      :: Mcheck
  integer                                      :: i,j,N
  N=size(Amat,1)
  call assert_shape(Amat,[N,N],"d_check_tridiag","Amat")
  Lmat=.true.
  forall(i=1:N-1)
     Lmat(i+1,i)=.false.
     Lmat(i,i)  =.false.
     Lmat(i,i+1)=.false.
  end forall
  Lmat(N,N)=.false.
  Mcheck = .not.(sum(abs(Amat),mask=Lmat)>0d0)
end function d_check_tridiag