F06 Chapter Contents
F06 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF06FCF

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.

## 1  Purpose

F06FCF multiplies a real vector by a real diagonal matrix.

## 2  Specification

 SUBROUTINE F06FCF ( N, D, INCD, X, INCX)
 INTEGER N, INCD, INCX REAL (KIND=nag_wp) D(*), X(*)

## 3  Description

F06FCF performs the operation
 $x←Dx$
where $x$ is an $n$-element real vector and $D=\mathrm{diag}\left(d\right)$ is a real diagonal matrix.
Equivalently, the routine performs the element-by-element product of the vectors $x$ and $d$
 $xi=dixi, i=1,2,…,n.$

None.

## 5  Parameters

1:     $\mathrm{N}$ – INTEGERInput
On entry: $n$, the number of elements in $d$ and $x$.
2:     $\mathrm{D}\left(*\right)$ – REAL (KIND=nag_wp) arrayInput
Note: the dimension of the array D must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,1+\left({\mathbf{N}}-1\right)×\left|{\mathbf{INCD}}\right|\right)$.
On entry: the vector $d$.
If ${\mathbf{INCD}}>0$, ${d}_{\mathit{i}}$ must be stored in ${\mathbf{D}}\left(\left(\mathit{i}-1\right)×{\mathbf{INCD}}+1\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
If ${\mathbf{INCD}}<0$, ${d}_{\mathit{i}}$ must be stored in ${\mathbf{D}}\left(1-\left({\mathbf{N}}-\mathit{i}\right)×{\mathbf{INCD}}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{N}}$.
3:     $\mathrm{INCD}$ – INTEGERInput
On entry: the increment in the subscripts of D between successive elements of $d$.
4:     $\mathrm{X}\left(*\right)$ – REAL (KIND=nag_wp) arrayInput/Output
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)×\left|{\mathbf{INCX}}\right|\right)$.
On entry: the array X must contain 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}}$.
On exit: the updated vector $x$ stored in the array elements used to supply the original vector $x$.
Intermediate elements of X are unchanged.
5:     $\mathrm{INCX}$ – INTEGERInput
On entry: the increment in the subscripts of X between successive elements of $x$.

None.

Not applicable.

## 8  Parallelism and Performance

F06FCF is not threaded by NAG in any implementation.
F06FCF makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.