![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Singular value decomposition helper shared by chart and color-math code. More...
Include dependency graph for svd.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| static double | SIGN (double a, double b) |
| static double | PYTHAG (double a, double b) |
| static int | dsvd (double *a, int m, int n, int str, double *w, double *v) |
| Compute the singular value decomposition of a dense matrix. | |
Singular value decomposition helper shared by chart and color-math code.
This routine computes the SVD of a dense matrix stored row-major with an explicit row stride. It is adapted from the svdecomp.c implementation that shipped with XLISP-STAT 2.1, itself credited to Luke Tierney and David Betz.
Compute the singular value decomposition of a dense matrix.
The input matrix is overwritten by the left singular vectors. The right singular vectors are stored in v and the singular values are stored in w. The function assumes m >= n and returns zero if the problem is malformed or the QR iteration does not converge.
| [in,out] | a | Input matrix overwritten with the left singular vectors. |
| [in] | m | Number of rows of a. |
| [in] | n | Number of columns of a. |
| [in] | str | Row stride of a. |
| [out] | w | Singular values, length n. |
| [out] | v | Right singular vectors stored as an n x n row-major matrix. |
References dt_free, f, flag, g, i, k, m, MAX, n, PYTHAG(), SIGN(), v, and x.
Referenced by solve().