You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

lsamen.f 3.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. *> \brief \b LSAMEN
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. *> \htmlonly
  9. *> Download LSAMEN + dependencies
  10. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/lsamen.f">
  11. *> [TGZ]</a>
  12. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/lsamen.f">
  13. *> [ZIP]</a>
  14. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/lsamen.f">
  15. *> [TXT]</a>
  16. *> \endhtmlonly
  17. *
  18. * Definition:
  19. * ===========
  20. *
  21. * LOGICAL FUNCTION LSAMEN( N, CA, CB )
  22. *
  23. * .. Scalar Arguments ..
  24. * CHARACTER*( * ) CA, CB
  25. * INTEGER N
  26. * ..
  27. *
  28. *
  29. *> \par Purpose:
  30. * =============
  31. *>
  32. *> \verbatim
  33. *>
  34. *> LSAMEN tests if the first N letters of CA are the same as the
  35. *> first N letters of CB, regardless of case.
  36. *> LSAMEN returns .TRUE. if CA and CB are equivalent except for case
  37. *> and .FALSE. otherwise. LSAMEN also returns .FALSE. if LEN( CA )
  38. *> or LEN( CB ) is less than N.
  39. *> \endverbatim
  40. *
  41. * Arguments:
  42. * ==========
  43. *
  44. *> \param[in] N
  45. *> \verbatim
  46. *> N is INTEGER
  47. *> The number of characters in CA and CB to be compared.
  48. *> \endverbatim
  49. *>
  50. *> \param[in] CA
  51. *> \verbatim
  52. *> CA is CHARACTER*(*)
  53. *> \endverbatim
  54. *>
  55. *> \param[in] CB
  56. *> \verbatim
  57. *> CB is CHARACTER*(*)
  58. *> CA and CB specify two character strings of length at least N.
  59. *> Only the first N characters of each string will be accessed.
  60. *> \endverbatim
  61. *
  62. * Authors:
  63. * ========
  64. *
  65. *> \author Univ. of Tennessee
  66. *> \author Univ. of California Berkeley
  67. *> \author Univ. of Colorado Denver
  68. *> \author NAG Ltd.
  69. *
  70. *> \ingroup OTHERauxiliary
  71. *
  72. * =====================================================================
  73. LOGICAL FUNCTION LSAMEN( N, CA, CB )
  74. *
  75. * -- LAPACK auxiliary routine --
  76. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  77. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  78. *
  79. * .. Scalar Arguments ..
  80. CHARACTER*( * ) CA, CB
  81. INTEGER N
  82. * ..
  83. *
  84. * =====================================================================
  85. *
  86. * .. Local Scalars ..
  87. INTEGER I
  88. * ..
  89. * .. External Functions ..
  90. LOGICAL LSAME
  91. EXTERNAL LSAME
  92. * ..
  93. * .. Intrinsic Functions ..
  94. INTRINSIC LEN
  95. * ..
  96. * .. Executable Statements ..
  97. *
  98. LSAMEN = .FALSE.
  99. IF( LEN( CA ).LT.N .OR. LEN( CB ).LT.N )
  100. $ GO TO 20
  101. *
  102. * Do for each character in the two strings.
  103. *
  104. DO 10 I = 1, N
  105. *
  106. * Test if the characters are equal using LSAME.
  107. *
  108. IF( .NOT.LSAME( CA( I: I ), CB( I: I ) ) )
  109. $ GO TO 20
  110. *
  111. 10 CONTINUE
  112. LSAMEN = .TRUE.
  113. *
  114. 20 CONTINUE
  115. RETURN
  116. *
  117. * End of LSAMEN
  118. *
  119. END