Skip to content

Commit 235575c

Browse files
committed
Website build
1 parent aea4132 commit 235575c

10 files changed

Lines changed: 54 additions & 31 deletions
108 Bytes
Binary file not shown.

L2_QR_factorisation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ <h2><span class="section-number">2.6. </span>Householder triangulation<a class="
687687
done so, you will need to modified
688688
<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> to use the <code class="docutils literal notranslate"><span class="pre">kmax</span></code>
689689
argument. You may make use of the built-in triangular solve
690-
algorithm <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.8.0.dev0+1987.d7fa27f)"><code class="xref py py-func docutils literal notranslate"><span class="pre">scipy.linalg.solve_triangular()</span></code></a> (we shall consider
690+
algorithm <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.8.0.dev0+2093.40fc5b3)"><code class="xref py py-func docutils literal notranslate"><span class="pre">scipy.linalg.solve_triangular()</span></code></a> (we shall consider
691691
triangular matrix algorithms briefly later). The test script
692692
<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 test this
693693
function.</p>
@@ -799,7 +799,7 @@ <h2><span class="section-number">2.7. </span>Application: Least squares problems
799799
appropriate augmented matrix <span class="math notranslate nohighlight">\(\hat{A}\)</span>, calling
800800
<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
801801
subarrays using slice notation, before using
802-
<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.8.0.dev0+1987.d7fa27f)"><code class="xref py py-func docutils literal notranslate"><span class="pre">scipy.linalg.solve_triangular()</span></code></a> to solve the resulting upper triangular
802+
<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.8.0.dev0+2093.40fc5b3)"><code class="xref py py-func docutils literal notranslate"><span class="pre">scipy.linalg.solve_triangular()</span></code></a> to solve the resulting upper triangular
803803
system, before returning the solution <span class="math notranslate nohighlight">\(x\)</span>. The test script
804804
<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 test this
805805
function.</p>

L4_LU_decomposition.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ <h2><span class="section-number">4.1. </span>An algorithm for LU decomposition<a
6666
<iframe allowfullscreen="true" src="https://player.vimeo.com/video/454095315" style="border: 0; height: 345px; width: 560px">
6767
</iframe></div></details><p>The computational way to view Gaussian elimination is through the LU
6868
decomposition of an invertible matrix, <span class="math notranslate nohighlight">\(A=LU\)</span>, where <span class="math notranslate nohighlight">\(L\)</span> is lower
69-
triangular (<span class="math notranslate nohighlight">\(l_{ij}=0\)</span> for <span class="math notranslate nohighlight">\(j&lt;i\)</span>) and <span class="math notranslate nohighlight">\(U\)</span> is upper triangular
70-
(<span class="math notranslate nohighlight">\(u_{ij}=0\)</span> for <span class="math notranslate nohighlight">\(j&gt;i\)</span>). Here we use the symbol <span class="math notranslate nohighlight">\(U\)</span> instead of <span class="math notranslate nohighlight">\(R\)</span> to
69+
triangular (<span class="math notranslate nohighlight">\(l_{ij}=0\)</span> for <span class="math notranslate nohighlight">\(j&gt;i\)</span>) and <span class="math notranslate nohighlight">\(U\)</span> is upper triangular
70+
(<span class="math notranslate nohighlight">\(u_{ij}=0\)</span> for <span class="math notranslate nohighlight">\(j&lt;i\)</span>). Here we use the symbol <span class="math notranslate nohighlight">\(U\)</span> instead of <span class="math notranslate nohighlight">\(R\)</span> to
7171
emphasise that we are looking as square matrices. The process of
7272
obtaining the <span class="math notranslate nohighlight">\(LU\)</span> decomposition is very similar to the Householder
7373
algorithm, in that we repeatedly left multiply <span class="math notranslate nohighlight">\(A\)</span> by matrices to
@@ -121,7 +121,7 @@ <h2><span class="section-number">4.1. </span>An algorithm for LU decomposition<a
121121
<li><p><span class="math notranslate nohighlight">\(x_1 \gets b_1/L_{11}\)</span></p></li>
122122
<li><p>FOR <span class="math notranslate nohighlight">\(i= 2\)</span> TO <span class="math notranslate nohighlight">\(m\)</span></p>
123123
<ul>
124-
<li><p><span class="math notranslate nohighlight">\(x_i \gets (b_i - \sum_{k=1}^iL_{ik}x_k)/L_{ii}\)</span></p></li>
124+
<li><p><span class="math notranslate nohighlight">\(x_i \gets (b_i - \sum_{k=1}^{i-1}L_{ik}x_k)/L_{ii}\)</span></p></li>
125125
</ul>
126126
</li>
127127
</ul>
@@ -519,12 +519,13 @@ <h2><span class="section-number">4.2. </span>Pivoting<a class="headerlink" href=
519519
</div><div class="proof-content">
520520
<p>The function <a class="reference internal" href="cla_utils.html#cla_utils.exercises7.perm" title="cla_utils.exercises7.perm"><code class="xref py py-func docutils literal notranslate"><span class="pre">cla_utils.exercises7.perm()</span></code></a> has been left
521521
unimplemented. It should take an <span class="math notranslate nohighlight">\(m\times m\)</span> permutation matrix
522-
<span class="math notranslate nohighlight">\(P\)</span>, stored as a vector of indices <span class="math notranslate nohighlight">\(p\in\mathbb{N}^m\)</span> so that
523-
<span class="math notranslate nohighlight">\((Px)_i = x_{p_i}\)</span>, <span class="math notranslate nohighlight">\(i=1,2,\ldots, m\)</span>, and replace it with the
524-
matrix <span class="math notranslate nohighlight">\(P_{i,j}P\)</span> (also stored as a vector of indices) where
525-
<span class="math notranslate nohighlight">\(P_{i,j}\)</span> is the permutation matrix that exchanges the entries <span class="math notranslate nohighlight">\(i\)</span>
526-
and <span class="math notranslate nohighlight">\(j\)</span>. The test script <code class="docutils literal notranslate"><span class="pre">test_exercises7.py</span></code> in the <code class="docutils literal notranslate"><span class="pre">test</span></code>
527-
directory will test this function.</p>
522+
<span class="math notranslate nohighlight">\(P\)</span>, stored as an (integer-valued) array of indices
523+
<span class="math notranslate nohighlight">\(p\in\mathbb{N}^m\)</span> so that <span class="math notranslate nohighlight">\((Px)_i = x_{p_i}\)</span>, <span class="math notranslate nohighlight">\(i=1,2,\ldots, m\)</span>,
524+
and replace it with the matrix <span class="math notranslate nohighlight">\(P_{i,j}P\)</span> (also stored as a array
525+
of indices) where <span class="math notranslate nohighlight">\(P_{i,j}\)</span> is the permutation matrix that
526+
exchanges the entries <span class="math notranslate nohighlight">\(i\)</span> and <span class="math notranslate nohighlight">\(j\)</span>. The test script
527+
<code class="docutils literal notranslate"><span class="pre">test_exercises7.py</span></code> in the <code class="docutils literal notranslate"><span class="pre">test</span></code> directory will test this
528+
function.</p>
528529
</div></div><div class="proof proof-type-exercise" id="id8">
529530

