LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
lsame.f
Go to the documentation of this file.
1*> \brief \b LSAME
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8* Definition:
9* ===========
10*
11* LOGICAL FUNCTION LSAME( CA, CB )
12*
13* .. Scalar Arguments ..
14* CHARACTER CA, CB
15* ..
16*
17*
18*> \par Purpose:
19* =============
20*>
21*> \verbatim
22*>
23*> LSAME returns .TRUE. if CA is the same letter as CB regardless of
24*> case.
25*> \endverbatim
26*
27* Arguments:
28* ==========
29*
30*> \param[in] CA
31*> \param[in] CB
32*> \verbatim
33*> CA and CB specify the single characters to be compared.
34*> \endverbatim
35*
36* Authors:
37* ========
38*
39*> \author Univ. of Tennessee
40*> \author Univ. of California Berkeley
41*> \author Univ. of Colorado Denver
42*> \author NAG Ltd.
43*
44*> \ingroup lsame
45*
46* =====================================================================
47 LOGICAL FUNCTION lsame( CA, CB )
48*
49* -- LAPACK auxiliary routine --
50* -- LAPACK is a software package provided by Univ. of Tennessee, --
51* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
52*
53* .. Scalar Arguments ..
54 CHARACTER ca, cb
55* ..
56*
57* =====================================================================
58*
59* .. Intrinsic Functions ..
60 INTRINSIC ichar
61* ..
62* .. Local Scalars ..
63 INTEGER inta, intb, zcode
64* ..
65* .. Executable Statements ..
66*
67* Test if the characters are equal
68*
69 lsame = ca.EQ.cb
70 IF( lsame )
71 $ RETURN
72*
73* Now test for equivalence if both characters are alphabetic.
74*
75 zcode = ichar( 'Z' )
76*
77* Use 'Z' rather than 'A' so that ASCII can be detected on Prime
78* machines, on which ICHAR returns a value with bit 8 set.
79* ICHAR('A') on Prime machines returns 193 which is the same as
80* ICHAR('A') on an EBCDIC machine.
81*
82 inta = ichar( ca )
83 intb = ichar( cb )
84*
85 IF( zcode.EQ.90 .OR. zcode.EQ.122 ) THEN
86*
87* ASCII is assumed - ZCODE is the ASCII code of either lower or
88* upper case 'Z'.
89*
90 IF( inta.GE.97 .AND. inta.LE.122 ) inta = inta - 32
91 IF( intb.GE.97 .AND. intb.LE.122 ) intb = intb - 32
92*
93 ELSE IF( zcode.EQ.233 .OR. zcode.EQ.169 ) THEN
94*
95* EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
96* upper case 'Z'.
97*
98 IF( inta.GE.129 .AND. inta.LE.137 .OR.
99 $ inta.GE.145 .AND. inta.LE.153 .OR.
100 $ inta.GE.162 .AND. inta.LE.169 ) inta = inta + 64
101 IF( intb.GE.129 .AND. intb.LE.137 .OR.
102 $ intb.GE.145 .AND. intb.LE.153 .OR.
103 $ intb.GE.162 .AND. intb.LE.169 ) intb = intb + 64
104*
105 ELSE IF( zcode.EQ.218 .OR. zcode.EQ.250 ) THEN
106*
107* ASCII is assumed, on Prime machines - ZCODE is the ASCII code
108* plus 128 of either lower or upper case 'Z'.
109*
110 IF( inta.GE.225 .AND. inta.LE.250 ) inta = inta - 32
111 IF( intb.GE.225 .AND. intb.LE.250 ) intb = intb - 32
112 END IF
113 lsame = inta.EQ.intb
114*
115* RETURN
116*
117* End of LSAME
118*
119 END
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48