mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-11-10 19:07:11 +01:00
The 250-line cap applies to prose too, and the reports were the worst
offenders -- ENUME's projectA.tex alone was 1,876 lines. Each is now a
preamble plus one \input{} per section, which is how a long LaTeX document is
normally organised; not one byte of prose was rewritten.
"The PDF is unchanged" is checked by a script rather than by eye, because
hashing the PDF cannot work: pdflatex stamps a /CreationDate and an /ID into
every build, so two runs of the SAME source already differ. tex_fingerprint.sh
compares what a reader sees instead -- page count plus a hash of the extracted
text -- and it is stable across rebuilds of untouched sources, which is the
property that makes it usable as a gate.
It earned its keep immediately. Both ECOTE reports quote an example LaTeX
document inside an lstlisting block, so \end{document} appears in the middle
of the file; splitting on the FIRST one stranded everything after it. Same
page count, different text, caught automatically. EOPSY lab3 exposed a second
bug: a \section{} title that runs onto the next line.
Result: 19 .tex over the cap -> 1. The survivor,
ELAC/.../03-building-nfa-...tex, is 418 lines of consecutive tikz figures
with no subsection to split on and needs a hand-placed boundary.
Verified: 29 splits across two passes (section, then subsection for the
pieces still over), every one reporting `unchanged` from
scripts/tex_fingerprint.sh --check.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172dj34FDpao6wsix8ZuCzE
67 lines
3.6 KiB
TeX
67 lines
3.6 KiB
TeX
\section{Discussion of results}
|
|
\paragraph{Table}
|
|
|
|
\begin{center}
|
|
\resizebox{\textwidth}{!}{
|
|
\begin{tabular}{||c c c c c c||}
|
|
\hline
|
|
system of equations & method & demanded tolerance & error & iterations \\
|
|
\hline
|
|
task 3 system & Jacobi method & 10e-10 & 1.154375287358407e-10 & 38 \\
|
|
\hline
|
|
task 3 system & Jacobi method & 10e-10 & 5.770361548895147e-11 & 37 \\
|
|
\hline
|
|
task 3 system & Jacobi method & 3.202372833989376e-15 & 3.108624468950438e-15 & 53 \\
|
|
\hline
|
|
task 3 system & Gaussian-Seidel method & 10e-10 & 6.999102842719934e-10 & 19 \\
|
|
\hline
|
|
task 3 system & Gaussian-Seidel method & 1.776356839400250e-15 & 1.776356839400250e-15 & 30 \\
|
|
\hline
|
|
task 3 system & Matlab function & ? & 4.070144838902081e-15 & ? \\
|
|
\hline
|
|
task 2a) system & Jacobi method & 10e-10 & 6.955194519943778e-11 & 59 \\
|
|
\hline
|
|
task 2a) system & Jacobi method & 10e-10 & 1.699812218689508e-10 & 57 \\
|
|
\hline
|
|
task 2a) system & Jacob method & 3.202372833989376e-15 & 3.108624468950438e-15 & 84 \\
|
|
\hline
|
|
task 2a) system & Gaussian-Seidel method & 10e-10 & 5.311669113699570e-10 & 28 \\
|
|
\hline
|
|
task 2a) system & Gaussian-Seidel method & 1.538370149106851e-15 & 1.538370149106851e-15 & 42 \\
|
|
\hline
|
|
task 2a) system & Matlab function & ? & 3.662053438817790e-15 & ? \\
|
|
\hline
|
|
|
|
\end{tabular}}
|
|
\end{center}
|
|
\subsection{Comparison based on table}
|
|
Gaussian-Seidel method takes less iterations, can achieve smaller error and works under smaller demanded tolerance, that being said Jacobi method has one crucial advantage - it can be run in parallel. That means that even when Jacobi method takes twice or thrice amount of iteration us Gaussian-Seidel one if we just run it in paraller we can diminish this difference. In the examples we worked in, just two jacobi method running in paraller provide us with similar amount of iterations per one process as in Gaussian-Seidel one, and three or more processes give the edge to Jacobi method. With modern CPU's with at least 5 cores and correct implementation of algorithm, jacobi method reigns supreme.
|
|
|
|
\newpage
|
|
\subsection{Convergence}
|
|
The biggest problem is of course the fact that those iterative methods do not work on every system of equation. Like the one from task 2b).
|
|
For Jacobi's method the matrix is convergent if it has strong diagonal dominance. \textbf{A}, i.e:
|
|
\begin{enumerate}
|
|
\item \[ \| a_{ii} \| > \sum^n_{j=1, j \neq i} \|a_{ij} \| \]
|
|
\item \[ \| a_{jj} \| > \sum^n_{i=1, i \neq j} \|a_{ij} \| \]
|
|
\end{enumerate}
|
|
For Gaussian-Seidel method the matrix is convergent if it has strong diagonal dominance \textbf{or} if the matrix \textbf{A} is symmetric and positivie definite.
|
|
\subsubsection{2b) task convergence }
|
|
Let's check strong diagonal dominance from matrix \textbf{A} from task 2b) in matlab:
|
|
\begin{simplechar}
|
|
|
|
\hyperlink{function_3_dominant}{Code for checking if matrix is diagonally dominant}
|
|
\\
|
|
|
|
checkIfDiagonallyDominant(matrixB(10)) returns '0', therefore matrix from task 2b) will \textbf{not} converge. And as expected it does not work when put in my jacobiLoop function.
|
|
\subsubsection{Iterations as function of size of Matrix}
|
|
\hyperlink{function_3_plot}{Code for creating plot}
|
|
I have used matrix from task 2a), demanded tolerance equal to 10e-10, and max size of matrix equal to 500. for both methods
|
|
\begin{center}
|
|
\includegraphics[scale=0.75]{iterations.eps}
|
|
\end{center}
|
|
Gauss Seidel method again requires fewer iterations, around half the amount for Jacobi method. For both methods function of number of iterations acts like logarithmic function. Therefore we can assume that for big matrices required number of iterations will \textbf{not} change rapidly.
|
|
|
|
\chapter{Problem 4 - QR method of finding eigenvalues}
|
|
|