ISAMAX(3S)ISAMAX(3S)NAME
ISAMAX, IDAMAX, ICAMAX, IZAMAX - Searches a vector for the first
occurrence of the maximum absolute value
SYNOPSIS
Single precision
Fortran:
integer ISAMAX
integer index
index = ISAMAX (n, x, incx)
C/C++:
#include <scsl_blas.h>
int isamax (int n, float *x, int incx);
Double precision
Fortran:
integer IDAMAX
integer index
index = IDAMAX (n, x, incx)
C/C++:
#include <scsl_blas.h>
int idamax (int n, double *x, int incx);
Single precision complex
Fortran:
integer ICAMAX
integer index
index = ICAMAX (n, x, incx)
C/C++:
#include <scsl_blas.h>
int icamax (int n, scsl_complex *x, int incx);
C++ STL:
#include <complex.h>
#include <scsl_blas.h>
int icamax (int n, complex<float> *x, int incx);
Double precision complex
Fortran:
integer IZAMAX
integer index
index = IZAMAX (n, x, incx)
Page 1
ISAMAX(3S)ISAMAX(3S)
C/C++:
#include <scsl_blas.h>
int izamax (int n, scsl_zomplex *x, int incx);
C++ STL:
#include <complex.h>
#include <scsl_blas.h>
int izamax (int n, complex<double> *x, int incx);
IMPLEMENTATION
These routines are part of the SCSL Scientific Library and can be loaded
using either the -lscs or the -lscs_mp option. The -lscs_mp option
directs the linker to use the multi-processor version of the library.
When linking to SCSL with -lscs or -lscs_mp, the default integer size is
4 bytes (32 bits). Another version of SCSL is available in which integers
are 8 bytes (64 bits). This version allows the user access to larger
memory sizes and helps when porting legacy Cray codes. It can be loaded
by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use
only one of the two versions; 4-byte integer and 8-byte integer library
calls cannot be mixed.
The C and C++ prototypes shown above are appropriate for the 4-byte
integer version of SCSL. When using the 8-byte integer version, the
variables of type int become long long and the <scsl_blas_i8.h> header
file should be included.
DESCRIPTION
ISAMAX/IDAMAX searches a real vector for the first occurrence of the
maximum absolute value.
ICAMAX/IZAMAX searches a complex vector for the first occurrence of the
maximum absolute value.
ISAMAX returns the first index i such that
|x | = MAX |x | : j = 1, ..., n
i j (j = 0, ..., n-1 for C/C++)
where xj is an element of a real vector.
ICAMAX determines the first index i such that
|Real(x )| + |Imag(x )| =
i i
MAX(|Real(x )| + |Imag(x )|) : j = 1, ..., n
j j (j = 0, ..., n-1 for C/C++)
Page 2
ISAMAX(3S)ISAMAX(3S)
where xj is an element of a complex vector.
See the NOTES section of this man page for information about the
interpretation of the data types described in the following arguments.
These functions have the following arguments:
index Integer. (output)
First index of maximum absolute value.
n Integer. (input)
Number of elements to process in the vector to be searched. If n
<= 0, these routines return 0 (-1 for C/C++).
x Array of dimension (n-1) * |incx| + 1. (input)
ISAMAX: Single precision array.
IDAMAX: Double precision array.
ICAMAX: Single precision complex array.
IZAMAX: Double precision complex array.
Array x contains the vector to be searched.
incx Integer. (input)
Increment between elements of x.
NOTES
When scanning backward (incx < 0), each routine starts at the end of the
vector and moves backward, as follows:
Fortran:
x(1 - incx * (n-1)), x(1 - incx * (n-2)), ..., x(1)
C/C++:
x[-incx * (n-1)], x[incx * (n - 2)], ..., x(0)
The largest absolute value is:
Fortran:
|x(1 + incx * (index-1))| when incx > 0
|x(1 - incx * (n-index))| when incx < 0
C/C++:
|x[incx * (index-1)]| when incx > 0
Page 3
ISAMAX(3S)ISAMAX(3S)
|x[-incx * (n-index)]| when incx < 0
These routines are Level 1 Basic Linear Algebra Subprograms (Level 1
BLAS).
Data Types
The following data types are described in this documentation:
Term Used Data type
Fortran:
Array dimensioned n x(n)
Integer INTEGER (INTEGER*8 for -lscs_i8[_mp])
Single precision REAL
Double precision DOUBLE PRECISION
Single precision complex COMPLEX
Double precision complex DOUBLE COMPLEX
C/C++:
Array dimensioned n x[n]
Integer int (long long for -lscs_i8[_mp])
Single precision float
Double precision double
Single precision complex scsl_complex
Double precision complex scsl_zomplex
C++ STL:
Array dimensioned n x[n]
Integer int (long long for -lscs_i8[_mp])
Single precision float
Double precision double
Single precision complex complex<float>
Page 4
ISAMAX(3S)ISAMAX(3S)
Double precision complex complex<double>
SEE ALSOINTRO_SCSL(3S), INTRO_BLAS1(3S), ISMAX(3S)INTRO_CBLAS(3S) for information about using the C interface to Fortran 77
Basic Linear Algebra Subprograms (legacy BLAS) set forth by the Basic
Linear Algebra Subprograms Technical Forum.
Page 5