Skip to content

Commit 2502b8e

Browse files
tkfandreasnoack
authored andcommitted
Mention how blocked QR result is stored in QRCompactWY (#32996)
1 parent 25a05f0 commit 2502b8e

File tree

1 file changed

+14
-7
lines changed
  • stdlib/LinearAlgebra/src

1 file changed

+14
-7
lines changed

stdlib/LinearAlgebra/src/qr.jl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,22 @@ A = Q R
6666
6767
where ``Q`` is an orthogonal/unitary matrix and ``R`` is upper triangular. It is similar
6868
to the [`QR`](@ref) format except that the orthogonal/unitary matrix ``Q`` is stored in
69-
*Compact WY* format [^Schreiber1989], as a lower trapezoidal matrix ``V`` and an upper
70-
triangular matrix ``T`` where
69+
*Compact WY* format [^Schreiber1989]. For the block size ``n_b``, it is stored as
70+
a `m`×`n` lower trapezoidal matrix ``V`` and a matrix ``T = (T_1 \\; T_2 \\; ... \\;
71+
T_{b-1} \\; T_b')`` composed of ``b = \\lceil \\min(m,n) / n_b \\rceil`` upper triangular
72+
matrices ``T_j`` of size ``n_b``×``n_b`` (``j = 1, ..., b-1``) and an upper trapezoidal
73+
``n_b``×``\\min(m,n) - (b-1) n_b`` matrix ``T_b'`` (``j=b``) whose upper square part
74+
denoted with ``T_b`` satisfying
7175
7276
```math
73-
Q = \\prod_{i=1}^{\\min(m,n)} (I - \\tau_i v_i v_i^T) = I - V T V^T
77+
Q = \\prod_{i=1}^{\\min(m,n)} (I - \\tau_i v_i v_i^T)
78+
= \\prod_{j=1}^{b} (I - V_j T_j V_j^T)
7479
```
7580
76-
such that ``v_i`` is the ``i``th column of ``V``, and ``\\tau_i`` is the ``i``th diagonal
77-
element of ``T``.
81+
such that ``v_i`` is the ``i``th column of ``V``, ``\\tau_i`` is the ``i``th element
82+
of `[diag(T_1); diag(T_2); …; diag(T_b)]`, and ``(V_1 \\; V_2 \\; ... \\; V_b)``
83+
is the left `m`×`min(m, n)` block of ``V``. When constructed using [`qr`](@ref),
84+
the block size is given by ``n_b = \\min(m, n, 36)``.
7885
7986
Iterating the decomposition produces the components `Q` and `R`.
8087
@@ -88,8 +95,8 @@ The object has two fields:
8895
- The subdiagonal part contains the reflectors ``v_i`` stored in a packed format such
8996
that `V = I + tril(F.factors, -1)`.
9097
91-
* `T` is a square matrix with `min(m,n)` columns, whose upper triangular part gives the
92-
matrix ``T`` above (the subdiagonal elements are ignored).
98+
* `T` is a ``n_b``-by-``\\min(m,n)`` matrix as described above. The subdiagonal elements
99+
for each triangular matrix ``T_j`` are ignored.
93100
94101
!!! note
95102

0 commit comments

Comments
 (0)