Skip to content

Commit aea4132

Browse files
committed
Website build
1 parent 83a9a16 commit aea4132

File tree

6 files changed

+35
-20
lines changed

6 files changed

+35
-20
lines changed
172 Bytes
Binary file not shown.

L2_QR_factorisation.html

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ <h2><span class="section-number">2.2. </span>QR factorisation by classical Gram-
155155
<p>with <span class="math notranslate nohighlight">\((q_1,q_2,\ldots,q_n)\)</span> an orthonormal set. The non-diagonal
156156
entries of <span class="math notranslate nohighlight">\(R\)</span> are found by inner products, i.e.,</p>
157157
<div class="math notranslate nohighlight">
158-
\[r_{ij} = q_i^*a_j, \, i &lt; j,\]</div>
158+
\[r_{ij} = q_i^*a_j, \, i &gt; j,\]</div>
159159
<p>and the diagonal entries are chosen so that <span class="math notranslate nohighlight">\(\|q_i\|=1\)</span>, for
160160
<span class="math notranslate nohighlight">\(i=1,2,\ldots,n\)</span>, i.e.</p>
161161
<div class="math notranslate nohighlight">
@@ -171,6 +171,11 @@ <h2><span class="section-number">2.2. </span>QR factorisation by classical Gram-
171171
<li><p>FOR <span class="math notranslate nohighlight">\(i = 1\)</span> TO <span class="math notranslate nohighlight">\(j-1\)</span></p>
172172
<ul>
173173
<li><p><span class="math notranslate nohighlight">\(r_{ij} \gets q_i^*a_j\)</span></p></li>
174+
</ul>
175+
</li>
176+
<li><p>END FOR</p></li>
177+
<li><p>FOR <span class="math notranslate nohighlight">\(i = 1\)</span> TO <span class="math notranslate nohighlight">\(j-1\)</span></p>
178+
<ul>
174179
<li><p><span class="math notranslate nohighlight">\(v_j \gets v_j - r_{ij}q_i\)</span></p></li>
175180
</ul>
176181
</li>
@@ -193,11 +198,11 @@ <h2><span class="section-number">2.2. </span>QR factorisation by classical Gram-
193198
<p>The <a class="reference internal" href="cla_utils.html#cla_utils.exercises2.GS_classical" title="cla_utils.exercises2.GS_classical"><code class="xref py py-func docutils literal notranslate"><span class="pre">cla_utils.exercises2.GS_classical()</span></code></a> function has been
194199
left unimplemented. It should implement the classical Gram-Schmidt
195200
algorithm above, using Numpy slice notation so that only one Python
196-
for loop is used. The function should work “in place” by changing
197-
the values in <span class="math notranslate nohighlight">\(A\)</span>, without introducing additional intermediate
198-
arrays (you will need to create a new array to store <span class="math notranslate nohighlight">\(R\)</span>). The test
199-
script <code class="docutils literal notranslate"><span class="pre">test_exercises2.py</span></code> in the <code class="docutils literal notranslate"><span class="pre">test</span></code> directory will test
200-
this function.</p>
201+
for loop is used. The function should work “in place” by making a
202+
copy of <span class="math notranslate nohighlight">\(A\)</span> and then changing the values in the copy, without
203+
introducing additional intermediate arrays (you will need to create
204+
a new array to store <span class="math notranslate nohighlight">\(R\)</span>). The test script <code class="docutils literal notranslate"><span class="pre">test_exercises2.py</span></code>
205+
in the <code class="docutils literal notranslate"><span class="pre">test</span></code> directory will test this function.</p>
201206
</div></div></section>
202207
<section id="projector-interpretation-of-gram-schmidt">
203208
<h2><span class="section-number">2.3. </span>Projector interpretation of Gram-Schmidt<a class="headerlink" href="#projector-interpretation-of-gram-schmidt" title="Permalink to this headline"></a></h2>
@@ -307,8 +312,9 @@ <h2><span class="section-number">2.4. </span>Modified Gram-Schmidt<a class="head
307312
algorithm above, using Numpy slice notation where possible.
308313
What is the minimal number of Python
309314
for loops possible?</p>
310-
<p>The function should work “in place” by changing the values of <span class="math notranslate nohighlight">\(A\)</span>,
311-
without introducing additional intermediate arrays. The test script
315+
<p>The function should work “in place” by making a
316+
copy of <span class="math notranslate nohighlight">\(A\)</span> and then changing those values, without introducing
317+
additional intermediate arrays. The test script
312318
<code class="docutils literal notranslate"><span class="pre">test_exercises2.py</span></code> in the <code class="docutils literal notranslate"><span class="pre">test</span></code> directory will test this
313319
function.</p>
314320
</div></div><div class="proof proof-type-exercise" id="id6">
@@ -681,7 +687,7 @@ <h2><span class="section-number">2.6. </span>Householder triangulation<a class="
681687
done so, you will need to modified
682688
<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>
683689
argument. You may make use of the built-in triangular solve
684-
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+1859.14341ea)"><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+1987.d7fa27f)"><code class="xref py py-func docutils literal notranslate"><span class="pre">scipy.linalg.solve_triangular()</span></code></a> (we shall consider
685691
triangular matrix algorithms briefly later). The test script
686692
<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
687693
function.</p>
@@ -793,7 +799,7 @@ <h2><span class="section-number">2.7. </span>Application: Least squares problems
793799
appropriate augmented matrix <span class="math notranslate nohighlight">\(\hat{A}\)</span>, calling
794800
<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
795801
subarrays using slice notation, before using
796-
<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+1859.14341ea)"><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+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
797803
system, before returning the solution <span class="math notranslate nohighlight">\(x\)</span>. The test script
798804
<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
799805
function.</p>

