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

NAG Library Routine Document

F06FJF

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
    10  Example

1  Purpose

F06FJF updates the Euclidean norm of real vector in scaled form.

2  Specification

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

3  Description

Given an n-element real vector x, and real scalars α and ξ, F06FJF returns updated values α~ and ξ~ such that
α~2ξ~=x12+x22++xn2+α2ξ.  
F06FJF is designed for use in the safe computation of the Euclidean norm of a real vector, without unnecessary overflow or destructive underflow. An initial call to F06FJF (with ξ=1 and α=0) may be followed by further calls to F06FJF and finally a call to F06BMF to complete the computation. Multiple calls of F06FJF 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* – REAL (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 F06FJF SCAL=0.0.
Constraint: SCAL0.0.
On exit: the updated scaling factor α~=maxi α,xi .
5:     SUMSQ – REAL (KIND=nag_wp)Input/Output
On entry: the scaled sum of squares ξ. On the first call to F06FJF SUMSQ=1.0.
Constraint: SUMSQ1.0.
On exit: the updated scaled sum of squares ξ~, satisfying: 1ξ~ξ+n.

6  Error Indicators and Warnings

None.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

None.

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

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