F06KJF (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F06KJF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

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

2  Specification

SUBROUTINE F06KJF ( N, X, INCX, SCAL, SUMSQ)
INTEGER  N, INCX
REAL (KIND=nag_wp)  SCAL, SUMSQ
COMPLEX (KIND=nag_wp)  X(*)

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  Parameters

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  Further Comments

None.

9  Example

None.

F06KJF (PDF version)
F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012