_sources/L2_QR_factorisation.rst.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ entries of `R` are found by inner products, i.e.,
125125

126126
.. math::
127127
128-
r_{ij} = q_i^*a_j, \, i < j,
128+
r_{ij} = q_i^*a_j, \, i > j,
129129
130130
and the diagonal entries are chosen so that `\|q_i\|=1`, for
131131
`i=1,2,\ldots,n`, i.e.
@@ -146,6 +146,9 @@ We now present the classical Gram-Schmidt algorithm as pseudo-code.
146146
* FOR `i = 1` TO `j-1`
147147

148148
* `r_{ij} \gets q_i^*a_j`
149+
* END FOR
150+
* FOR `i = 1` TO `j-1`
151+
149152
* `v_j \gets v_j - r_{ij}q_i`
150153
* END FOR
151154
* `r_{jj} \gets \|v_j\|_2`
@@ -161,11 +164,11 @@ for code blocks in pseudo-code in these notes.)
161164
The :func:`cla_utils.exercises2.GS_classical` function has been
162165
left unimplemented. It should implement the classical Gram-Schmidt
163166
algorithm above, using Numpy slice notation so that only one Python
164-
for loop is used. The function should work "in place" by changing
165-
the values in `A`, without introducing additional intermediate
166-
arrays (you will need to create a new array to store `R`). The test
167-
script ``test_exercises2.py`` in the ``test`` directory will test
168-
this function.
167+
for loop is used. The function should work "in place" by making a
168+
copy of `A` and then changing the values in the copy, without
169+
introducing additional intermediate arrays (you will need to create
170+
a new array to store `R`). The test script ``test_exercises2.py``
171+
in the ``test`` directory will test this function.
169172

170173
Projector interpretation of Gram-Schmidt
171174
----------------------------------------
@@ -289,7 +292,7 @@ We now present this modified Gram-Schmidt algorithm as pseudo-code.
289292

290293
* `r_{ii} \gets \|v_i\|_2`
291294
* `q_i = v_i/r_{ii}`
292-
295+
293296
* FOR `j = i+1` TO `n`
294297

295298
* `r_{ij} \gets q_i^*v_j`
@@ -308,8 +311,9 @@ in `A` with the `v` s and eventually the `q` s.
308311
What is the minimal number of Python
309312
for loops possible?
310313

311-
The function should work "in place" by changing the values of `A`,
312-
without introducing additional intermediate arrays. The test script
314+
The function should work "in place" by making a
315+
copy of `A` and then changing those values, without introducing
316+
additional intermediate arrays. The test script
313317
``test_exercises2.py`` in the ``test`` directory will test this
314318
function.
315319

_sources/errata.rst.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ repositories for Autumn 2021. An up to date version is in the
1717
function should just return R, not Q and R.
1818

1919
3. Updated the sign of the inequality in the formula for $r$ in Section 2.2.
20+
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.

errata.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ <h1>Errata for 2021/22<a class="headerlink" href="#errata-for-2021-22" title="Pe
6060
<li><p>The skeleton code for exercises2.GS_classical was amended as the
6161
function should just return R, not Q and R.</p></li>
6262
<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>
6365
</ol>
6466
</section>
6567

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)