hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_blast_zamax_val (f16js)

Purpose

nag_blast_zamax_val (f16js) computes, with respect to absolute value, the largest component of a complex vector, along with the index of that component.

Syntax

[k, r] = f16js(n, x, incx)
[k, r] = nag_blast_zamax_val(n, x, incx)

Description

nag_blast_zamax_val (f16js) computes, with respect to absolute value, the largest component, rr, of an nn-element complex vector xx, and determines the smallest index, kk, such that
r = |Rexk| + |Imxk| = max |Rexj| + |Imxj|.
j
r = |Rexk| + |Imxk| = maxj |Rexj| + |Imxj| .

References

Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001) Basic Linear Algebra Subprograms Technical (BLAST) Forum Standard University of Tennessee, Knoxville, Tennessee http://www.netlib.org/blas/blast-forum/blas-report.pdf

Parameters

Compulsory Input Parameters

1:     n – int64int32nag_int scalar
nn, the number of elements in xx.
2:     x(1 + (n1) × |incx|1+(n-1)×|incx|) – complex array
The vector xx. Element xixi is stored in x((i1) × |incx| + 1)x(i-1)×|incx|+1, for i = 1,2,,ni=1,2,,n.
3:     incx – int64int32nag_int scalar
The increment in the subscripts of x between successive elements of xx.
Constraint: incx0incx0.

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

1:     k – int64int32nag_int scalar
kk, the index, from the set {1,1 + |incx|,,1 + (n1) × |incx|} {1,1+|incx|,,1+(n-1)×|incx|} , of the largest component of xx with respect to absolute value. If n0n0 on input then k is returned as 00.
2:     r – double scalar
rr, the largest component of xx with respect to absolute value. If n0n0 on input then r is returned as 0.00.0.

Error Indicators and Warnings

Accuracy

The BLAS standard requires accurate implementations which avoid unnecessary over/underflow (see Section 2.7 of Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001)).

Further Comments

None.

Example

function nag_blast_zamax_val_example
n = int64(3);
x = [ -4 + 2.1i;
      3.7 + 4.5i;
      -6 + 1.2i];
incx = int64(1);
[k, r] = nag_blast_zamax_val(n, x, incx)
 

k =

                    2


r =

    8.2000


function f16js_example
n = int64(3);
x = [ -4 + 2.1i;
      3.7 + 4.5i;
      -6 + 1.2i];
incx = int64(1);
[k, r] = f16js(n, x, incx)
 

k =

                    2


r =

    8.2000



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013