530531
<div class="proof-title">

L5_eigenvalues.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ <h2><span class="section-number">5.4. </span>Rayleigh quotient<a class="headerli
499499
<li><p>Finding an eigenvector <span class="math notranslate nohighlight">\(v\)</span> of <span class="math notranslate nohighlight">\(A\)</span> with eigenvalue <span class="math notranslate nohighlight">\(\lambda\)</span> (you can use <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.linalg.eig.html#numpy.linalg.eig" title="(in NumPy v1.21)"><code class="xref py py-func docutils literal notranslate"><span class="pre">numpy.linalg.eig()</span></code></a> for this),</p></li>
500500
<li><p>Choosing a perturbation vector <span class="math notranslate nohighlight">\(r\)</span>, and perturbation parameter <span class="math notranslate nohighlight">\(\epsilon&gt;0\)</span>,</p></li>
501501
<li><p>Comparing the Rayleigh quotient of <span class="math notranslate nohighlight">\(v + \epsilon r\)</span> with <span class="math notranslate nohighlight">\(\lambda\)</span>,</p></li>
502-
<li><p>Plotting (on a log-log graph, use <a class="reference external" href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.loglog.html#matplotlib.pyplot.loglog" title="(in Matplotlib v3.4.3)"><code class="xref py py-func docutils literal notranslate"><span class="pre">matplotlib.pyplot.loglog()</span></code></a>) the error in estimating the eigenvalue as a function of <span class="math notranslate nohighlight">\(\epsilon\)</span>.</p></li>
502+
<li><p>Plotting (on a log-log graph, use <a class="reference external" href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.loglog.html#matplotlib.pyplot.loglog" title="(in Matplotlib v3.5.0)"><code class="xref py py-func docutils literal notranslate"><span class="pre">matplotlib.pyplot.loglog()</span></code></a>) the error in estimating the eigenvalue as a function of <span class="math notranslate nohighlight">\(\epsilon\)</span>.</p></li>
503503
</ol>
504504
<p>The best way to do this is to plot the computed data values as points,
505505
and then superpose a line plot of <span class="math notranslate nohighlight">\(a\epsilon^k\)</span> for appropriate
@@ -773,7 +773,7 @@ <h2><span class="section-number">5.8. </span>The pure QR algorithm<a class="head
773773
<a class="reference internal" href="cla_utils.html#cla_utils.exercises9.get_B100" title="cla_utils.exercises9.get_B100"><code class="xref py py-func docutils literal notranslate"><span class="pre">cla_utils.exercises9.get_B100()</span></code></a>,
774774
<a class="reference internal" href="cla_utils.html#cla_utils.exercises9.get_C100" title="cla_utils.exercises9.get_C100"><code class="xref py py-func docutils literal notranslate"><span class="pre">cla_utils.exercises9.get_C100()</span></code></a>, and
775775
<a class="reference internal" href="cla_utils.html#cla_utils.exercises9.get_D100" title="cla_utils.exercises9.get_D100"><code class="xref py py-func docutils literal notranslate"><span class="pre">cla_utils.exercises9.get_D100()</span></code></a>. You can use
776-
<a class="reference external" href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.pcolor.html#matplotlib.pyplot.pcolor" title="(in Matplotlib v3.4.3)"><code class="xref py py-func docutils literal notranslate"><span class="pre">matplotlib.pyplot.pcolor()</span></code></a> to visualise the entries,
776+
<a class="reference external" href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.pcolor.html#matplotlib.pyplot.pcolor" title="(in Matplotlib v3.5.0)"><code class="xref py py-func docutils literal notranslate"><span class="pre">matplotlib.pyplot.pcolor()</span></code></a> to visualise the entries,
777777
or compute norms of the components of the matrices below the diagonal,
778778
for example. What do you observe? How does this relate to the structure
779779
of the four matrices?</p>

_modules/cla_utils/exercises6.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ <h1>Source code for cla_utils.exercises6</h1><div class="highlight"><pre>
5454
<span class="sd"> in column k given by lvec (k is inferred from the size of lvec).</span>
5555

5656
<span class="sd"> :param m: integer giving the dimensions of L.</span>
57-
<span class="sd"> :param lvec: a m-k-1 dimensional numpy array.</span>
57+
<span class="sd"> :param lvec: a m-k dimensional numpy array.</span>
5858
<span class="sd"> :return Lk: an mxm dimensional numpy array.</span>
5959

6060
<span class="sd"> &quot;&quot;&quot;</span>

_sources/L4_LU_decomposition.rst.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ An algorithm for LU decomposition
2121

2222
The computational way to view Gaussian elimination is through the LU
2323
decomposition of an invertible matrix, `A=LU`, where `L` is lower
24-
triangular (`l_{ij}=0` for `j<i`) and `U` is upper triangular
25-
(`u_{ij}=0` for `j>i`). Here we use the symbol `U` instead of `R` to
24+
triangular (`l_{ij}=0` for `j>i`) and `U` is upper triangular
25+
(`u_{ij}=0` for `j<i`). Here we use the symbol `U` instead of `R` to
2626
emphasise that we are looking as square matrices. The process of
2727
obtaining the `LU` decomposition is very similar to the Householder
2828
algorithm, in that we repeatedly left multiply `A` by matrices to
@@ -91,7 +91,7 @@ way, written in pseudo-code as follows.
9191
* `x_1 \gets b_1/L_{11}`
9292
* FOR `i= 2` TO `m`
9393

94-
* `x_i \gets (b_i - \sum_{k=1}^iL_{ik}x_k)/L_{ii}`
94+
* `x_i \gets (b_i - \sum_{k=1}^{i-1}L_{ik}x_k)/L_{ii}`
9595

9696
Forward substitution has an operation count that is identical to back
9797
substitution, by symmetry, i.e. `\mathcal{O}(m^2)`. In contrast, we
@@ -498,12 +498,13 @@ complete pivoting, `PAQ=LU`.
498498
499499
The function :func:`cla_utils.exercises7.perm` has been left
500500
unimplemented. It should take an `m\times m` permutation matrix
501-
`P`, stored as a vector of indices `p\in\mathbb{N}^m` so that
502-
`(Px)_i = x_{p_i}`, `i=1,2,\ldots, m`, and replace it with the
503-
matrix `P_{i,j}P` (also stored as a vector of indices) where
504-
`P_{i,j}` is the permutation matrix that exchanges the entries `i`
505-
and `j`. The test script ``test_exercises7.py`` in the ``test``
506-
directory will test this function.
501+
`P`, stored as an (integer-valued) array of indices
502+
`p\in\mathbb{N}^m` so that `(Px)_i = x_{p_i}`, `i=1,2,\ldots, m`,
503+
and replace it with the matrix `P_{i,j}P` (also stored as a array
504+
of indices) where `P_{i,j}` is the permutation matrix that
505+
exchanges the entries `i` and `j`. The test script
506+
``test_exercises7.py`` in the ``test`` directory will test this
507+
function.
507508

508509

509510
.. proof:exercise::

_sources/errata.rst.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ repositories for Autumn 2021. An up to date version is in the
1616
2. The skeleton code for exercises2.GS_classical was amended as the
1717
function should just return R, not Q and R.
1818

19-
3. Updated the sign of the inequality in the formula for $r$ in Section 2.2.
19+
3. Updated the sign of the inequality in the formula for `r` in Section 2.2.
2020

21-
4. Replaced $r_{11}/r_{11}$ by $r_{1n}/r_{11}$ in the final column of the
22-
right-multiplied $R$ matrix in Section 2.5.
21+
4. Replaced `r_{11}/r_{11}` by `r_{1n}/r_{11}` in the final column of the
22+
right-multiplied `R` matrix in Section 2.5.
23+
24+
5. Updated docstring in :code:`cla_utils:get_Lk` and the corresponding
25+
test so that `k` corresponds to the column being operated on.
26+
27+
6. Corrected the upper limit of the sum in the algorithm for forward
28+
substitution.
29+
30+
7. Corrected the sign of inequalities in :code:`test_solve_U` and
31+
:code:`test_solve_L`. And then uncorrected them again, they were right
32+
in the first place.
33+
34+
8. Fixed the sign of the inequalities in the discussion of $L$ and $U$ matrices.

cla_utils.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
621621
<dt class="field-odd">Parameters</dt>
622622
<dd class="field-odd"><ul class="simple">
623623
<li><p><strong>m</strong> – integer giving the dimensions of L.</p></li>
624-
<li><p><strong>lvec</strong> – a m-k-1 dimensional numpy array.</p></li>
624+
<li><p><strong>lvec</strong> – a m-k dimensional numpy array.</p></li>
625625
</ul>
626626
</dd>
627627
<dt class="field-even">Return Lk</dt>

errata.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<script src="_static/underscore.js"></script>
1616
<script src="_static/doctools.js"></script>
1717
<script src="_static/proof.js"></script>
18+
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
1819
<link rel="index" title="Index" href="genindex.html" />
1920
<link rel="search" title="Search" href="search.html" />
2021
<link rel="next" title="1. Preliminaries" href="L1_preliminaries.html" />
@@ -59,9 +60,17 @@ <h1>Errata for 2021/22<a class="headerlink" href="#errata-for-2021-22" title="Pe
5960
version.</p></li>
6061
<li><p>The skeleton code for exercises2.GS_classical was amended as the
6162
function should just return R, not Q and R.</p></li>
62-
<li><p>Updated the sign of the inequality in the formula for $r$ in Section 2.2.</p></li>
63-
<li><p>Replaced $r_{11}/r_{11}$ by $r_{1n}/r_{11}$ in the final column of the
64-
right-multiplied $R$ matrix in Section 2.5.</p></li>
63+
<li><p>Updated the sign of the inequality in the formula for <span class="math notranslate nohighlight">\(r\)</span> in Section 2.2.</p></li>
64+
<li><p>Replaced <span class="math notranslate nohighlight">\(r_{11}/r_{11}\)</span> by <span class="math notranslate nohighlight">\(r_{1n}/r_{11}\)</span> in the final column of the
65+
right-multiplied <span class="math notranslate nohighlight">\(R\)</span> matrix in Section 2.5.</p></li>
66+
<li><p>Updated docstring in <code class="code docutils literal notranslate"><span class="pre">cla_utils:get_Lk</span></code> and the corresponding
67+
test so that <span class="math notranslate nohighlight">\(k\)</span> corresponds to the column being operated on.</p></li>
68+
<li><p>Corrected the upper limit of the sum in the algorithm for forward
69+
substitution.</p></li>
70+
<li><p>Corrected the sign of inequalities in <code class="code docutils literal notranslate"><span class="pre">test_solve_U</span></code> and
71+
<code class="code docutils literal notranslate"><span class="pre">test_solve_L</span></code>. And then uncorrected them again, they were right
72+
in the first place.</p></li>
73+
<li><p>Fixed the sign of the inequalities in the discussion of $L$ and $U$ matrices.</p></li>
6574
</ol>
6675
</section>
6776

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)