You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<aclass="reference internal" href="cla_utils.html#cla_utils.exercises3.householder" title="cla_utils.exercises3.householder"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises3.householder()</span></code></a> to use the <codeclass="docutils literal notranslate"><spanclass="pre">kmax</span></code>
689
689
argument. You may make use of the built-in triangular solve
triangular matrix algorithms briefly later). The test script
692
692
<codeclass="docutils literal notranslate"><spanclass="pre">test_exercises3.py</span></code> in the <codeclass="docutils literal notranslate"><spanclass="pre">test</span></code> directory will also test this
693
693
function.</p>
@@ -799,7 +799,7 @@ <h2><span class="section-number">2.7. </span>Application: Least squares problems
<aclass="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)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">scipy.linalg.solve_triangular()</span></code></a> to solve the resulting upper triangular
802
+
<aclass="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)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">scipy.linalg.solve_triangular()</span></code></a> to solve the resulting upper triangular
803
803
system, before returning the solution <spanclass="math notranslate nohighlight">\(x\)</span>. The test script
804
804
<codeclass="docutils literal notranslate"><spanclass="pre">test_exercises3.py</span></code> in the <codeclass="docutils literal notranslate"><spanclass="pre">test</span></code> directory will also test this
</iframe></div></details><p>The computational way to view Gaussian elimination is through the LU
68
68
decomposition of an invertible matrix, <spanclass="math notranslate nohighlight">\(A=LU\)</span>, where <spanclass="math notranslate nohighlight">\(L\)</span> is lower
69
-
triangular (<spanclass="math notranslate nohighlight">\(l_{ij}=0\)</span> for <spanclass="math notranslate nohighlight">\(j<i\)</span>) and <spanclass="math notranslate nohighlight">\(U\)</span> is upper triangular
70
-
(<spanclass="math notranslate nohighlight">\(u_{ij}=0\)</span> for <spanclass="math notranslate nohighlight">\(j>i\)</span>). Here we use the symbol <spanclass="math notranslate nohighlight">\(U\)</span> instead of <spanclass="math notranslate nohighlight">\(R\)</span> to
69
+
triangular (<spanclass="math notranslate nohighlight">\(l_{ij}=0\)</span> for <spanclass="math notranslate nohighlight">\(j>i\)</span>) and <spanclass="math notranslate nohighlight">\(U\)</span> is upper triangular
70
+
(<spanclass="math notranslate nohighlight">\(u_{ij}=0\)</span> for <spanclass="math notranslate nohighlight">\(j<i\)</span>). Here we use the symbol <spanclass="math notranslate nohighlight">\(U\)</span> instead of <spanclass="math notranslate nohighlight">\(R\)</span> to
71
71
emphasise that we are looking as square matrices. The process of
72
72
obtaining the <spanclass="math notranslate nohighlight">\(LU\)</span> decomposition is very similar to the Householder
73
73
algorithm, in that we repeatedly left multiply <spanclass="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
<p>The function <aclass="reference internal" href="cla_utils.html#cla_utils.exercises7.perm" title="cla_utils.exercises7.perm"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises7.perm()</span></code></a> has been left
521
521
unimplemented. It should take an <spanclass="math notranslate nohighlight">\(m\times m\)</span> permutation matrix
522
-
<spanclass="math notranslate nohighlight">\(P\)</span>, stored as a vector of indices <spanclass="math notranslate nohighlight">\(p\in\mathbb{N}^m\)</span> so that
523
-
<spanclass="math notranslate nohighlight">\((Px)_i = x_{p_i}\)</span>, <spanclass="math notranslate nohighlight">\(i=1,2,\ldots, m\)</span>, and replace it with the
524
-
matrix <spanclass="math notranslate nohighlight">\(P_{i,j}P\)</span> (also stored as a vector of indices) where
525
-
<spanclass="math notranslate nohighlight">\(P_{i,j}\)</span> is the permutation matrix that exchanges the entries <spanclass="math notranslate nohighlight">\(i\)</span>
526
-
and <spanclass="math notranslate nohighlight">\(j\)</span>. The test script <codeclass="docutils literal notranslate"><spanclass="pre">test_exercises7.py</span></code> in the <codeclass="docutils literal notranslate"><spanclass="pre">test</span></code>
527
-
directory will test this function.</p>
522
+
<spanclass="math notranslate nohighlight">\(P\)</span>, stored as an (integer-valued) array of indices
523
+
<spanclass="math notranslate nohighlight">\(p\in\mathbb{N}^m\)</span> so that <spanclass="math notranslate nohighlight">\((Px)_i = x_{p_i}\)</span>, <spanclass="math notranslate nohighlight">\(i=1,2,\ldots, m\)</span>,
524
+
and replace it with the matrix <spanclass="math notranslate nohighlight">\(P_{i,j}P\)</span> (also stored as a array
525
+
of indices) where <spanclass="math notranslate nohighlight">\(P_{i,j}\)</span> is the permutation matrix that
526
+
exchanges the entries <spanclass="math notranslate nohighlight">\(i\)</span> and <spanclass="math notranslate nohighlight">\(j\)</span>. The test script
527
+
<codeclass="docutils literal notranslate"><spanclass="pre">test_exercises7.py</span></code> in the <codeclass="docutils literal notranslate"><spanclass="pre">test</span></code> directory will test this
<li><p>Finding an eigenvector <spanclass="math notranslate nohighlight">\(v\)</span> of <spanclass="math notranslate nohighlight">\(A\)</span> with eigenvalue <spanclass="math notranslate nohighlight">\(\lambda\)</span> (you can use <aclass="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.linalg.eig.html#numpy.linalg.eig" title="(in NumPy v1.21)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">numpy.linalg.eig()</span></code></a> for this),</p></li>
500
500
<li><p>Choosing a perturbation vector <spanclass="math notranslate nohighlight">\(r\)</span>, and perturbation parameter <spanclass="math notranslate nohighlight">\(\epsilon>0\)</span>,</p></li>
501
501
<li><p>Comparing the Rayleigh quotient of <spanclass="math notranslate nohighlight">\(v + \epsilon r\)</span> with <spanclass="math notranslate nohighlight">\(\lambda\)</span>,</p></li>
502
-
<li><p>Plotting (on a log-log graph, use <aclass="reference external" href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.loglog.html#matplotlib.pyplot.loglog" title="(in Matplotlib v3.4.3)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">matplotlib.pyplot.loglog()</span></code></a>) the error in estimating the eigenvalue as a function of <spanclass="math notranslate nohighlight">\(\epsilon\)</span>.</p></li>
502
+
<li><p>Plotting (on a log-log graph, use <aclass="reference external" href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.loglog.html#matplotlib.pyplot.loglog" title="(in Matplotlib v3.5.0)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">matplotlib.pyplot.loglog()</span></code></a>) the error in estimating the eigenvalue as a function of <spanclass="math notranslate nohighlight">\(\epsilon\)</span>.</p></li>
503
503
</ol>
504
504
<p>The best way to do this is to plot the computed data values as points,
505
505
and then superpose a line plot of <spanclass="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
<aclass="reference internal" href="cla_utils.html#cla_utils.exercises9.get_C100" title="cla_utils.exercises9.get_C100"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises9.get_C100()</span></code></a>, and
775
775
<aclass="reference internal" href="cla_utils.html#cla_utils.exercises9.get_D100" title="cla_utils.exercises9.get_D100"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">cla_utils.exercises9.get_D100()</span></code></a>. You can use
776
-
<aclass="reference external" href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.pcolor.html#matplotlib.pyplot.pcolor" title="(in Matplotlib v3.4.3)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">matplotlib.pyplot.pcolor()</span></code></a> to visualise the entries,
776
+
<aclass="reference external" href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.pcolor.html#matplotlib.pyplot.pcolor" title="(in Matplotlib v3.5.0)"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">matplotlib.pyplot.pcolor()</span></code></a> to visualise the entries,
777
777
or compute norms of the components of the matrices below the diagonal,
778
778
for example. What do you observe? How does this relate to the structure
@@ -59,9 +60,17 @@ <h1>Errata for 2021/22<a class="headerlink" href="#errata-for-2021-22" title="Pe
59
60
version.</p></li>
60
61
<li><p>The skeleton code for exercises2.GS_classical was amended as the
61
62
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 <spanclass="math notranslate nohighlight">\(r\)</span> in Section 2.2.</p></li>
64
+
<li><p>Replaced <spanclass="math notranslate nohighlight">\(r_{11}/r_{11}\)</span> by <spanclass="math notranslate nohighlight">\(r_{1n}/r_{11}\)</span> in the final column of the
65
+
right-multiplied <spanclass="math notranslate nohighlight">\(R\)</span> matrix in Section 2.5.</p></li>
66
+
<li><p>Updated docstring in <codeclass="code docutils literal notranslate"><spanclass="pre">cla_utils:get_Lk</span></code> and the corresponding
67
+
test so that <spanclass="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 <codeclass="code docutils literal notranslate"><spanclass="pre">test_solve_U</span></code> and
71
+
<codeclass="code docutils literal notranslate"><spanclass="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>
0 commit comments