Source module last modified on Thu, 2 Jul 1998, 23:17;
HTML image of Fortran source automatically generated by
for2html on Sun, 23 Jun 2002, 15:10.
LOGICAL FUNCTION LSAME( CA, CB )
#
# -- LAPACK auxiliary routine (version 2.0) --
# Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
# Courant Institute, Argonne National Lab, and Rice University
# January 31, 1994
#
# .. Scalar Arguments ..
CHARACTER CA, CB
# ..
#
# Purpose
# =======
#
# LSAME returns .TRUE. if CA is the same letter as CB regardless of
# case.
#
# Arguments
# =========
#
# CA (input) CHARACTER*1
# CB (input) CHARACTER*1
# CA and CB specify the single characters to be compared.
#
# =====================================================================
#
# .. Intrinsic Functions ..
INTRINSIC ICHAR
# ..
# .. Local Scalars ..
INTEGER INTA, INTB, ZCODE
# ..
# .. Executable Statements ..
#
# Test if the characters are equal
#
LSAME = CA==CB
IF( LSAME )
$ RETURN
#
# Now test for equivalence if both characters are alphabetic.
#
ZCODE = ICHAR( 'Z' )
#
# Use 'Z' rather than 'A' so that ASCII can be detected on Prime
# machines, on which ICHAR returns a value with bit 8 set.
# ICHAR('A') on Prime machines returns 193 which is the same as
# ICHAR('A') on an EBCDIC machine.
#
INTA = ICHAR( CA )
INTB = ICHAR( CB )
#
IF( ZCODE==90 || ZCODE==122 ) THEN
#
# ASCII is assumed - ZCODE is the ASCII code of either lower or
# upper case 'Z'.
#
IF( INTA>=97 && INTA<=122 ) INTA = INTA - 32
IF( INTB>=97 && INTB<=122 ) INTB = INTB - 32
#
ELSE IF( ZCODE==233 || ZCODE==169 ) THEN
#
# EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
# upper case 'Z'.
#
IF( INTA>=129 && INTA<=137 ||
$ INTA>=145 && INTA<=153 ||
$ INTA>=162 && INTA<=169 ) INTA = INTA + 64
IF( INTB>=129 && INTB<=137 ||
$ INTB>=145 && INTB<=153 ||
$ INTB>=162 && INTB<=169 ) INTB = INTB + 64
#
ELSE IF( ZCODE==218 || ZCODE==250 ) THEN
#
# ASCII is assumed, on Prime machines - ZCODE is the ASCII code
# plus 128 of either lower or upper case 'Z'.
#
IF( INTA>=225 && INTA<=250 ) INTA = INTA - 32
IF( INTB>=225 && INTB<=250 ) INTB = INTB - 32
END IF
LSAME = INTA==INTB
#
# RETURN
#
# End of LSAME
#
END