LAPACK  3.10.1 LAPACK: Linear Algebra PACKage
lsamen.f
Go to the documentation of this file.
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
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
logical function lsamen(N, CA, CB)
LSAMEN
Definition: lsamen.f:74
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53