# Obtaining a projection onto the range of a matrix through its QR decomposition

**URL:** <https://discourse.julialang.org/t/obtaining-a-projection-onto-the-range-of-a-matrix-through-its-qr-decomposition/117334>\
**Category:** Numerics\
**Created:** [July 22, 2024, 10:56am UTC](https://discourse.julialang.org/t/obtaining-a-projection-onto-the-range-of-a-matrix-through-its-qr-decomposition/117334 "2024-07-22T10:56:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 22, 2024, 12:17pm UTC](https://discourse.julialang.org/t/obtaining-a-projection-onto-the-range-of-a-matrix-through-its-qr-decomposition/117334/2 "2024-07-22T12:17:47Z")

</div>

> [@cgois](#):
>
> Because this does not work with sparse matrices, I want to find an alternative using a QR decomposition.

See also: [How to find the linearly independent columns (rows) of a matrix - #14 by stevengj](https://discourse.julialang.org/t/how-to-find-the-linearly-independent-columns-rows-of-a-matrix/109772/14) (although this wasn’t written with sparse QR in mind). This returns a list of which of the columns of A are independent (up to some tolerance), and you can then use those columns as a basis — this might be a good approach to adapt for sparse A since its columns are sparse (albeit not orthonormal).

What sizes and ranks of sparse matrices are you interested in?

---

_[View the full topic](https://discourse.julialang.org/t/obtaining-a-projection-onto-the-range-of-a-matrix-through-its-qr-decomposition/117334)._
