mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 16:03:11 +02:00
feat: functional descritpion, inoput data format
This commit is contained in:
parent
bdc35c56b8
commit
9eae95aa0d
@ -11,5 +11,5 @@
|
||||
\@writefile{toc}{\contentsline {paragraph}{Source of reference values}{1}{}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {paragraph}{Comparision with our implementation}{1}{}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {paragraph}{Comments}{1}{}\protected@file@percent }
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Tests}{1}{}\protected@file@percent }
|
||||
\gdef \@abspage@last{1}
|
||||
\@writefile{toc}{\contentsline {section}{\numberline {4}Tests}{2}{}\protected@file@percent }
|
||||
\gdef \@abspage@last{2}
|
||||
|
||||
@ -1,18 +1,28 @@
|
||||
# Fdb version 3
|
||||
["xdvipdfmx"] 1669415883 "report.xdv" "report.pdf" "report" 1669415883
|
||||
"report.xdv" 1669415883 9032 e0569f80e045e5b09bb6059c146c8ce6 "xelatex"
|
||||
["xdvipdfmx"] 1669416365 "report.xdv" "report.pdf" "report" 1669416365
|
||||
"report.xdv" 1669416365 10180 709d76d884b60893bec7dace2291268a "xelatex"
|
||||
(generated)
|
||||
"report.pdf"
|
||||
["xelatex"] 1669415883 "/home/kuhyx/Zlew/Studia/NieNotatki/Projekty/ECRYPT/ECRYPT_PROJECT/report/report.tex" "report.xdv" "report" 1669415883
|
||||
"/home/kuhyx/Zlew/Studia/NieNotatki/Projekty/ECRYPT/ECRYPT_PROJECT/report/report.tex" 1669415882 1019 59e2dbd92220fc2615ecd7426f2fa942 ""
|
||||
["xelatex"] 1669416365 "/home/kuhyx/Zlew/Studia/NieNotatki/Projekty/ECRYPT/ECRYPT_PROJECT/report/report.tex" "report.xdv" "report" 1669416365
|
||||
"/home/kuhyx/Zlew/Studia/NieNotatki/Projekty/ECRYPT/ECRYPT_PROJECT/report/report.tex" 1669416359 1136 9019d76a2357bdeae7ec0634423e2864 ""
|
||||
"/usr/share/texmf-dist/fonts/map/fontname/texfonts.map" 1650183167 3524 cb3e574dea2d1052e39280babc910dc8 ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm" 1650183167 1524 4414a8315f39513458b80dfc63bff03a ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm" 1650183167 1512 f21f83efb36853c0b70002322c1ab3ad ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm" 1650183167 1520 eccf95517727cb11801f4f1aee3a21b4 ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmr12.tfm" 1650183167 1288 655e228510b4c2a1abe905c368440826 ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmr6.tfm" 1650183167 1300 b62933e007d01cfd073f79b963c01526 ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmr8.tfm" 1650183167 1292 21c1c5bfeaebccffdb478fd231a0997d ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm" 1650183167 1124 6c73e740cf17375f03eec0ee63599741 ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm" 1650183167 1116 933a60c408fc0a863a92debe84b2d294 ""
|
||||
"/usr/share/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm" 1650183167 1120 8b7d695260f3cff42e636090a8002094 ""
|
||||
"/usr/share/texmf-dist/tex/latex/base/article.cls" 1650183167 20144 8a7de377ae7a11ee924a7499611f5a9d ""
|
||||
"/usr/share/texmf-dist/tex/latex/base/size12.clo" 1650183167 8449 bc7344e882df4d7e51c046514dee83e4 ""
|
||||
"/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd" 1650183167 2430 06a89bcded389391906798ea7a3f3aaa ""
|
||||
"/usr/share/texmf-dist/tex/latex/l3backend/l3backend-xetex.def" 1650183167 35763 558b6bb076dfa9b058fe5c58dc6e0434 ""
|
||||
"/usr/share/texmf-dist/web2c/texmf.cnf" 1650183167 39911 2da6c67557ec033436fe5418a70a8a61 ""
|
||||
"/var/lib/texmf/web2c/xetex/xelatex.fmt" 1667928062 5825168 d4350bfbeefea539d526a1ead67e0962 ""
|
||||
"report.aux" 1669415883 1442 8433457e78a1473f9b0f3f2b204740c0 "xelatex"
|
||||
"report.tex" 1669415882 1019 59e2dbd92220fc2615ecd7426f2fa942 ""
|
||||
"report.aux" 1669416365 1442 b061c6ef2071c92e8485779836587cec "xelatex"
|
||||
"report.tex" 1669416359 1136 9019d76a2357bdeae7ec0634423e2864 ""
|
||||
(generated)
|
||||
"report.aux"
|
||||
"report.log"
|
||||
|
||||
@ -37,5 +37,15 @@ INPUT /usr/share/texmf-dist/tex/latex/base/ts1cmr.fd
|
||||
INPUT /usr/share/texmf-dist/tex/latex/base/ts1cmr.fd
|
||||
INPUT /usr/share/texmf-dist/tex/latex/base/ts1cmr.fd
|
||||
INPUT /usr/share/texmf-dist/tex/latex/base/ts1cmr.fd
|
||||
INPUT /usr/share/texmf-dist/fonts/map/fontname/texfonts.map
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmr8.tfm
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmr6.tfm
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm
|
||||
INPUT /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm
|
||||
OUTPUT report.xdv
|
||||
INPUT report.aux
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022/Arch Linux) (preloaded format=xelatex 2022.11.8) 25 NOV 2022 23:38
|
||||
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022/Arch Linux) (preloaded format=xelatex 2022.11.8) 25 NOV 2022 23:46
|
||||
entering extended mode
|
||||
restricted \write18 enabled.
|
||||
file:line:error style messages enabled.
|
||||
@ -54,16 +54,27 @@ LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3.
|
||||
LaTeX Font Info: ... okay on input line 3.
|
||||
[1
|
||||
LaTeX Font Info: External font `cmex10' loaded for size
|
||||
(Font) <12> on input line 6.
|
||||
LaTeX Font Info: External font `cmex10' loaded for size
|
||||
(Font) <8> on input line 6.
|
||||
LaTeX Font Info: External font `cmex10' loaded for size
|
||||
(Font) <6> on input line 6.
|
||||
|
||||
] (./report.aux) )
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 5--12
|
||||
|
||||
[]
|
||||
|
||||
[1
|
||||
|
||||
] [2] (./report.aux) )
|
||||
Here is how much of TeX's memory you used:
|
||||
482 strings out of 476156
|
||||
10256 string characters out of 5814963
|
||||
311707 words of memory out of 5000000
|
||||
21329 multiletter control sequences out of 15000+600000
|
||||
469307 words of font info for 34 fonts, out of 8000000 for 9000
|
||||
502 strings out of 476156
|
||||
10464 string characters out of 5814963
|
||||
312707 words of memory out of 5000000
|
||||
21341 multiletter control sequences out of 15000+600000
|
||||
472043 words of font info for 43 fonts, out of 8000000 for 9000
|
||||
1348 hyphenation exceptions out of 8191
|
||||
35i,5n,38p,261b,107s stack positions out of 5000i,500n,10000p,200000b,80000s
|
||||
|
||||
Output written on report.xdv (1 page, 9032 bytes).
|
||||
Output written on report.xdv (2 pages, 10180 bytes).
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -2,14 +2,27 @@
|
||||
|
||||
\begin{document}
|
||||
\section{Description of the used algorithm}
|
||||
Sieve of Eratosthenes is used to find all prime numbers below certain limit. \\
|
||||
It starts with number 2, which is the first prime number and marks all multiplies of this number (up to predefined limit) as not prime, those numbers will be later ignored \\
|
||||
Sieve of Eratosthenes is used to find all prime numbers below certain limit Lets call this limit $n$ \\
|
||||
It starts with number 2, which is the first prime number and marks all multiplies of this number (up to predefined limit) as composite (not prime), those numbers will be later ignored \\
|
||||
Then it takes next available number (3) and does the same thing \\
|
||||
This is repeated until there are no more numbers below the limit which are neither prime nor crossed out \\
|
||||
Then we return the list of all non-crossed out (prime) numbers
|
||||
Then we return the list of all non-crossed out (prime) numbers \\
|
||||
We used more optimized version of this algorithm and cross out composites only up to $\sqrt{n}$ in the main loop \\
|
||||
\section{Functional description of the application}
|
||||
First we define the limit, we name this limit as $num$ which will decide how many numbers we will check, either by user interface or we hard code it in \\
|
||||
We define boolean list which will be used to distinguish between prime and composite numbers \\
|
||||
We start with number 2 and assign it to variable named $p$ \\
|
||||
Then we calculate the primes using Sieve of Eratosthenes using nested while loops \\
|
||||
External loop goes through numbers smaller than $\sqrt(num)$, starting with current value of $p$ \\
|
||||
It checks if the number we are currently was checked out by checking the value of boolean table \\
|
||||
if it was not checked out it gets a new number which is the $p$ multiplied by 2, then it goes into inner loop \\
|
||||
inner loop sets all multiplicities of $p$ as crossed out by setting their value in boolean table to false \\
|
||||
then we increment the $p$ and the whole loop repeats until we run out of numbers \\
|
||||
we return array of prime numbers to function which prints those numbers
|
||||
|
||||
\subsection{Input data format}
|
||||
There is single input, variable named $num$ which is the upper limit of numbers to checked \\
|
||||
It is a simple int variable, it cannot be less than 2 and has to be a whole number.
|
||||
\subsection{Output text on console}
|
||||
\subsection{Format of output data}
|
||||
\section{Description of designed code structure}
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user