annotate ext/cblas/src/idamax.c @ 209:ccd2019190bf msvc

Some MSVC fixes, including (temporarily, probably) renaming the FFT source file to avoid getting it mixed up with the Vamp SDK one in our object dir
author Chris Cannam
date Thu, 01 Feb 2018 16:34:08 +0000
parents 45330e0d2819
children
rev   line source
Chris@202 1 /* idamax.f -- translated by f2c (version 20061008).
Chris@202 2 You must link the resulting object file with libf2c:
Chris@202 3 on Microsoft Windows system, link with libf2c.lib;
Chris@202 4 on Linux or Unix systems, link with .../path/to/libf2c.a -lm
Chris@202 5 or, if you install libf2c.a in a standard place, with -lf2c -lm
Chris@202 6 -- in that order, at the end of the command line, as in
Chris@202 7 cc *.o -lf2c -lm
Chris@202 8 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
Chris@202 9
Chris@202 10 http://www.netlib.org/f2c/libf2c.zip
Chris@202 11 */
Chris@202 12
Chris@202 13 #include "f2c.h"
Chris@202 14 #include "blaswrap.h"
Chris@202 15
Chris@202 16 integer idamax_(integer *n, doublereal *dx, integer *incx)
Chris@202 17 {
Chris@202 18 /* System generated locals */
Chris@202 19 integer ret_val, i__1;
Chris@202 20 doublereal d__1;
Chris@202 21
Chris@202 22 /* Local variables */
Chris@202 23 integer i__, ix;
Chris@202 24 doublereal dmax__;
Chris@202 25
Chris@202 26 /* .. Scalar Arguments .. */
Chris@202 27 /* .. */
Chris@202 28 /* .. Array Arguments .. */
Chris@202 29 /* .. */
Chris@202 30
Chris@202 31 /* Purpose */
Chris@202 32 /* ======= */
Chris@202 33
Chris@202 34 /* finds the index of element having max. absolute value. */
Chris@202 35 /* jack dongarra, linpack, 3/11/78. */
Chris@202 36 /* modified 3/93 to return if incx .le. 0. */
Chris@202 37 /* modified 12/3/93, array(1) declarations changed to array(*) */
Chris@202 38
Chris@202 39
Chris@202 40 /* .. Local Scalars .. */
Chris@202 41 /* .. */
Chris@202 42 /* .. Intrinsic Functions .. */
Chris@202 43 /* .. */
Chris@202 44 /* Parameter adjustments */
Chris@202 45 --dx;
Chris@202 46
Chris@202 47 /* Function Body */
Chris@202 48 ret_val = 0;
Chris@202 49 if (*n < 1 || *incx <= 0) {
Chris@202 50 return ret_val;
Chris@202 51 }
Chris@202 52 ret_val = 1;
Chris@202 53 if (*n == 1) {
Chris@202 54 return ret_val;
Chris@202 55 }
Chris@202 56 if (*incx == 1) {
Chris@202 57 goto L20;
Chris@202 58 }
Chris@202 59
Chris@202 60 /* code for increment not equal to 1 */
Chris@202 61
Chris@202 62 ix = 1;
Chris@202 63 dmax__ = abs(dx[1]);
Chris@202 64 ix += *incx;
Chris@202 65 i__1 = *n;
Chris@202 66 for (i__ = 2; i__ <= i__1; ++i__) {
Chris@202 67 if ((d__1 = dx[ix], abs(d__1)) <= dmax__) {
Chris@202 68 goto L5;
Chris@202 69 }
Chris@202 70 ret_val = i__;
Chris@202 71 dmax__ = (d__1 = dx[ix], abs(d__1));
Chris@202 72 L5:
Chris@202 73 ix += *incx;
Chris@202 74 /* L10: */
Chris@202 75 }
Chris@202 76 return ret_val;
Chris@202 77
Chris@202 78 /* code for increment equal to 1 */
Chris@202 79
Chris@202 80 L20:
Chris@202 81 dmax__ = abs(dx[1]);
Chris@202 82 i__1 = *n;
Chris@202 83 for (i__ = 2; i__ <= i__1; ++i__) {
Chris@202 84 if ((d__1 = dx[i__], abs(d__1)) <= dmax__) {
Chris@202 85 goto L30;
Chris@202 86 }
Chris@202 87 ret_val = i__;
Chris@202 88 dmax__ = (d__1 = dx[i__], abs(d__1));
Chris@202 89 L30:
Chris@202 90 ;
Chris@202 91 }
Chris@202 92 return ret_val;
Chris@202 93 } /* idamax_ */