Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
?rotmg
Computes the parameters for a modified Givens rotation.
Syntax
call srotmg(d1, d2, x1, y1, param)
call drotmg(d1, d2, x1, y1, param)
call rotmg(d1, d2, x1, y1, param)
Include Files
mkl.fi, mkl_blas.f90
Description
Given Cartesian coordinates \((x_1, y_1)\) of an input vector, these routines compute the components of a modified Givens transformation matrix \(H\) that zeros the y-component of the resulting vector:
\[\begin{bmatrix} x_1 \\ 0 \end{bmatrix} = H \begin{bmatrix} x_1 \, \sqrt{d_1} \\ y_1 \, \sqrt{d_2} \end{bmatrix} \]
Input Parameters
- d1
-
REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the scaling factor for the x-coordinate of the input vector.
- d2
-
REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the scaling factor for the y-coordinate of the input vector.
- x1
-
REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the x-coordinate of the input vector.
- y1
-
REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the y-coordinate of the input vector.
Output Parameters
- d1
-
REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the first diagonal element of the updated matrix.
- d2
-
REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the second diagonal element of the updated matrix.
- x1
-
REAL for srotmg
DOUBLE PRECISION for drotmg
Provides the x-coordinate of the rotated vector before scaling.
- param
-
REAL array for srotmg
DOUBLE PRECISION array for drotmg
The size is 5.
param(1) contains a switch. param(2) to param(5) may store the elements of the matrix \(H\), \(h_{11}\), \(h_{21}\), \(h_{12}\), and \(h_{22}\), respectively. Depending on the value of param(1), the representation of \(H\) is given as follows:
param(1) = -1.0:
\[H = \begin{bmatrix} h_{11} & h_{12} \\ h_{21} & h_{22} \end{bmatrix} \]
param(1) = 0.0:
\[H = \begin{bmatrix} 1.0 & h_{12} \\ h_{21} & 1.0 \end{bmatrix} \]
param(1) = 1.0:
\[H = \begin{bmatrix} h_{11} & 1.0 \\ -1.0 & h_{22} \end{bmatrix} \]
param(1) = -2.0:
\[H = \begin{bmatrix} 1.0 & 0.0 \\ 0.0 & 1.0 \end{bmatrix} \]
In the last three cases, the matrix entries of 1.0, -1.0, and 0.0 are assumed based on the value of param(1) and are not stored in param.