# Moore-Penrose Generalized Inverse of Sparse Matrix

**URL:** https://discourse.julialang.org/t/moore-penrose-generalized-inverse-of-sparse-matrix/17414
**Category:** Optimization (Mathematical)
**Created:** [November 11, 2018, 11:05pm UTC](https://discourse.julialang.org/t/moore-penrose-generalized-inverse-of-sparse-matrix/17414 "2018-11-11T23:05:51Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [November 12, 2018, 3:01am UTC](https://discourse.julialang.org/t/moore-penrose-generalized-inverse-of-sparse-matrix/17414/3 "2018-11-12T03:01:46Z")

</div>

You almost never compute the inverse (pseudo or otherwise) of a sparse matrix because the inverse is generally dense.

On the other hand, you do compute the _application_ of the inverse to a vector, and you often precompute factorizations that let you apply the inverse more quickly.

In the case of the ordinary inverse, you can apply a sparse inverse with `A \ b` and compute the factorization with `lu(A)` etcetera. In the case of the pseudoinverse, applying it computes the least-squares solution, and the corresponding factorization is usually `qr`.

---

_[View the full topic](https://discourse.julialang.org/t/moore-penrose-generalized-inverse-of-sparse-matrix/17414)._
