Purpose
To check if A = DIAG*I, where I is an M-by-N matrix with ones on the diagonal and zeros elsewhere.Specification
      LOGICAL FUNCTION MA02HD( JOB, M, N, DIAG, A, LDA )
C     .. Scalar Arguments ..
      CHARACTER          JOB
      INTEGER            LDA, M, N
      DOUBLE PRECISION   DIAG
C     .. Array Arguments ..
      DOUBLE PRECISION   A(LDA,*)
Function Value
  MA02HD  LOGICAL
          The function value is set to .TRUE. if A = DIAG*I, and to
          .FALSE., otherwise.
Arguments
Mode Parameters
  JOB     CHARACTER*1
          Specifies the part of the matrix A to be checked out,
          as follows:
          = 'U': Upper triangular/trapezoidal part;
          = 'L': Lower triangular/trapezoidal part.
          Otherwise:  All of the matrix A.
Input/Output Parameters
  M      (input) INTEGER
         The number of rows of the matrix A.  M >= 0.
  N      (input) INTEGER
         The number of columns of the matrix A.  N >= 0.
  DIAG   (input) DOUBLE PRECISION
         The scalar DIAG.
  A      (input) DOUBLE PRECISION array, dimension (LDA,N)
         The leading M-by-N part of this array must contain the
         matrix A.  If JOB = 'U', only the upper triangle or
         trapezoid is accessed; if JOB = 'L', only the lower
         triangle or trapezoid is accessed.
  LDA    INTEGER
         The leading dimension of the array A.  LDA >= max(1,M).
Method
The routine returns immediately after detecting a diagonal element which differs from DIAG, or a nonzero off-diagonal element in the searched part of A.Further Comments
NoneExample
Program Text
NoneProgram Data
NoneProgram Results
None