RcdMathLib_doc
Open Source Library for Linear and Non-linear Algebra
qr_householder.c File Reference

Householder algorithm for the QR-decomposition. More...

#include <stdio.h>
#include <stdbool.h>
#include <math.h>
#include "matrix.h"
#include "utils.h"

Go to the source code of this file.

Functions

int8_t qr_householder_decomp (uint8_t m, uint8_t n, matrix_t A[][n], uint8_t q_col_num, matrix_t Q[][q_col_num], bool reduced)
 Computes the QR decomposition of the matrix A by using the Householder algorithm. More...
 

Detailed Description

Householder algorithm for the QR-decomposition.

Provide necessary methods to construct Q- and R- matrices using Householder reflections. A = QR, where Q is an (m $\times$ n)-matrix with orthonormal columns and R is an (n $\times$ n) upper triangular matrix.

Author
Zakaria Kasmi zkasm.nosp@m.i@in.nosp@m.f.fu-.nosp@m.berl.nosp@m.in.de

Definition in file qr_householder.c.

Function Documentation

◆ qr_householder_decomp()

int8_t qr_householder_decomp ( uint8_t  m,
uint8_t  n,
matrix_t  A[][n],
uint8_t  q_col_num,
matrix_t  Q[][q_col_num],
bool  reduced 
)

Computes the QR decomposition of the matrix A by using the Householder algorithm.

Note
R is stored in the matrix A.
Parameters
[in]mrow number of the matrix to decompose in QR.
[in]ncolumn number of the matrix to decompose in QR.
[in,out]A[][]pointer to the matrices A and R.
[in]q_col_numcolumn number of the matrix Q.
[in,out]Q[][]pointer to the matrix Q.
[in]reducedcomputes the compact form of the QR decomposition if true, otherwise the full version.
Returns
1, if computing the QR decomposition is successful.
-1, if computing the QR decomposition is not successful.

Definition at line 33 of file qr_householder.c.

References matrix_t, and utils_get_save_square_root().

Referenced by householder_test(), and solve_householder().