~ubuntu-branches/ubuntu/raring/python-scipy/raring-proposed

« back to all changes in this revision

Viewing changes to Lib/linsolve/SuperLU/SRC/lsame.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-07 14:12:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070107141212-mm0ebkh5b37hcpzn
* Remove build dependency on python-numpy-dev.
* python-scipy: Depend on python-numpy instead of python-numpy-dev.
* Package builds on other archs than i386. Closes: #402783.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
int lsame_(char *ca, char *cb)
 
2
{
 
3
/*  -- LAPACK auxiliary routine (version 2.0) --   
 
4
       Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,   
 
5
       Courant Institute, Argonne National Lab, and Rice University   
 
6
       September 30, 1994   
 
7
 
 
8
    Purpose   
 
9
    =======   
 
10
 
 
11
    LSAME returns .TRUE. if CA is the same letter as CB regardless of case.   
 
12
 
 
13
    Arguments   
 
14
    =========   
 
15
 
 
16
    CA      (input) CHARACTER*1   
 
17
    CB      (input) CHARACTER*1   
 
18
            CA and CB specify the single characters to be compared.   
 
19
 
 
20
   ===================================================================== 
 
21
*/  
 
22
 
 
23
    /* System generated locals */
 
24
    int ret_val;
 
25
    
 
26
    /* Local variables */
 
27
    int inta, intb, zcode;
 
28
 
 
29
    ret_val = *(unsigned char *)ca == *(unsigned char *)cb;
 
30
    if (ret_val) {
 
31
        return ret_val;
 
32
    }
 
33
 
 
34
    /* Now test for equivalence if both characters are alphabetic. */
 
35
 
 
36
    zcode = 'Z';
 
37
 
 
38
    /* Use 'Z' rather than 'A' so that ASCII can be detected on Prime   
 
39
       machines, on which ICHAR returns a value with bit 8 set.   
 
40
       ICHAR('A') on Prime machines returns 193 which is the same as   
 
41
       ICHAR('A') on an EBCDIC machine. */
 
42
 
 
43
    inta = *(unsigned char *)ca;
 
44
    intb = *(unsigned char *)cb;
 
45
 
 
46
    if (zcode == 90 || zcode == 122) {
 
47
        /* ASCII is assumed - ZCODE is the ASCII code of either lower or   
 
48
          upper case 'Z'. */
 
49
        if (inta >= 97 && inta <= 122) inta += -32;
 
50
        if (intb >= 97 && intb <= 122) intb += -32;
 
51
 
 
52
    } else if (zcode == 233 || zcode == 169) {
 
53
        /* EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or   
 
54
          upper case 'Z'. */
 
55
        if (inta >= 129 && inta <= 137 || inta >= 145 && inta <= 153 || inta 
 
56
                >= 162 && inta <= 169)
 
57
            inta += 64;
 
58
        if (intb >= 129 && intb <= 137 || intb >= 145 && intb <= 153 || intb 
 
59
                >= 162 && intb <= 169)
 
60
            intb += 64;
 
61
    } else if (zcode == 218 || zcode == 250) {
 
62
        /* ASCII is assumed, on Prime machines - ZCODE is the ASCII code   
 
63
          plus 128 of either lower or upper case 'Z'. */
 
64
        if (inta >= 225 && inta <= 250) inta += -32;
 
65
        if (intb >= 225 && intb <= 250) intb += -32;
 
66
    }
 
67
    ret_val = inta == intb;
 
68
    return ret_val;
 
69
    
 
70
} /* lsame_ */