Skip to content

Commit 9950eff

Browse files
committed
Website build
1 parent d020403 commit 9950eff

File tree

6 files changed

+70
-46
lines changed

6 files changed

+70
-46
lines changed
77 Bytes
Binary file not shown.

L2_QR_factorisation.html

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,30 @@ <h2><span class="section-number">2.6. </span>Householder triangulation<a class="
660660
<summary>
661661
Supplementary video</summary><div class="video_wrapper" style="">
662662
<iframe allowfullscreen="true" src="https://player.vimeo.com/video/450202242" style="border: 0; height: 345px; width: 560px">
663-
</iframe></div></details><div class="proof proof-type-exercise" id="id9">
663+
</iframe></div></details><p>In this section we will frequently encounter systems of the form</p>
664+
<div class="math notranslate nohighlight">
665+
\[\hat{R}x = y.\]</div>
666+
<p>This is an upper triangular system that can be solved efficiently
667+
using back-substitution.</p>
668+
<p>Written in components, this equation is</p>
669+
<blockquote>
670+
<div><div class="math notranslate nohighlight">
671+
\[ \begin{align}\begin{aligned}R_{11}x_1 + R_{12}x_2 + \ldots + R_{1(m-1)}x_{m-1} + R_{1m}x_m = y_1,\\0x_1 + R_{22}x_2 + \ldots + R_{2(m-1)}x_{m-1} + R_{2m}x_m = y_2,\\\vdots\\0x_1 + 0x_2 + \ldots + R_{(m-1)(m-1)}x_{m-1} + R_{(m-1)m}x_m = y_{m-1},\\ 0x_1 + 0x_2 + \ldots + 0x_{m-1} + R_{mm}x_m = y_{m}.\end{aligned}\end{align} \]</div>
672+
</div></blockquote>
673+
<p>The last equation yields <span class="math notranslate nohighlight">\(x_m\)</span> directly by dividing by <span class="math notranslate nohighlight">\(R_{mm}\)</span>, then
674+
we can use this value to directly compute <span class="math notranslate nohighlight">\(x_{m-1}\)</span>. This is repeated
675+
for all of the entries of <span class="math notranslate nohighlight">\(x\)</span> from <span class="math notranslate nohighlight">\(m\)</span> down to 1. This procedure is
676+
called back substitution, which we summarise in the following
677+
pseudo-code.</p>
678+
<ul class="simple">
679+
<li><p><span class="math notranslate nohighlight">\(x_m \gets y_m/R_{mm}\)</span></p></li>
680+
<li><p>FOR <span class="math notranslate nohighlight">\(i= m-1\)</span> TO 1 (BACKWARDS)</p>
681+
<ul>
682+
<li><p><span class="math notranslate nohighlight">\(x_i \gets (y_i - \sum_{k=i+1}^mR_{ik}x_k)/R_{ii}\)</span></p></li>
683+
</ul>
684+
</li>
685+
</ul>
686+
<div class="proof proof-type-exercise" id="id9">
664687

