1HPL_idamax(3) HPL Library Functions HPL_idamax(3)
2
3
4
6 HPL_idamax - 1st k s.t. |x_k| = max_i(|x_i|).
7
9 #include "hpl.h"
10
11 int HPL_idamax( const int N, const double * X, const int INCX );
12
14 HPL_idamax returns the index in an n-vector x of the first element
15 having maximum absolute value.
16
18 N (local input) const int
19 On entry, N specifies the length of the vector x. N must be
20 at least zero.
21
22 X (local input) const double *
23 On entry, X is an incremented array of dimension at least (
24 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x.
25
26 INCX (local input) const int
27 On entry, INCX specifies the increment for the elements of X.
28 INCX must not be zero.
29
31 #include "hpl.h"
32
33 int main(int argc, char *argv[])
34 {
35 double x[3];
36 int imax;
37 x[0] = 1.0; x[1] = 3.0; x[2] = 2.0;
38 imax = HPL_idamax( 3, x, 1 );
39 printf("imax=%d\n", imax);
40 exit(0);
41 return(0);
42 }
43
45 HPL_daxpy (3), HPL_dcopy (3), HPL_dscal (3), HPL_dswap (3).
46
47
48
49HPL 2.2 February 24, 2016 HPL_idamax(3)