lsame.f.html

来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 111 行

HTML
111
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>lsame.f</title>
 <meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!-- 
body { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default   { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default a { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.string   { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.string a { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.comment   { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.comment a { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
 --></style>

 </head>
  <body>

<pre>
      LOGICAL          FUNCTION <a name="LSAME.1"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( CA, CB )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK auxiliary routine (version 3.1) --
</span><span class="comment">*</span><span class="comment">     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment">     November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Scalar Arguments ..
</span>      CHARACTER          CA, CB
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Purpose
</span><span class="comment">*</span><span class="comment">  =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="LSAME.14"></a><a href="lsame.f.html#LSAME.1">LSAME</a> returns .TRUE. if CA is the same letter as CB regardless of
</span><span class="comment">*</span><span class="comment">  case.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Arguments
</span><span class="comment">*</span><span class="comment">  =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  CA      (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">  CB      (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          CA and CB specify the single characters to be compared.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> =====================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          ICHAR
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      INTEGER            INTA, INTB, ZCODE
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Test if the characters are equal
</span><span class="comment">*</span><span class="comment">
</span>      <a name="LSAME.36"></a><a href="lsame.f.html#LSAME.1">LSAME</a> = CA.EQ.CB
      IF( <a name="LSAME.37"></a><a href="lsame.f.html#LSAME.1">LSAME</a> )
     $   RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Now test for equivalence if both characters are alphabetic.
</span><span class="comment">*</span><span class="comment">
</span>      ZCODE = ICHAR( <span class="string">'Z'</span> )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Use 'Z' rather than 'A' so that ASCII can be detected on Prime
</span><span class="comment">*</span><span class="comment">     machines, on which ICHAR returns a value with bit 8 set.
</span><span class="comment">*</span><span class="comment">     ICHAR('A') on Prime machines returns 193 which is the same as
</span><span class="comment">*</span><span class="comment">     ICHAR('A') on an EBCDIC machine.
</span><span class="comment">*</span><span class="comment">
</span>      INTA = ICHAR( CA )
      INTB = ICHAR( CB )
<span class="comment">*</span><span class="comment">
</span>      IF( ZCODE.EQ.90 .OR. ZCODE.EQ.122 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        ASCII is assumed - ZCODE is the ASCII code of either lower or
</span><span class="comment">*</span><span class="comment">        upper case 'Z'.
</span><span class="comment">*</span><span class="comment">
</span>         IF( INTA.GE.97 .AND. INTA.LE.122 ) INTA = INTA - 32
         IF( INTB.GE.97 .AND. INTB.LE.122 ) INTB = INTB - 32
<span class="comment">*</span><span class="comment">
</span>      ELSE IF( ZCODE.EQ.233 .OR. ZCODE.EQ.169 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
</span><span class="comment">*</span><span class="comment">        upper case 'Z'.
</span><span class="comment">*</span><span class="comment">
</span>         IF( INTA.GE.129 .AND. INTA.LE.137 .OR.
     $       INTA.GE.145 .AND. INTA.LE.153 .OR.
     $       INTA.GE.162 .AND. INTA.LE.169 ) INTA = INTA + 64
         IF( INTB.GE.129 .AND. INTB.LE.137 .OR.
     $       INTB.GE.145 .AND. INTB.LE.153 .OR.
     $       INTB.GE.162 .AND. INTB.LE.169 ) INTB = INTB + 64
<span class="comment">*</span><span class="comment">
</span>      ELSE IF( ZCODE.EQ.218 .OR. ZCODE.EQ.250 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        ASCII is assumed, on Prime machines - ZCODE is the ASCII code
</span><span class="comment">*</span><span class="comment">        plus 128 of either lower or upper case 'Z'.
</span><span class="comment">*</span><span class="comment">
</span>         IF( INTA.GE.225 .AND. INTA.LE.250 ) INTA = INTA - 32
         IF( INTB.GE.225 .AND. INTB.LE.250 ) INTB = INTB - 32
      END IF
      <a name="LSAME.80"></a><a href="lsame.f.html#LSAME.1">LSAME</a> = INTA.EQ.INTB
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     RETURN
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     End of <a name="LSAME.84"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
</span><span class="comment">*</span><span class="comment">
</span>      END

</pre>

 </body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?