NAG Library Routine Document

f06fjf (dssq)

1
Purpose

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

2
Specification

Fortran Interface
Subroutine f06fjf ( n, x, incx, scal, sumsq)
Integer, Intent (In):: n, incx
Real (Kind=nag_wp), Intent (In):: x(*)
Real (Kind=nag_wp), Intent (Inout):: scal, sumsq
C Header Interface
#include <nagmk26.h>
void  f06fjf_ (const Integer *n, const double x[], const Integer *incx, double *scal, double *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
Arguments

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

f06fjf is not threaded in any implementation.

9
Further Comments

None.

10
Example

None.