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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. *> \date December 2016
  71. *
  72. *> \ingroup OTHERauxiliary
  73. *
  74. * =====================================================================
  75. LOGICAL FUNCTION LSAMEN( N, CA, CB )
  76. *
  77. * -- LAPACK auxiliary routine (version 3.7.0) --
  78. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  79. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  80. * December 2016
  81. *
  82. * .. Scalar Arguments ..
  83. CHARACTER*( * ) CA, CB
  84. INTEGER N
  85. * ..
  86. *
  87. * =====================================================================
  88. *
  89. * .. Local Scalars ..
  90. INTEGER I
  91. * ..
  92. * .. External Functions ..
  93. LOGICAL LSAME
  94. EXTERNAL LSAME
  95. * ..
  96. * .. Intrinsic Functions ..
  97. INTRINSIC LEN
  98. * ..
  99. * .. Executable Statements ..
  100. *
  101. LSAMEN = .FALSE.
  102. IF( LEN( CA ).LT.N .OR. LEN( CB ).LT.N )
  103. $ GO TO 20
  104. *
  105. * Do for each character in the two strings.
  106. *
  107. DO 10 I = 1, N
  108. *
  109. * Test if the characters are equal using LSAME.
  110. *
  111. IF( .NOT.LSAME( CA( I: I ), CB( I: I ) ) )
  112. $ GO TO 20
  113. *
  114. 10 CONTINUE
  115. LSAMEN = .TRUE.
  116. *
  117. 20 CONTINUE
  118. RETURN
  119. *
  120. * End of LSAMEN
  121. *
  122. END