# NAG FL Interfacef06fkf (dnrm2w)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

f06fkf computes the weighted Euclidean norm of a real vector.

## 2Specification

Fortran Interface
 Function f06fkf ( n, w, incw, x, incx)
 Real (Kind=nag_wp) :: f06fkf Integer, Intent (In) :: n, incw, incx Real (Kind=nag_wp), Intent (In) :: w(*), x(*)
#include <nag.h>
 double f06fkf_ (const Integer *n, const double w[], const Integer *incw, const double x[], const Integer *incx)
The routine may be called by the names f06fkf or nagf_blas_dnrm2w.

## 3Description

f06fkf returns, via the function name, the weighted Euclidean norm
 $xTWx$
of the $n$-element real vector $x$ scattered with stride incw and incx respectively, where $W=\mathrm{diag}\left(w\right)$ and $w$ is a vector of weights scattered with stride incw.

None.

## 5Arguments

1: $\mathbf{n}$Integer Input
On entry: $n$, the number of elements in $x$.
2: $\mathbf{w}\left(*\right)$Real (Kind=nag_wp) array Input
Note: the dimension of the array w must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{n}}-1\right)×|{\mathbf{incw}}|\right)$.
On entry: $w$, the vector of weights.
If ${\mathbf{incw}}>0$, ${w}_{\mathit{i}}$ must be stored in ${\mathbf{w}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{incx}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$.
If ${\mathbf{incw}}<0$, ${w}_{\mathit{i}}$ must be stored in ${\mathbf{w}}\left(1-\left({\mathbf{n}}-\mathit{i}\right)×{\mathbf{incw}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$.
Constraint: All weights must be non-negative.
3: $\mathbf{incw}$Integer Input
On entry: the increment in the subscripts of w between successive elements of $w$.
4: $\mathbf{x}\left(*\right)$Real (Kind=nag_wp) array Input
Note: the dimension of the array x must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{n}}-1\right)×|{\mathbf{incx}}|\right)$.
On entry: the $n$-element vector $x$.
If ${\mathbf{incx}}>0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{x}}\left(1+\left(\mathit{i}-1\right)×{\mathbf{incx}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$.
If ${\mathbf{incx}}<0$, ${x}_{\mathit{i}}$ must be stored in ${\mathbf{x}}\left(1-\left({\mathbf{n}}-\mathit{i}\right)×{\mathbf{incx}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$.
Intermediate elements of x are not referenced.
5: $\mathbf{incx}$Integer Input
On entry: the increment in the subscripts of x between successive elements of $x$.

None.

Not applicable.

## 8Parallelism and Performance

f06fkf is not threaded in any implementation.