c_check_tridiag Function

function c_check_tridiag(Amat) result(Mcheck)

Arguments

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

Return Value logical


Calls

proc~~c_check_tridiag~2~~CallsGraph proc~c_check_tridiag~2 c_check_tridiag assert_shape assert_shape proc~c_check_tridiag~2->assert_shape

Source Code

function c_check_tridiag(Amat) result(Mcheck)
  complex(8),dimension(:,:)                    :: Amat
  logical,dimension(size(Amat,1),size(Amat,2)) :: Lmat
  logical                                      :: Mcheck
  integer                                      :: i,N
  N=size(Amat,1)
  call assert_shape(Amat,[N,N],"c_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 c_check_tridiag