Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
QR_decomp.h File Reference

QR decomposition helpers used by the experimental SVD and polar decomposition code. More...

#include <math.h>
#include <stdio.h>
+ Include dependency graph for QR_decomp.h:

Go to the source code of this file.

Functions

void QR_dec (double *A, double *Q, double *R, int rows, int cols)
 Decompose a dense matrix into an orthonormal basis and an upper-triangular factor.
 

Detailed Description

QR decomposition helpers used by the experimental SVD and polar decomposition code.

The implementation uses a classical Gram-Schmidt orthonormalization on the column vectors of the input matrix. This file is currently header-only because the prototype code was imported as a self-contained module.

Function Documentation

◆ QR_dec()

void QR_dec ( double A,
double Q,
double R,
int  rows,
int  cols 
)
inline

Decompose a dense matrix into an orthonormal basis and an upper-triangular factor.

The input matrix is interpreted as a row-major rows x cols array. The implementation copies one column at a time into Q, removes the projection on the previously orthonormalized columns, then stores the corresponding coefficients into R.

Parameters
[in]AInput matrix stored row-major.
[out]QOutput orthonormal basis, stored row-major with the same shape as A.
[out]ROutput upper-triangular matrix, stored row-major as a cols x cols matrix.
[in]rowsNumber of rows in A and Q.
[in]colsNumber of columns in A, Q and R.

References A, i, k, r, R, and S.