LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
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
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 November 2011
71 *
72 *> \ingroup auxOTHERauxiliary
73 *
74 * =====================================================================
75  LOGICAL FUNCTION lsamen( N, CA, CB )
76 *
77 * -- LAPACK auxiliary routine (version 3.4.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 * November 2011
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