LIBDSP Version 4.1.9
LIBDSP Software Library
Loading...
Searching...
No Matches
QR decomposition of a Matrix
Collaboration diagram for QR decomposition of a Matrix:

Functions

tpt_status tpt_mat_qr_f32 (const tpt_matrix_instance_f32 *aInMat, const f32_t threshold, tpt_matrix_instance_f32 *aOutR, tpt_matrix_instance_f32 *aOutQ, f32_t *aOutTau, f32_t *aTmpA, f32_t *aTmpB)
 QR decomposition of a m x n floating point matrix with m >= n.
tpt_status tpt_mat_qr_f64 (const tpt_matrix_instance_f64 *aInMat, const f64_t threshold, tpt_matrix_instance_f64 *aOutR, tpt_matrix_instance_f64 *aOutQ, f64_t *aOutTau, f64_t *aTmpA, f64_t *aTmpB)
 QR decomposition of a m x n double floating point matrix with m>= n.

Detailed Description

Computes the QR decomposition of a matrix M using Householder algorithm.

\‍[      M = Q R
\‍]

where Q is an orthogonal matrix and R is upper triangular. No pivoting strategy is used.、 The returned value for R is using a format a bit similar to LAPACK : it is not just containing the matrix R but also the Householder reflectors. The function is also returning a vector $\tau$ that is containing the scaling factor for the reflectors. Returned value R has the structure:

\‍[  \begin{pmatrix}
  r_{11} & r_{12}     & \dots  & r_{1n} \\
  v_{12} & r_{22}     & \dots  & r_{2n} \\
  v_{13} & v_{22}     & \dots  & r_{3n} \\
  \vdots & \vdots     & \ddots & \vdots   \\
  v_{1m} & v_{2(m-1)} & \dots  & r_{mn} \\
  \end{pmatrix}
\‍]

/// where///

\‍[  v_1 =
  \begin{pmatrix}
  1       \\
  v_{12}  \\
  \vdots  \\
  v_{1m}  \\
  \end{pmatrix}
\‍]

is the first householder reflector. The Householder Matrix is given by $H_1$

\‍[  H_1 = I - \tau_1 v_1 v_1^T
\‍]

The Matrix Q is the product of the Householder matrices:

\‍[  Q = H_1 H_2 \dots H_n
\‍]

The computation of the matrix Q by this function is optional.

And the matrix R, would be the returned value R without the householder reflectors:

\‍[  \begin{pmatrix}
  r_{11} & r_{12} & \dots  & r_{1n} \\
  0      & r_{22} & \dots  & r_{2n} \\
  0      & 0      & \dots  & r_{3n} \\
  \vdots & \vdots & \ddots & \vdots   \\
  0      & 0      & \dots  & r_{mn} \\
  \end{pmatrix}
\‍]

Function Documentation

◆ tpt_mat_qr_f32()

tpt_status tpt_mat_qr_f32 ( const tpt_matrix_instance_f32 * aInMat,
const f32_t threshold,
tpt_matrix_instance_f32 * aOutR,
tpt_matrix_instance_f32 * aOutQ,
f32_t * aOutTau,
f32_t * aTmpA,
f32_t * aTmpB )

QR decomposition of a m x n floating point matrix with m >= n.

QR decomposition of a matrix.

Parameters
[in]aInMatpoints to input matrix structure. The source matrix is modified by the function.
[in]thresholdnorm2 threshold.
[out]aOutRpoints to output R matrix structure of dimension m x n
[out]aOutQpoints to output Q matrix structure of dimension m x m (can be NULL)
[out]aOutTaupoints to Householder scaling factors of dimension n
[in,out]aTmpApoints to a temporary vector of dimension m.
[in,out]aTmpBpoints to a temporary vector of dimension m.
Returns
execution status
aOutQ is optional:
aOutQ can be a NULL pointer. In this case, the argument will be ignored and the output Q matrix won't be computed.
Norm2 threshold
For the meaning of this argument please refer to the MatrixHouseholder documentation

◆ tpt_mat_qr_f64()

tpt_status tpt_mat_qr_f64 ( const tpt_matrix_instance_f64 * aInMat,
const f64_t threshold,
tpt_matrix_instance_f64 * aOutR,
tpt_matrix_instance_f64 * aOutQ,
f64_t * aOutTau,
f64_t * aTmpA,
f64_t * aTmpB )

QR decomposition of a m x n double floating point matrix with m>= n.

QR decomposition of a matrix.

Parameters
[in]aInMatpoints to input matrix structure. The source matrix is modified by the function.
[in]thresholdnorm2 threshold.
[out]aOutRpoints to output R matrix structure of dimension m x n
[out]aOutQpoints to output Q matrix structure of dimension m x m (can be NULL)
[out]aOutTaupoints to Householder scaling factors of dimension n
[in,out]aTmpApoints to a temporary vector of dimension m.
[in,out]aTmpBpoints to a temporary vector of dimension m.
Returns
execution status
aOutQ is optional:
aOutQ can be a NULL pointer. In this case, the argument will be ignored and the output Q matrix won't be computed.
Norm2 threshold
For the meaning of this argument please refer to the MatrixHouseholder documentation