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_zsum (f16gl)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_blast_zsum (f16gl) sums the elements of a complex vector.

Syntax

[result] = f16gl(n, x, incx)
[result] = nag_blast_zsum(n, x, incx)

Description

nag_blast_zsum (f16gl) returns the sum
x1 + x2 + + xn  
of the elements of an n-element complex vector x, via the function name.
If n0 on entry, nag_blast_zsum (f16gl) returns the value 0+0i.

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
n, the number of elements in x.
2:     x1+n-1×incx – complex array
The vector x. Element xi is stored in xi-1×incx+1, for i=1,2,,n.
3:     incx int64int32nag_int scalar
The increment in the subscripts of x between successive elements of x.
Constraint: incx0.

Optional Input Parameters

None.

Output Parameters

1:     result – complex scalar
The result of the function.

Error Indicators and Warnings

If incx=0, an error message is printed and program execution is terminated.

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

This example computes the sum of the elements of
x = 1.1+10.2i,11.5-2.7i,9.2T .  
function f16gl_example


fprintf('f16gl example results\n\n');

% sum complex x
n    = int64(3);
x    = [ 1.1 + 10.2i      11.5 - 2.7i      9.2 + 0i];
incx = int64(1);

[xsum] = f16gl(n, x, incx);

fprintf('sum(x) = %7.1f%+7.1fi\n', real(xsum), imag(xsum));


f16gl example results

sum(x) =    21.8   +7.5i

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–2015