~ubuntu-branches/ubuntu/edgy/k3d/edgy-proposed

« back to all changes in this revision

Viewing changes to modules/mesh/superlu/blas/idamax.c

  • Committer: Bazaar Package Importer
  • Author(s): David Martínez Moreno
  • Date: 2005-04-28 18:38:10 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050428183810-kvc6nz46z6gheo0k
Tags: 0.4.5.0-5
* AAAAAAAARGH, *patching* configure.ac broke again the build process! Fixed
  (I hope).
* Removed more cruft of shaderpreprocessor/ from configure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*  -- translated by f2c (version 19940927).
 
3
   You must link the resulting object file with the libraries:
 
4
        -lf2c -lm   (in that order)
 
5
*/
 
6
 
 
7
#include "f2c.h"
 
8
 
 
9
integer idamax_(integer *n, doublereal *dx, integer *incx)
 
10
{
 
11
 
 
12
 
 
13
    /* System generated locals */
 
14
    integer ret_val, i__1;
 
15
    doublereal d__1;
 
16
 
 
17
    /* Local variables */
 
18
    static doublereal dmax__;
 
19
    static integer i, ix;
 
20
 
 
21
 
 
22
/*     finds the index of element having max. absolute value.   
 
23
       jack dongarra, linpack, 3/11/78.   
 
24
       modified 3/93 to return if incx .le. 0.   
 
25
       modified 12/3/93, array(1) declarations changed to array(*)   
 
26
 
 
27
 
 
28
    
 
29
   Parameter adjustments   
 
30
       Function Body */
 
31
#define DX(I) dx[(I)-1]
 
32
 
 
33
 
 
34
    ret_val = 0;
 
35
    if (*n < 1 || *incx <= 0) {
 
36
        return ret_val;
 
37
    }
 
38
    ret_val = 1;
 
39
    if (*n == 1) {
 
40
        return ret_val;
 
41
    }
 
42
    if (*incx == 1) {
 
43
        goto L20;
 
44
    }
 
45
 
 
46
/*        code for increment not equal to 1 */
 
47
 
 
48
    ix = 1;
 
49
    dmax__ = abs(DX(1));
 
50
    ix += *incx;
 
51
    i__1 = *n;
 
52
    for (i = 2; i <= *n; ++i) {
 
53
        if ((d__1 = DX(ix), abs(d__1)) <= dmax__) {
 
54
            goto L5;
 
55
        }
 
56
        ret_val = i;
 
57
        dmax__ = (d__1 = DX(ix), abs(d__1));
 
58
L5:
 
59
        ix += *incx;
 
60
/* L10: */
 
61
    }
 
62
    return ret_val;
 
63
 
 
64
/*        code for increment equal to 1 */
 
65
 
 
66
L20:
 
67
    dmax__ = abs(DX(1));
 
68
    i__1 = *n;
 
69
    for (i = 2; i <= *n; ++i) {
 
70
        if ((d__1 = DX(i), abs(d__1)) <= dmax__) {
 
71
            goto L30;
 
72
        }
 
73
        ret_val = i;
 
74
        dmax__ = (d__1 = DX(i), abs(d__1));
 
75
L30:
 
76
        ;
 
77
    }
 
78
    return ret_val;
 
79
} /* idamax_ */
 
80