rotmg¶
Computes the parameters for a modified Givens rotation.
Description¶
Given Cartesian coordinates (x1, y1) of an
input vector, the rotmg routines compute the components of a modified
Givens transformation matrix H that zeros the y-component of
the resulting vector:
![\left[
\begin{array}{ccc}
x1 \\ 0
\end{array}
\right] = H
\left[
\begin{array}{ccc}
x1 & \sqrt{d1} \\
y1 & \sqrt{d2}
\end{array}
\right]](../../_images/math/048cdf17d6628939df2b4d5864220d7bf5d4cedd.png)
rotmg supports the following precisions:
T |
|---|
|
|
rotmg (Buffer Version)¶
Syntax¶
namespace oneapi::mkl::blas::column_major {
void rotmg(sycl::queue &queue,
sycl::buffer<T,1> &d1,
sycl::buffer<T,1> &d2,
sycl::buffer<T,1> &x1,
sycl::buffer<T,1> &y1,
sycl::buffer<T,1> ¶m)
}
namespace oneapi::mkl::blas::row_major {
void rotmg(sycl::queue &queue,
sycl::buffer<T,1> &d1,
sycl::buffer<T,1> &d2,
sycl::buffer<T,1> &x1,
sycl::buffer<T,1> &y1,
sycl::buffer<T,1> ¶m)
}
Input Parameters¶
- queue
The queue where the routine should be executed.
- d1
Buffer holding the scaling factor for
x-coordinate of the input vector.- d2
Buffer holding the scaling factor for
y-coordinate of the input vector.- x1
Buffer holding
x-coordinate of the input vector.- y1
Scalar specifying
y-coordinate of the input vector.
Output Parameters¶
- d1
Buffer holding the first diagonal element of the updated matrix.
- d2
Buffer holding the second diagonal element of the updated matrix.
- x1
Buffer holding
x-coordinate of the rotated vector before scaling- param
Buffer holding an array of size 5.
The elements of the
paramarray are:param[0]contains a switch,flag. The other array elementsparam[1-4]contain the components of the arrayH: h11, h21, h12, and h22, respectively.Depending on the values of
flag, the components ofHare set as follows:flag = -1.0:![H = \left[
\begin{array}{ccc}
h_{11} & h_{12} \\
h_{21} & h_{22}
\end{array}
\right]](../../_images/math/7b2b20fb1084d3516ea065ac8bb5c9e2230aa45d.png)
flag = 0.0:![H = \left[
\begin{array}{ccc}
1.0 & h_{12} \\
h_{21} & 1.0
\end{array}
\right]](../../_images/math/32092f416c05d961c0dae3e2bae46655b3409a58.png)
flag = 1.0:![H = \left[
\begin{array}{ccc}
h_{11} & 1.0 \\
-1.9 & h_{22}
\end{array}
\right]](../../_images/math/154f6ebaad6870e3edf97da0d2212db9e3ad3c44.png)
flag = -2.0:![H = \left[
\begin{array}{ccc}
1.0 & 0.0 \\
0.0 & 1.0
\end{array}
\right]](../../_images/math/cfcaafec07e68602c9899069777ad2a115cd1e38.png)
In the last three cases, the matrix entries of 1.0, -1.0, and 0.0 are assumed based on the value of
flagand are not required to be set in theparamvector.
rotmg (USM Version)¶
Syntax¶
namespace oneapi::mkl::blas::column_major {
sycl::event rotmg(sycl::queue &queue,
T *d1,
T *d2,
T *x1,
T *y1,
T *param,
const std::vector<sycl::event> &dependencies = {})
}
namespace oneapi::mkl::blas::row_major {
sycl::event rotmg(sycl::queue &queue,
T *d1,
T *d2,
T *x1,
T *y1,
T *param,
const std::vector<sycl::event> &dependencies = {})
}
Input Parameters¶
- queue
The queue where the routine should be executed.
- d1
Pointer to the scaling factor for
x-coordinate of the input vector.- d2
Pointer to the scaling factor for
y-coordinate of the input vector.- x1
Pointer to
x-coordinate of the input vector.- y1
Scalar specifying
y-coordinate of the input vector.- dependencies
List of events to wait for before starting computation, if any. If omitted, defaults to no dependencies.
Output Parameters¶
- d1
Pointer to the first diagonal element of the updated matrix.
- d2
Pointer to the second diagonal element of the updated matrix.
- x1
Pointer to
x-coordinate of the rotated vector before scaling- param
Pointer to an array of size 5.
The elements of the
paramarray are:param[0]contains a switch,flag. The other array elementsparam[1-4]contain the components of the arrayH: h11, h21, h12, and h22, respectively.Depending on the values of
flag, the components ofHare set as follows:flag = -1.0:![H = \left[
\begin{array}{ccc}
h_{11} & h_{12} \\
h_{21} & h_{22}
\end{array}
\right]](../../_images/math/8df50b9712ee416b7838117fee834ca8d69806a6.png)
flag = 0.0:![H = \left[
\begin{array}{ccc}
1.0 & h_{12} \\
h_{21} & 1.0
\end{array}
\right]](../../_images/math/29fdfe893bf89408baa4e9af130dd6da47cdc5ac.png)
flag = 1.0:![H = \left[
\begin{array}{ccc}
h_{11} & 1.0 \\
-1.0 & h_{22}
\end{array}
\right]](../../_images/math/e58caaaf89030c3a633ab12bd71c5b05a4e2406e.png)
flag = -2.0:![H = \left[
\begin{array}{ccc}
1.0 & 0.0 \\
0.0 & 1.0
\end{array}
\right]](../../_images/math/e7b9eb5ee7a56f6631e0fb0f142b6adc60cdfd0b.png)
In the last three cases, the matrix entries of 1.0, -1.0, and 0.0 are assumed based on the value of
flagand are not required to be set in theparamvector.
Return Values¶
Output event to wait on to ensure computation is complete.