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_dsum (f16el)

Purpose

nag_blast_dsum (f16el) sums the elements of a real vector.

Syntax

[result] = f16el(n, x, incx)
[result] = nag_blast_dsum(n, x, incx)

Description

nag_blast_dsum (f16el) returns the sum
x1 + x2 + + xn
x1 + x2 + + xn
of the elements of an nn-element real vector xx, via the function name.
If n0n0 on entry, nag_blast_dsum (f16el) returns the value 00.

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|) – double 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:     result – double scalar
The result of the function.

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_dsum_example
n = int64(5);
x = [1.1;
     10.2;
     11.5;
     -2.7;
     9.2];
incx = int64(1);
[result] = nag_blast_dsum(n, x, incx)
 

result =

   29.3000


function f16el_example
n = int64(5);
x = [1.1;
     10.2;
     11.5;
     -2.7;
     9.2];
incx = int64(1);
[result] = f16el(n, x, incx)
 

result =

   29.3000



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