| 1 |
<HTML> |
| 2 |
<HEAD> |
| 3 |
<TITLE>HPL_idamax HPL 2.0 Library Functions September 10, 2008</TITLE> |
| 4 |
</HEAD> |
| 5 |
|
| 6 |
<BODY BGCOLOR="WHITE" TEXT = "#000000" LINK = "#0000ff" VLINK = "#000099" |
| 7 |
ALINK = "#ffff00"> |
| 8 |
|
| 9 |
<H1>Name</H1> |
| 10 |
<B>HPL_idamax</B> 1st k s.t. |x_k| = max_i(|x_i|). |
| 11 |
|
| 12 |
<H1>Synopsis</H1> |
| 13 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
| 14 |
<CODE>int</CODE> |
| 15 |
<CODE>HPL_idamax(</CODE> |
| 16 |
<CODE>const int</CODE> |
| 17 |
<CODE>N</CODE>, |
| 18 |
<CODE>const double *</CODE> |
| 19 |
<CODE>X</CODE>, |
| 20 |
<CODE>const int</CODE> |
| 21 |
<CODE>INCX</CODE> |
| 22 |
<CODE>);</CODE> |
| 23 |
|
| 24 |
<H1>Description</H1> |
| 25 |
<B>HPL_idamax</B> |
| 26 |
returns the index in an n-vector x of the first element |
| 27 |
having maximum absolute value. |
| 28 |
|
| 29 |
<H1>Arguments</H1> |
| 30 |
<PRE> |
| 31 |
N (local input) const int |
| 32 |
On entry, N specifies the length of the vector x. N must be |
| 33 |
at least zero. |
| 34 |
</PRE> |
| 35 |
<PRE> |
| 36 |
X (local input) const double * |
| 37 |
On entry, X is an incremented array of dimension at least |
| 38 |
( 1 + ( n - 1 ) * abs( INCX ) ) that contains the vector x. |
| 39 |
</PRE> |
| 40 |
<PRE> |
| 41 |
INCX (local input) const int |
| 42 |
On entry, INCX specifies the increment for the elements of X. |
| 43 |
INCX must not be zero. |
| 44 |
</PRE> |
| 45 |
|
| 46 |
<H1>Example</H1> |
| 47 |
<CODE>#include "hpl.h"</CODE><BR><BR> |
| 48 |
<PRE> |
| 49 |
int main(int argc, char *argv[]) |
| 50 |
{ |
| 51 |
double x[3]; |
| 52 |
int imax; |
| 53 |
x[0] = 1.0; x[1] = 3.0; x[2] = 2.0; |
| 54 |
imax = HPL_idamax( 3, x, 1 ); |
| 55 |
printf("imax=%d\n", imax); |
| 56 |
exit(0); |
| 57 |
return(0); |
| 58 |
} |
| 59 |
</PRE> |
| 60 |
|
| 61 |
<H1>See Also</H1> |
| 62 |
<A HREF="HPL_daxpy.html">HPL_daxpy</A>, |
| 63 |
<A HREF="HPL_dcopy.html">HPL_dcopy</A>, |
| 64 |
<A HREF="HPL_dscal.html">HPL_dscal</A>, |
| 65 |
<A HREF="HPL_dswap.html">HPL_dswap</A>. |
| 66 |
|
| 67 |
</BODY> |
| 68 |
</HTML> |