naginterfaces.library.blas.dssq

naginterfaces.library.blas.dssq(x, scal, sumsq)[source]

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

For full information please refer to the NAG Library document for f06fj

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/f06/f06fjf.html

Parameters
xfloat, array-like, shape

The -element vector .

scalfloat

The scaling factor . On the first call to dssq .

sumsqfloat

The scaled sum of squares . On the first call to dssq .

Returns
scalfloat

The updated scaling factor .

sumsqfloat

The updated scaled sum of squares , satisfying: .

Raises
NagValueError
(errno )

On entry, error in parameter .

Constraint: .

(errno )

On entry, error in parameter .

Constraint: .

(errno )

On entry, error in parameter .

Constraint: .

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

Given an -element real vector , and real scalars and , dssq returns updated values and such that

dssq 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 dssq (with and ) may be followed by further calls to dssq and finally a call to dnorm() to complete the computation. Multiple calls of dssq may be needed if the elements of the vector cannot all be accessed in a single array .