NAG Library Routine Document

f06kjf (dzssq)

1
Purpose

f06kjf updates the Euclidean norm of complex vector in scaled form.

2
Specification

Fortran Interface
Subroutine f06kjf ( n, x, incx, scal, sumsq)
Integer, Intent (In):: n, incx
Real (Kind=nag_wp), Intent (Inout):: scal, sumsq
Complex (Kind=nag_wp), Intent (In):: x(*)
C Header Interface
#include <nagmk26.h>
void  f06kjf_ (const Integer *n, const Complex x[], const Integer *incx, double *scal, double *sumsq)

3
Description

Given an n-element complex vector x, and real scalars α and ξ, f06kjf returns updated values α~ and ξ~ such that
α~2ξ~=x12+x22++xn2+α2ξ.  
f06kjf is designed for use in the safe computation of the Euclidean norm of a complex vector, without unnecessary overflow or destructive underflow. An initial call to f06kjf (with ξ=1 and α=0) may be followed by further calls to f06kjf and finally a call to f06bmf to complete the computation. Multiple calls of f06kjf may be needed if the elements of the vector cannot all be accessed in a single array x.

4
References

None.

5
Arguments

1:     n – IntegerInput
On entry: n, the number of elements in x.
2:     x* – Complex (Kind=nag_wp) arrayInput
Note: the dimension of the array x must be at least max1, 1+n-1 ×incx .
On entry: the n-element vector x. xi must be stored in x1+i-1×incx, for i=1,2,,n.
Intermediate elements of x are not referenced.
3:     incx – IntegerInput
On entry: the increment in the subscripts of x between successive elements of x.
Constraint: incx>0.
4:     scal – Real (Kind=nag_wp)Input/Output
On entry: the scaling factor α. On the first call to f06kjf scal=0.0.
Constraint: scal0.
On exit: the updated scaling factor α~=maxi α,Rexi,Imxi .
5:     sumsq – Real (Kind=nag_wp)Input/Output
On entry: the scaled sum of squares ξ. On the first call to f06kjf sumsq=1.0.
Constraint: sumsq1.
On exit: the updated scaled sum of squares ξ~, satisfying: 1ξ~ξ+2n.

6
Error Indicators and Warnings

None.

7
Accuracy

Not applicable.

8
Parallelism and Performance

f06kjf is not threaded in any implementation.

9
Further Comments

None.

10
Example

None.