The 2024 Developer Survey results are live! See the results

# Tag Info

Accepted

### Computational method to compute both the (log) determinant and inverse of a matrix

The LU decomposition will give you what you want with only $\tfrac{2}{3}n^3 + \mathcal{O}(n^2)$ FLOPs. The linear system is solved by solving two triangular systems. The determinant is the product ...

### Robust algorithm for $2 \times 2$ SVD

I needed an algorithm that has little branching (hopefully CMOVs) no trigonometric function calls high numerical accuracy even with 32 bit floats We want to calculate $c_1, s_1, c_2, s_2, \sigma_1$ ...
• 101

### Rapidly determining whether or not a dense matrix is of low rank

The problem, of course, is that computing the true rank (e.g., via a QR decomposition) is not really any cheaper than computing a low-rank representation of the matrix. The best you can probably do ...
• 56.1k
Accepted

### Cholesky for ill-conditioned/singular covariance matrices

If your covariance matrix is singular, then you really should consider why the matrix is singular and come up with a higher-level approach that avoids the singularity. However, if you insist on ...
• 18.9k
Accepted

### Does a symmetric positive definite matrix also have $\mathbf{A} = \mathbf{L}^T\mathbf{L}$ (where $\mathbf{L}$ is a lower triangular matrix)?

Let $P$ be the anti-diagonal permutation matrix, $$P = \begin{bmatrix} & & & 1 \\ & & 1 \\ & 1 \\ 1 \end{bmatrix}$$ so that $PAP$ is the version of $A$ with rows and columns ...
• 3,143
Accepted

### Bareiss algorithm vs. LU-decomposition

Bareiss' algorithm is a better choice if you have to compute exactly determinants of integer matrices, as noted in the comments. When it comes to real (floating-point) or complex matrices, the main ...
• 11.8k

• 8,702

### Rapidly determining whether or not a dense matrix is of low rank

Another approach, which might be of interest to you is randomized sampling. This is of particular interest if you can quickly compute matrix-vector products $x\rightarrow Ax$ and $x\rightarrow A^* x$. ...
• 91