665688
<div class="proof-title">
666689
<span class="proof-type">Exercise 2.9</span>
@@ -805,24 +828,7 @@ <h2><span class="section-number">2.7. </span>Application: Least squares problems
805828
\[\hat{R}x = \hat{Q}^*b.\]</div>
806829
</div></blockquote>
807830
<p>This is an upper triangular system that can be solved efficiently
808-
using back-substitution. Written in components, this equation is</p>
809-
<blockquote>
810-
<div><div class="math notranslate nohighlight">
811-
\[ \begin{align}\begin{aligned}R_{11}x_1 + R_{12}x_2 + \ldots + R_{1(m-1)}x_{m-1} + R_{1m}x_m = y_1,\\0x_1 + R_{22}x_2 + \ldots + R_{2(m-1)}x_{m-1} + R_{2m}x_m = y_2,\\\vdots\\0x_1 + 0x_2 + \ldots + R_{(m-1)(m-1)}x_{m-1} + R_{(m-1)m}x_m = y_{m-1},\\ 0x_1 + 0x_2 + \ldots + 0x_{m-1} + R_{mm}x_m = y_{m}.\end{aligned}\end{align} \]</div>
812-
</div></blockquote>
813-
<p>The last equation yields <span class="math notranslate nohighlight">\(x_m\)</span> directly by dividing by <span class="math notranslate nohighlight">\(R_{mm}\)</span>, then
814-
we can use this value to directly compute <span class="math notranslate nohighlight">\(x_{m-1}\)</span>. This is repeated
815-
for all of the entries of <span class="math notranslate nohighlight">\(x\)</span> from <span class="math notranslate nohighlight">\(m\)</span> down to 1. This procedure is
816-
called back substitution, which we summarise in the following
817-
pseudo-code.</p>
818-
<ul class="simple">
819-
<li><p><span class="math notranslate nohighlight">\(x_m \gets y_m/R_{mm}\)</span></p></li>
820-
<li><p>FOR <span class="math notranslate nohighlight">\(i= m-1\)</span> TO 1 (BACKWARDS)</p>
821-
<ul>
822-
<li><p><span class="math notranslate nohighlight">\(x_i \gets (y_i - \sum_{k=i+1}^mR_{ik}x_k)/R_{ii}\)</span></p></li>
823-
</ul>
824-
</li>
825-
</ul>
831+
using back-substitution.</p>
826832
<div class="proof proof-type-exercise" id="id12">
827833

828834
<div class="proof-title">
@@ -836,7 +842,7 @@ <h2><span class="section-number">2.7. </span>Application: Least squares problems
836842
by forming an appropriate augmented matrix <span class="math notranslate nohighlight">\(\hat{A}\)</span>, calling
837843
<a class="reference internal" href="cla_utils.html#cla_utils.exercises3.householder" title="cla_utils.exercises3.householder"><code class="xref py py-func docutils literal notranslate"><span class="pre">cla_utils.exercises3.householder()</span></code></a> and extracting appropriate
838844
subarrays using slice notation, before using
839-
<a class="reference external" href="http://scipy.github.io/devdocs/reference/generated/scipy.linalg.solve_triangular.html#scipy.linalg.solve_triangular" title="(in SciPy v1.10.0.dev0+2059.a082eb4)"><code class="xref py py-func docutils literal notranslate"><span class="pre">scipy.linalg.solve_triangular()</span></code></a> to solve the resulting upper
845+
<a class="reference internal" href="cla_utils.html#cla_utils.exercises3.solve_U" title="cla_utils.exercises3.solve_U"><code class="xref py py-func docutils literal notranslate"><span class="pre">cla_utils.exercises3.solve_U()</span></code></a> to solve the resulting upper
840846
triangular system, before returning the solution <span class="math notranslate nohighlight">\(x\)</span>. The test
841847
script <code class="docutils literal notranslate"><span class="pre">test_exercises3.py</span></code> in the <code class="docutils literal notranslate"><span class="pre">test</span></code> directory will also
842848
test this function.</p>

_sources/L2_QR_factorisation.rst.txt

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,40 @@ We call this procedure "implicit multiplication".
705705

706706
.. vimeo:: 450202242
707707

708+
In this section we will frequently encounter systems of the form
709+
710+
.. math::
711+
712+
\hat{R}x = y.
713+
714+
This is an upper triangular system that can be solved efficiently
715+
using back-substitution.
716+
717+
Written in components, this equation is
718+
719+
.. math::
720+
721+
R_{11}x_1 + R_{12}x_2 + \ldots + R_{1(m-1)}x_{m-1} + R_{1m}x_m = y_1,
722+
723+
0x_1 + R_{22}x_2 + \ldots + R_{2(m-1)}x_{m-1} + R_{2m}x_m = y_2,
724+
725+
\vdots
708726
727+
0x_1 + 0x_2 + \ldots + R_{(m-1)(m-1)}x_{m-1} + R_{(m-1)m}x_m = y_{m-1},
728+
729+
0x_1 + 0x_2 + \ldots + 0x_{m-1} + R_{mm}x_m = y_{m}.
730+
731+
The last equation yields `x_m` directly by dividing by `R_{mm}`, then
732+
we can use this value to directly compute `x_{m-1}`. This is repeated
733+
for all of the entries of `x` from `m` down to 1. This procedure is
734+
called back substitution, which we summarise in the following
735+
pseudo-code.
736+
737+
* `x_m \gets y_m/R_{mm}`
738+
* FOR `i= m-1` TO 1 (BACKWARDS)
739+
740+
* `x_i \gets (y_i - \sum_{k=i+1}^mR_{ik}x_k)/R_{ii}`
741+
709742
.. proof:exercise::
710743
711744
`(\ddagger)` The function :func:`cla_utils.exercises3.solve_U` has
@@ -861,30 +894,7 @@ Left multiplication by `\hat{Q}^*` then gives
861894
\hat{R}x = \hat{Q}^*b.
862895
863896
This is an upper triangular system that can be solved efficiently
864-
using back-substitution. Written in components, this equation is
865-
866-
.. math::
867-
868-
R_{11}x_1 + R_{12}x_2 + \ldots + R_{1(m-1)}x_{m-1} + R_{1m}x_m = y_1,
869-
870-
0x_1 + R_{22}x_2 + \ldots + R_{2(m-1)}x_{m-1} + R_{2m}x_m = y_2,
871-
872-
\vdots
873-
874-
0x_1 + 0x_2 + \ldots + R_{(m-1)(m-1)}x_{m-1} + R_{(m-1)m}x_m = y_{m-1},
875-
876-
0x_1 + 0x_2 + \ldots + 0x_{m-1} + R_{mm}x_m = y_{m}.
877-
878-
The last equation yields `x_m` directly by dividing by `R_{mm}`, then
879-
we can use this value to directly compute `x_{m-1}`. This is repeated
880-
for all of the entries of `x` from `m` down to 1. This procedure is
881-
called back substitution, which we summarise in the following
882-
pseudo-code.
883-
884-
* `x_m \gets y_m/R_{mm}`
885-
* FOR `i= m-1` TO 1 (BACKWARDS)
886-
887-
* `x_i \gets (y_i - \sum_{k=i+1}^mR_{ik}x_k)/R_{ii}`
897+
using back-substitution.
888898

889899
.. proof:exercise::
890900
@@ -895,7 +905,7 @@ pseudo-code.
895905
by forming an appropriate augmented matrix `\hat{A}`, calling
896906
:func:`cla_utils.exercises3.householder` and extracting appropriate
897907
subarrays using slice notation, before using
898-
:func:`scipy.linalg.solve_triangular` to solve the resulting upper
908+
:func:`cla_utils.exercises3.solve_U` to solve the resulting upper
899909
triangular system, before returning the solution `x`. The test
900910
script ``test_exercises3.py`` in the ``test`` directory will also
901911
test this function.

_sources/errata.rst.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ repositories for Autumn 2022. An up to date version is in the
1010

1111
* Exercises 2.4 and 2.5: the tests expect you to change the array
1212
provided as input and not make a copy.
13+
14+
* Exercise 2.12 was updated as we don't need to use scipy anymore (because
15+
solve\_U was moved earlier.
16+
17+
* solveQ should be renamed to solve\_Q in test\_exercises1.test\_solveQ.

errata.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ <h1>Errata for 2022/23<a class="headerlink" href="#errata-for-2022-23" title="Pe
5555
<ul class="simple">
5656
<li><p>Exercises 2.4 and 2.5: the tests expect you to change the array
5757
provided as input and not make a copy.</p></li>
58+
<li><p>Exercise 2.12 was updated as we don’t need to use scipy anymore (because
59+
solve_U was moved earlier.</p></li>
60+
<li><p>solveQ should be renamed to solve_Q in test_exercises1.test_solveQ.</p></li>
5861
</ul>
5962
</section>
6063

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)