From 1e3e7ba8318cb46ae144106cf28d95514e984bcd Mon Sep 17 00:00:00 2001 From: mrtkp9993 Date: Sun, 13 Oct 2019 20:08:07 +0300 Subject: [PATCH] docs updated --- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 18 - docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js | 6 - docs/files.html | 22 +- docs/globals.html | 76 +- docs/globals_func.html | 76 +- docs/golden_section_search_8h.html | 13 +- docs/golden_section_search_8h.js | 2 +- docs/golden_section_search_8h_source.html | 2 +- docs/latex/Makefile | 23 + docs/latex/annotated.tex | 6 + docs/latex/bbp_type_formula_8h.tex | 57 + docs/latex/binom_8h.tex | 45 + docs/latex/brent_salamin_formula_8h.tex | 51 + docs/latex/devrandom_8h.tex | 47 + docs/latex/discrete_fourier_transform_8h.tex | 87 + docs/latex/doxygen.sty | 549 ++++ docs/latex/dual_numbers_8h.tex | 82 + docs/latex/files.tex | 18 + docs/latex/fixed_point_iteration_8h.tex | 55 + docs/latex/golden_section_search_8h.tex | 59 + docs/latex/integer_factorization_8h.tex | 106 + docs/latex/lagrange_interpolation_8h.tex | 51 + docs/latex/lcg_8h.tex | 56 + docs/latex/metropolis_hastings_8h.tex | 52 + docs/latex/numerical_integration_8h.tex | 120 + docs/latex/refman.tex | 196 ++ docs/latex/runge_kutta_8h.tex | 59 + docs/latex/statistics_8h.tex | 119 + docs/latex/struct_data.tex | 35 + docs/latex/struct_dual.tex | 25 + docs/latex/struct_result.tex | 41 + docs/lcg_8h.html | 15 +- docs/lcg_8h.js | 2 +- docs/lcg_8h_source.html | 2 +- docs/man/man3/Data.3 | 41 + docs/man/man3/Dual.3 | 32 + docs/man/man3/Result.3 | 34 + docs/man/man3/bbpTypeFormula.h.3 | 67 + docs/man/man3/binom.h.3 | 55 + docs/man/man3/brentSalaminFormula.h.3 | 60 + docs/man/man3/devrandom.h.3 | 57 + docs/man/man3/discreteFourierTransform.h.3 | 89 + docs/man/man3/dualNumbers.h.3 | 94 + docs/man/man3/fixedPointIteration.h.3 | 65 + docs/man/man3/goldenSectionSearch.h.3 | 73 + docs/man/man3/integerFactorization.h.3 | 112 + docs/man/man3/lagrangeInterpolation.h.3 | 63 + docs/man/man3/lcg.h.3 | 67 + docs/man/man3/metropolisHastings.h.3 | 63 + docs/man/man3/numericalIntegration.h.3 | 127 + docs/man/man3/rungeKutta.h.3 | 70 + docs/man/man3/statistics.h.3 | 127 + docs/menudata.js | 26 +- docs/metropolis_hastings_8h.html | 19 +- docs/metropolis_hastings_8h.js | 2 +- docs/metropolis_hastings_8h_source.html | 5 +- docs/navtreedata.js | 2 +- docs/navtreeindex0.js | 80 +- docs/numerical_integration_8h.html | 67 +- docs/numerical_integration_8h.js | 6 +- docs/numerical_integration_8h_source.html | 7 +- docs/rtf/refman.rtf | 2199 +++++++++++++++++ docs/runge_kutta_8h.html | 26 +- docs/runge_kutta_8h.js | 3 +- docs/runge_kutta_8h_source.html | 2 +- docs/search/all_2.js | 2 +- docs/search/all_3.js | 2 +- docs/search/all_5.js | 5 +- docs/search/all_7.js | 2 +- docs/search/all_8.js | 3 +- docs/search/all_9.js | 3 +- docs/search/all_a.js | 1 - docs/search/all_b.js | 2 +- docs/search/all_c.js | 7 +- docs/search/all_d.js | 1 - docs/search/files_3.js | 1 - docs/search/files_5.js | 1 - docs/search/files_6.js | 1 - docs/search/files_7.js | 1 - docs/search/files_8.js | 1 - docs/search/files_9.js | 1 - docs/search/functions_1.js | 2 +- docs/search/functions_2.js | 2 +- docs/search/functions_4.js | 4 +- docs/search/functions_6.js | 2 +- docs/search/functions_7.js | 2 +- docs/search/functions_8.js | 2 +- docs/search/functions_9.js | 2 +- docs/search/functions_a.js | 6 +- docs/statistics_8h.html | 91 +- docs/statistics_8h.js | 5 +- docs/statistics_8h_source.html | 7 +- 92 files changed, 5702 insertions(+), 370 deletions(-) create mode 100644 docs/latex/Makefile create mode 100644 docs/latex/annotated.tex create mode 100644 docs/latex/bbp_type_formula_8h.tex create mode 100644 docs/latex/binom_8h.tex create mode 100644 docs/latex/brent_salamin_formula_8h.tex create mode 100644 docs/latex/devrandom_8h.tex create mode 100644 docs/latex/discrete_fourier_transform_8h.tex create mode 100644 docs/latex/doxygen.sty create mode 100644 docs/latex/dual_numbers_8h.tex create mode 100644 docs/latex/files.tex create mode 100644 docs/latex/fixed_point_iteration_8h.tex create mode 100644 docs/latex/golden_section_search_8h.tex create mode 100644 docs/latex/integer_factorization_8h.tex create mode 100644 docs/latex/lagrange_interpolation_8h.tex create mode 100644 docs/latex/lcg_8h.tex create mode 100644 docs/latex/metropolis_hastings_8h.tex create mode 100644 docs/latex/numerical_integration_8h.tex create mode 100644 docs/latex/refman.tex create mode 100644 docs/latex/runge_kutta_8h.tex create mode 100644 docs/latex/statistics_8h.tex create mode 100644 docs/latex/struct_data.tex create mode 100644 docs/latex/struct_dual.tex create mode 100644 docs/latex/struct_result.tex create mode 100644 docs/man/man3/Data.3 create mode 100644 docs/man/man3/Dual.3 create mode 100644 docs/man/man3/Result.3 create mode 100644 docs/man/man3/bbpTypeFormula.h.3 create mode 100644 docs/man/man3/binom.h.3 create mode 100644 docs/man/man3/brentSalaminFormula.h.3 create mode 100644 docs/man/man3/devrandom.h.3 create mode 100644 docs/man/man3/discreteFourierTransform.h.3 create mode 100644 docs/man/man3/dualNumbers.h.3 create mode 100644 docs/man/man3/fixedPointIteration.h.3 create mode 100644 docs/man/man3/goldenSectionSearch.h.3 create mode 100644 docs/man/man3/integerFactorization.h.3 create mode 100644 docs/man/man3/lagrangeInterpolation.h.3 create mode 100644 docs/man/man3/lcg.h.3 create mode 100644 docs/man/man3/metropolisHastings.h.3 create mode 100644 docs/man/man3/numericalIntegration.h.3 create mode 100644 docs/man/man3/rungeKutta.h.3 create mode 100644 docs/man/man3/statistics.h.3 create mode 100644 docs/rtf/refman.rtf diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 1da39c5..a8f7dd6 100644 --- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -114,9 +114,6 @@ file  fixedPointIteration.h [code]  Fixed point iteration.
  -file  goldenSectionSearch.cpp - Golden Section Search.
-  file  goldenSectionSearch.h [code]  Golden Section Search.
  @@ -126,33 +123,18 @@ file  lagrangeInterpolation.h [code]  Lagrange Interpolation.
  -file  lcg.cpp - Linear Congruential Generator.
-  file  lcg.h [code]  Linear Congruential Generator.
  -file  metropolisHastings.cpp - Metropolis-Hastings algorithm.
-  file  metropolisHastings.h [code]  Metropolis-Hastings algorithm.
  -file  NumericalIntegration.cpp - Numerical integration methods.
-  file  numericalIntegration.h [code]  Numerical integration methods.
  -file  rungeKutta.cpp - Runge-Kutta Order Four.
-  file  rungeKutta.h [code]  Runge-Kutta Order Four.
  -file  statistics.cpp - Statistics related functions.
-  file  statistics.h [code]  Statistics related functions.
  diff --git a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js index f0c1974..1df0514 100644 --- a/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js +++ b/docs/dir_68267d1309a1af8e8297ef4c3efbcdba.js @@ -7,18 +7,12 @@ var dir_68267d1309a1af8e8297ef4c3efbcdba = [ "discreteFourierTransform.h", "discrete_fourier_transform_8h.html", "discrete_fourier_transform_8h" ], [ "dualNumbers.h", "dual_numbers_8h.html", "dual_numbers_8h" ], [ "fixedPointIteration.h", "fixed_point_iteration_8h.html", "fixed_point_iteration_8h" ], - [ "goldenSectionSearch.cpp", "golden_section_search_8cpp.html", "golden_section_search_8cpp" ], [ "goldenSectionSearch.h", "golden_section_search_8h.html", "golden_section_search_8h" ], [ "integerFactorization.h", "integer_factorization_8h.html", "integer_factorization_8h" ], [ "lagrangeInterpolation.h", "lagrange_interpolation_8h.html", "lagrange_interpolation_8h" ], - [ "lcg.cpp", "lcg_8cpp.html", "lcg_8cpp" ], [ "lcg.h", "lcg_8h.html", "lcg_8h" ], - [ "metropolisHastings.cpp", "metropolis_hastings_8cpp.html", "metropolis_hastings_8cpp" ], [ "metropolisHastings.h", "metropolis_hastings_8h.html", "metropolis_hastings_8h" ], - [ "NumericalIntegration.cpp", "_numerical_integration_8cpp.html", "_numerical_integration_8cpp" ], [ "numericalIntegration.h", "numerical_integration_8h.html", "numerical_integration_8h" ], - [ "rungeKutta.cpp", "runge_kutta_8cpp.html", "runge_kutta_8cpp" ], [ "rungeKutta.h", "runge_kutta_8h.html", "runge_kutta_8h" ], - [ "statistics.cpp", "statistics_8cpp.html", "statistics_8cpp" ], [ "statistics.h", "statistics_8h.html", "statistics_8h" ] ]; \ No newline at end of file diff --git a/docs/files.html b/docs/files.html index 846c830..5d2f29a 100644 --- a/docs/files.html +++ b/docs/files.html @@ -100,20 +100,14 @@  discreteFourierTransform.hFunctions for DFT and IDFT  dualNumbers.hImplementation of dual numbers  fixedPointIteration.hFixed point iteration - goldenSectionSearch.cppGolden Section Search - goldenSectionSearch.hGolden Section Search - integerFactorization.hImplements Pollard rho algorithm - lagrangeInterpolation.hLagrange Interpolation - lcg.cppLinear Congruential Generator - lcg.hLinear Congruential Generator - metropolisHastings.cppMetropolis-Hastings algorithm - metropolisHastings.hMetropolis-Hastings algorithm - NumericalIntegration.cppNumerical integration methods - numericalIntegration.hNumerical integration methods - rungeKutta.cppRunge-Kutta Order Four - rungeKutta.hRunge-Kutta Order Four - statistics.cppStatistics related functions - statistics.hStatistics related functions + goldenSectionSearch.hGolden Section Search + integerFactorization.hImplements Pollard rho algorithm + lagrangeInterpolation.hLagrange Interpolation + lcg.hLinear Congruential Generator + metropolisHastings.hMetropolis-Hastings algorithm + numericalIntegration.hNumerical integration methods + rungeKutta.hRunge-Kutta Order Four + statistics.hStatistics related functions diff --git a/docs/globals.html b/docs/globals.html index 854c2a8..aa141a1 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -86,16 +86,10 @@
-
Here is a list of all documented file members with links to the documentation:
- -

- b -

diff --git a/docs/globals_func.html b/docs/globals_func.html index f84feb4..3b33893 100644 --- a/docs/globals_func.html +++ b/docs/globals_func.html @@ -86,27 +86,16 @@
-  - -

- b -

diff --git a/docs/golden_section_search_8h.html b/docs/golden_section_search_8h.html index 9d25034..418878a 100644 --- a/docs/golden_section_search_8h.html +++ b/docs/golden_section_search_8h.html @@ -111,9 +111,10 @@ - - - + + + +

Functions

Result GoldenSectionSearch (long double a, long double b, const long double &tol, const std::function< long double(long double)> &func)
 Golden Section Search. More...
 
template<typename T = long double>
Result GoldenSectionSearch (long double a, long double b, const long double &tol, const std::function< long double(long double)> &func)
 Golden Section Search. More...
 

Detailed Description

Golden Section Search.

@@ -121,11 +122,13 @@
Author
Murat Koptur mkopt.nosp@m.ur3@.nosp@m.gmail.nosp@m..com

Last updated: 22/Jan/2019.

Function Documentation

- -

◆ GoldenSectionSearch()

+ +

◆ GoldenSectionSearch()

+
+template<typename T = long double>
diff --git a/docs/golden_section_search_8h.js b/docs/golden_section_search_8h.js index 3b3d901..7e93dc2 100644 --- a/docs/golden_section_search_8h.js +++ b/docs/golden_section_search_8h.js @@ -1,5 +1,5 @@ var golden_section_search_8h = [ [ "Result", "struct_result.html", "struct_result" ], - [ "GoldenSectionSearch", "golden_section_search_8h.html#a92b3f1ee0a763faf7e75bf4169ee9de3", null ] + [ "GoldenSectionSearch", "golden_section_search_8h.html#a68d217c205739ac83c123723b3bb8a78", null ] ]; \ No newline at end of file diff --git a/docs/golden_section_search_8h_source.html b/docs/golden_section_search_8h_source.html index f281c46..bcff266 100644 --- a/docs/golden_section_search_8h_source.html +++ b/docs/golden_section_search_8h_source.html @@ -90,7 +90,7 @@
goldenSectionSearch.h
-Go to the documentation of this file.
1 
21 #ifndef GOLDENSECTIONSEARCH_H
22 #define GOLDENSECTIONSEARCH_H
23 
24 #include <stdio.h>
25 #include <cassert>
26 #include <cmath>
27 #include <functional>
28 
36 struct Result {
37  long double a;
38  long double b;
39 };
40 
52 Result GoldenSectionSearch(long double a, long double b, const long double &tol,
53  const std::function<long double(long double)> &func);
54 
55 #endif /* GOLDENSECTIONSEARCH_H */
Result GoldenSectionSearch(long double a, long double b, const long double &tol, const std::function< long double(long double)> &func)
Golden Section Search.
Definition: goldenSectionSearch.cpp:34
+Go to the documentation of this file.
1 
21 #ifndef GOLDENSECTIONSEARCH_H
22 #define GOLDENSECTIONSEARCH_H
23 
24 #include <stdio.h>
25 #include <cassert>
26 #include <cmath>
27 #include <functional>
28 
36 struct Result {
37  long double a;
38  long double b;
39 };
40 
52 template <typename T = long double>
54  long double a, long double b, const long double &tol,
55  const std::function<long double(long double)> &func) {
56  assert(a < b);
57  assert(tol > 0);
58  Result result = {.a = 0, .b = 0};
59  const T inversePhi = (std::sqrt(5) - 1.0) / 2; // 1 / phi
60  const T inversePhi2 = (3.0 - std::sqrt(5)) / 2; // 1 / phi^2
61  T h = b - a;
62  if (h <= tol) {
63  result.a = a;
64  result.b = b;
65  return result;
66  }
67  auto n = (int)std::ceil(std::log(tol / h) / std::log(inversePhi));
68  auto c = a + inversePhi2 * h;
69  auto d = a + inversePhi * h;
70  auto yc = func(c);
71  auto yd = func(d);
72  for (auto k = 0; k < n - 1; k++) {
73  if (yc < yd) {
74  b = d;
75  d = c;
76  yd = yc;
77  h = inversePhi * h;
78  c = a + inversePhi2 * h;
79  yc = func(c);
80  } else {
81  a = c;
82  c = d;
83  yc = yd;
84  h = inversePhi * h;
85  d = a + inversePhi * h;
86  yd = func(d);
87  }
88  }
89  if (yc < yd) {
90  result.a = a;
91  result.b = d;
92  return result;
93  } else {
94  result.a = c;
95  result.b = b;
96  return result;
97  }
98 }
99 
100 #endif /* GOLDENSECTIONSEARCH_H */
Result GoldenSectionSearch(long double a, long double b, const long double &tol, const std::function< long double(long double)> &func)
Golden Section Search.
Definition: goldenSectionSearch.h:53
long double b
Definition: goldenSectionSearch.h:38
long double a
Definition: goldenSectionSearch.h:37
The struct that stores result.
Definition: goldenSectionSearch.h:36
diff --git a/docs/latex/Makefile b/docs/latex/Makefile new file mode 100644 index 0000000..877c9cc --- /dev/null +++ b/docs/latex/Makefile @@ -0,0 +1,23 @@ +LATEX_CMD=pdflatex + +all: refman.pdf + +pdf: refman.pdf + +refman.pdf: clean refman.tex + $(LATEX_CMD) refman + makeindex refman.idx + $(LATEX_CMD) refman + latex_count=8 ; \ + while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ + do \ + echo "Rerunning latex...." ;\ + $(LATEX_CMD) refman ;\ + latex_count=`expr $$latex_count - 1` ;\ + done + makeindex refman.idx + $(LATEX_CMD) refman + + +clean: + rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf diff --git a/docs/latex/annotated.tex b/docs/latex/annotated.tex new file mode 100644 index 0000000..70ab1e8 --- /dev/null +++ b/docs/latex/annotated.tex @@ -0,0 +1,6 @@ +\section{Class List} +Here are the classes, structs, unions and interfaces with brief descriptions\+:\begin{DoxyCompactList} +\item\contentsline{section}{\mbox{\hyperlink{struct_data}{Data$<$ T $>$}} }{\pageref{struct_data}}{} +\item\contentsline{section}{\mbox{\hyperlink{struct_dual}{Dual}} }{\pageref{struct_dual}}{} +\item\contentsline{section}{\mbox{\hyperlink{struct_result}{Result}} \\*The struct that stores result }{\pageref{struct_result}}{} +\end{DoxyCompactList} diff --git a/docs/latex/bbp_type_formula_8h.tex b/docs/latex/bbp_type_formula_8h.tex new file mode 100644 index 0000000..98364fd --- /dev/null +++ b/docs/latex/bbp_type_formula_8h.tex @@ -0,0 +1,57 @@ +\hypertarget{bbp_type_formula_8h}{}\section{src/bbp\+Type\+Formula.h File Reference} +\label{bbp_type_formula_8h}\index{src/bbpTypeFormula.h@{src/bbpTypeFormula.h}} + + +B\+PP Type formula calculation. + + +{\ttfamily \#include $<$cassert$>$}\newline +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$vector$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{bbp_type_formula_8h_a97f17f569c57d68f3e40dc72557f7e50}{P}} (const int \&s, const int \&b, const int \&n, const std\+::vector$<$ int $>$ \&A, const int \&n\+\_\+iter) +\begin{DoxyCompactList}\small\item\em B\+PP Type formula calculation. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +B\+PP Type formula calculation. + +The Bailey–\+Borwein–\+Plouffe formula (B\+BP formula) is a spigot algorithm which is an algorithm for computing the value of a mathematical constant such as π or e which generates output digits in some base (usually 2 or a power of 2) from left to right, with limited intermediate storage. The name comes from the sense of the word \char`\"{}spigot\char`\"{} for a tap or valve controlling the flow of a liquid. + +Formula was taken from\+: \href{https://bbp.carma.newcastle.edu.au/}{\texttt{ https\+://bbp.\+carma.\+newcastle.\+edu.\+au/}} + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{bbp_type_formula_8h_a97f17f569c57d68f3e40dc72557f7e50}\label{bbp_type_formula_8h_a97f17f569c57d68f3e40dc72557f7e50}} +\index{bbpTypeFormula.h@{bbpTypeFormula.h}!P@{P}} +\index{P@{P}!bbpTypeFormula.h@{bbpTypeFormula.h}} +\subsubsection{\texorpdfstring{P()}{P()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T P (\begin{DoxyParamCaption}\item[{const int \&}]{s, }\item[{const int \&}]{b, }\item[{const int \&}]{n, }\item[{const std\+::vector$<$ int $>$ \&}]{A, }\item[{const int \&}]{n\+\_\+iter }\end{DoxyParamCaption})} + + + +B\+PP Type formula calculation. + + +\begin{DoxyParams}{Parameters} +{\em s} & An integer. \\ +\hline +{\em b} & An integer. \\ +\hline +{\em n} & An integer. \\ +\hline +{\em A} & A sequence of integers. \\ +\hline +{\em n\+\_\+iter} & Iteration count.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Approximation of a number. +\end{DoxyReturn} diff --git a/docs/latex/binom_8h.tex b/docs/latex/binom_8h.tex new file mode 100644 index 0000000..a56d4b6 --- /dev/null +++ b/docs/latex/binom_8h.tex @@ -0,0 +1,45 @@ +\hypertarget{binom_8h}{}\section{src/binom.h File Reference} +\label{binom_8h}\index{src/binom.h@{src/binom.h}} + + +Calculate binomial coefficient. + + +{\ttfamily \#include $<$cmath$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = unsigned long long int$>$ }\\T \mbox{\hyperlink{binom_8h_a793d4bc390b1537309428c8550839a78}{binom\+Coef}} (const unsigned long \&n, const unsigned long \&k) +\begin{DoxyCompactList}\small\item\em Calculate binomial coefficient. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Calculate binomial coefficient. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{binom_8h_a793d4bc390b1537309428c8550839a78}\label{binom_8h_a793d4bc390b1537309428c8550839a78}} +\index{binom.h@{binom.h}!binomCoef@{binomCoef}} +\index{binomCoef@{binomCoef}!binom.h@{binom.h}} +\subsubsection{\texorpdfstring{binomCoef()}{binomCoef()}} +{\footnotesize\ttfamily template$<$typename T = unsigned long long int$>$ \\ +T binom\+Coef (\begin{DoxyParamCaption}\item[{const unsigned long \&}]{n, }\item[{const unsigned long \&}]{k }\end{DoxyParamCaption})} + + + +Calculate binomial coefficient. + + +\begin{DoxyParams}{Parameters} +{\em n} & An integer. \\ +\hline +{\em k} & An integer.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Binomial coefficient. +\end{DoxyReturn} diff --git a/docs/latex/brent_salamin_formula_8h.tex b/docs/latex/brent_salamin_formula_8h.tex new file mode 100644 index 0000000..018dd7d --- /dev/null +++ b/docs/latex/brent_salamin_formula_8h.tex @@ -0,0 +1,51 @@ +\hypertarget{brent_salamin_formula_8h}{}\section{src/brent\+Salamin\+Formula.h File Reference} +\label{brent_salamin_formula_8h}\index{src/brentSalaminFormula.h@{src/brentSalaminFormula.h}} + + +Brent-\/\+Salamin Formula. + + +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$vector$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{brent_salamin_formula_8h_a3b5f7732aa9855314ff5e7c98dca91b1}{calc\+\_\+pi}} (const unsigned int \&n\+\_\+iter) +\begin{DoxyCompactList}\small\item\em Brent-\/\+Salamin Formula. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Brent-\/\+Salamin Formula. + +The Brent-\/\+Salamin formula, also called the Gauss-\/\+Salamin formula or Salamin formula, is a formula that uses the arithmetic-\/geometric mean to compute pi. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 24/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{brent_salamin_formula_8h_a3b5f7732aa9855314ff5e7c98dca91b1}\label{brent_salamin_formula_8h_a3b5f7732aa9855314ff5e7c98dca91b1}} +\index{brentSalaminFormula.h@{brentSalaminFormula.h}!calc\_pi@{calc\_pi}} +\index{calc\_pi@{calc\_pi}!brentSalaminFormula.h@{brentSalaminFormula.h}} +\subsubsection{\texorpdfstring{calc\_pi()}{calc\_pi()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T calc\+\_\+pi (\begin{DoxyParamCaption}\item[{const unsigned int \&}]{n\+\_\+iter }\end{DoxyParamCaption})} + + + +Brent-\/\+Salamin Formula. + + +\begin{DoxyTemplParams}{Template Parameters} +{\em T} & Type of return value. Choose appropriate type for precision which you want. \\ +\hline +\end{DoxyTemplParams} + +\begin{DoxyParams}{Parameters} +{\em n\+\_\+iter} & Iteration count.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Approximation of pi. +\end{DoxyReturn} diff --git a/docs/latex/devrandom_8h.tex b/docs/latex/devrandom_8h.tex new file mode 100644 index 0000000..20bc3ac --- /dev/null +++ b/docs/latex/devrandom_8h.tex @@ -0,0 +1,47 @@ +\hypertarget{devrandom_8h}{}\section{src/devrandom.h File Reference} +\label{devrandom_8h}\index{src/devrandom.h@{src/devrandom.h}} + + +Generate random numbers/strings from /dev/random. + + +{\ttfamily \#include $<$stdio.\+h$>$}\newline +{\ttfamily \#include $<$fstream$>$}\newline +{\ttfamily \#include $<$iostream$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T $>$ }\\T \mbox{\hyperlink{devrandom_8h_ad3a63441da329a84f7ceb34aa1487400}{devrandom}} () +\begin{DoxyCompactList}\small\item\em A function template which takes a type as argument and returns an random element of that type. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Generate random numbers/strings from /dev/random. + +/dev/random is special file that serve as pseudorandom number generator. They allow access to environmental noise collected from device drivers and other sources. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{devrandom_8h_ad3a63441da329a84f7ceb34aa1487400}\label{devrandom_8h_ad3a63441da329a84f7ceb34aa1487400}} +\index{devrandom.h@{devrandom.h}!devrandom@{devrandom}} +\index{devrandom@{devrandom}!devrandom.h@{devrandom.h}} +\subsubsection{\texorpdfstring{devrandom()}{devrandom()}} +{\footnotesize\ttfamily template$<$typename T $>$ \\ +T devrandom (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} + + + +A function template which takes a type as argument and returns an random element of that type. + + +\begin{DoxyParams}{Parameters} +{\em T} & A type.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Random element. +\end{DoxyReturn} diff --git a/docs/latex/discrete_fourier_transform_8h.tex b/docs/latex/discrete_fourier_transform_8h.tex new file mode 100644 index 0000000..1c8fb89 --- /dev/null +++ b/docs/latex/discrete_fourier_transform_8h.tex @@ -0,0 +1,87 @@ +\hypertarget{discrete_fourier_transform_8h}{}\section{src/discrete\+Fourier\+Transform.h File Reference} +\label{discrete_fourier_transform_8h}\index{src/discreteFourierTransform.h@{src/discreteFourierTransform.h}} + + +Functions for D\+FT and I\+D\+FT. + + +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$complex$>$}\newline +{\ttfamily \#include $<$iostream$>$}\newline +{\ttfamily \#include $<$vector$>$}\newline +\subsection*{Typedefs} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = long double$>$ }\\using \mbox{\hyperlink{discrete_fourier_transform_8h_a710b388b1d92514f461cb65049859d67}{Complex}} = std\+::complex$<$ T $>$ +\item +{\footnotesize template$<$typename T = long double$>$ }\\using \mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}} = std\+::vector$<$ std\+::complex$<$ T $>$ $>$ +\end{DoxyCompactItemize} +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +\mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}} \mbox{\hyperlink{discrete_fourier_transform_8h_aba405a29a7c12bd7d8b996c96978c880}{dft}} (const \mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}}$<$$>$ \&input) +\item +\mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}} \mbox{\hyperlink{discrete_fourier_transform_8h_afda9df10dcfa62a6ee9723898af8ff58}{idft}} (const \mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}}$<$$>$ \&input) +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Functions for D\+FT and I\+D\+FT. + +In mathematics, the discrete Fourier transform (D\+FT) converts a finite sequence of equally-\/spaced samples of a function into a same-\/length sequence of equally-\/spaced samples of the discrete-\/time Fourier transform (D\+T\+FT), which is a complex-\/valued function of frequency. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 2/\+Feb/2019. + +\subsection{Typedef Documentation} +\mbox{\Hypertarget{discrete_fourier_transform_8h_a710b388b1d92514f461cb65049859d67}\label{discrete_fourier_transform_8h_a710b388b1d92514f461cb65049859d67}} +\index{discreteFourierTransform.h@{discreteFourierTransform.h}!Complex@{Complex}} +\index{Complex@{Complex}!discreteFourierTransform.h@{discreteFourierTransform.h}} +\subsubsection{\texorpdfstring{Complex}{Complex}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +using \mbox{\hyperlink{discrete_fourier_transform_8h_a710b388b1d92514f461cb65049859d67}{Complex}} = std\+::complex$<$T$>$} + +A type for complex numbers. \mbox{\Hypertarget{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}\label{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}} +\index{discreteFourierTransform.h@{discreteFourierTransform.h}!CVec@{CVec}} +\index{CVec@{CVec}!discreteFourierTransform.h@{discreteFourierTransform.h}} +\subsubsection{\texorpdfstring{CVec}{CVec}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +using \mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}} = std\+::vector$<$std\+::complex$<$T$>$ $>$} + +A type for array of complex numbers. + +\subsection{Function Documentation} +\mbox{\Hypertarget{discrete_fourier_transform_8h_aba405a29a7c12bd7d8b996c96978c880}\label{discrete_fourier_transform_8h_aba405a29a7c12bd7d8b996c96978c880}} +\index{discreteFourierTransform.h@{discreteFourierTransform.h}!dft@{dft}} +\index{dft@{dft}!discreteFourierTransform.h@{discreteFourierTransform.h}} +\subsubsection{\texorpdfstring{dft()}{dft()}} +{\footnotesize\ttfamily \mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}} dft (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}}$<$$>$ \&}]{input }\end{DoxyParamCaption})} + +Calculate D\+FT for given input. + + +\begin{DoxyParams}{Parameters} +{\em input} & Vector of complex numbers.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +D\+FT. +\end{DoxyReturn} +\mbox{\Hypertarget{discrete_fourier_transform_8h_afda9df10dcfa62a6ee9723898af8ff58}\label{discrete_fourier_transform_8h_afda9df10dcfa62a6ee9723898af8ff58}} +\index{discreteFourierTransform.h@{discreteFourierTransform.h}!idft@{idft}} +\index{idft@{idft}!discreteFourierTransform.h@{discreteFourierTransform.h}} +\subsubsection{\texorpdfstring{idft()}{idft()}} +{\footnotesize\ttfamily \mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}} idft (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{discrete_fourier_transform_8h_a37973646ed6a7ed0b0cf2287bdaef0e8}{C\+Vec}}$<$$>$ \&}]{input }\end{DoxyParamCaption})} + +Calculate I\+D\+FT for given input. + + +\begin{DoxyParams}{Parameters} +{\em input} & Vector of complex numbers.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +I\+D\+FT. +\end{DoxyReturn} diff --git a/docs/latex/doxygen.sty b/docs/latex/doxygen.sty new file mode 100644 index 0000000..cf92712 --- /dev/null +++ b/docs/latex/doxygen.sty @@ -0,0 +1,549 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{doxygen} + +% Packages used by this style file +\RequirePackage{alltt} +\RequirePackage{array} +\RequirePackage{calc} +\RequirePackage{float} +\RequirePackage{ifthen} +\RequirePackage{verbatim} +\RequirePackage[table]{xcolor} +\RequirePackage{longtable} +\RequirePackage{tabu} +\RequirePackage{fancyvrb} +\RequirePackage{tabularx} +\RequirePackage{multirow} +\RequirePackage{hanging} +\RequirePackage{ifpdf} +\RequirePackage{adjustbox} +\RequirePackage{amssymb} +\RequirePackage{stackengine} +\RequirePackage[normalem]{ulem} % for strikeout, but don't modify emphasis + +%---------- Internal commands used in this style file ---------------- + +\newcommand{\ensurespace}[1]{% + \begingroup% + \setlength{\dimen@}{#1}% + \vskip\z@\@plus\dimen@% + \penalty -100\vskip\z@\@plus -\dimen@% + \vskip\dimen@% + \penalty 9999% + \vskip -\dimen@% + \vskip\z@skip% hide the previous |\vskip| from |\addvspace| + \endgroup% +} + +\newcommand{\DoxyLabelFont}{} +\newcommand{\entrylabel}[1]{% + {% + \parbox[b]{\labelwidth-4pt}{% + \makebox[0pt][l]{\DoxyLabelFont#1}% + \vspace{1.5\baselineskip}% + }% + }% +} + +\newenvironment{DoxyDesc}[1]{% + \ensurespace{4\baselineskip}% + \begin{list}{}{% + \settowidth{\labelwidth}{20pt}% + \setlength{\parsep}{0pt}% + \setlength{\itemsep}{0pt}% + \setlength{\leftmargin}{\labelwidth+\labelsep}% + \renewcommand{\makelabel}{\entrylabel}% + }% + \item[#1]% +}{% + \end{list}% +} + +\newsavebox{\xrefbox} +\newlength{\xreflength} +\newcommand{\xreflabel}[1]{% + \sbox{\xrefbox}{#1}% + \setlength{\xreflength}{\wd\xrefbox}% + \ifthenelse{\xreflength>\labelwidth}{% + \begin{minipage}{\textwidth}% + \setlength{\parindent}{0pt}% + \hangindent=15pt\bfseries #1\vspace{1.2\itemsep}% + \end{minipage}% + }{% + \parbox[b]{\labelwidth}{\makebox[0pt][l]{\textbf{#1}}}% + }% +} + +%---------- Commands used by doxygen LaTeX output generator ---------- + +% Used by
 ... 
+\newenvironment{DoxyPre}{% + \small% + \begin{alltt}% +}{% + \end{alltt}% + \normalsize% +} +% Necessary for redefining not defined charcaters, i.e. "Replacement Character" in tex output. +\newlength{\CodeWidthChar} +\newlength{\CodeHeightChar} +\settowidth{\CodeWidthChar}{?} +\settoheight{\CodeHeightChar}{?} +% Necessary for hanging indent +\newlength{\DoxyCodeWidth} + +\newcommand\DoxyCodeLine[1]{\hangpara{\DoxyCodeWidth}{1}{#1}\par} + +\newcommand\NiceSpace{% + \discretionary{}{\kern\fontdimen2\font}{\kern\fontdimen2\font}% +} + +% Used by @code ... @endcode +\newenvironment{DoxyCode}[1]{% + \par% + \scriptsize% + \normalfont\ttfamily% + \rightskip0pt plus 1fil% + \settowidth{\DoxyCodeWidth}{000000}% + \settowidth{\CodeWidthChar}{?}% + \settoheight{\CodeHeightChar}{?}% + \setlength{\parskip}{0ex plus 0ex minus 0ex}% + \ifthenelse{\equal{#1}{0}} + { + {\lccode`~32 \lowercase{\global\let~}\NiceSpace}\obeyspaces% + } + { + {\lccode`~32 \lowercase{\global\let~}}\obeyspaces% + } + +}{% + \normalfont% + \normalsize% + \settowidth{\CodeWidthChar}{?}% + \settoheight{\CodeHeightChar}{?}% +} + +% Redefining not defined characters, i.e. "Replacement Character" in tex output. +\def\ucr{\adjustbox{width=\CodeWidthChar,height=\CodeHeightChar}{\stackinset{c}{}{c}{-.2pt}{% + \textcolor{white}{\sffamily\bfseries\small ?}}{% + \rotatebox{45}{$\blacksquare$}}}} + +% Used by @example, @include, @includelineno and @dontinclude +\newenvironment{DoxyCodeInclude}[1]{% + \DoxyCode{#1}% +}{% + \endDoxyCode% +} + +% Used by @verbatim ... @endverbatim +\newenvironment{DoxyVerb}{% + \footnotesize% + \verbatim% +}{% + \endverbatim% + \normalsize% +} + +% Used by @verbinclude +\newenvironment{DoxyVerbInclude}{% + \DoxyVerb% +}{% + \endDoxyVerb% +} + +% Used by numbered lists (using '-#' or
    ...
) +\newenvironment{DoxyEnumerate}{% + \enumerate% +}{% + \endenumerate% +} + +% Used by bullet lists (using '-', @li, @arg, or
    ...
) +\newenvironment{DoxyItemize}{% + \itemize% +}{% + \enditemize% +} + +% Used by description lists (using
...
) +\newenvironment{DoxyDescription}{% + \description% +}{% + \enddescription% +} + +% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc +% (only if caption is specified) +\newenvironment{DoxyImage}{% + \begin{figure}[H]% + \begin{center}% +}{% + \end{center}% + \end{figure}% +} + +% Used by @image, @dotfile, @dot ... @enddot, and @msc ... @endmsc +% (only if no caption is specified) +\newenvironment{DoxyImageNoCaption}{% + \begin{center}% +}{% + \end{center}% +} + +% Used by @image +% (only if inline is specified) +\newenvironment{DoxyInlineImage}{% +}{% +} + +% Used by @attention +\newenvironment{DoxyAttention}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @author and @authors +\newenvironment{DoxyAuthor}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @date +\newenvironment{DoxyDate}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @invariant +\newenvironment{DoxyInvariant}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @note +\newenvironment{DoxyNote}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @post +\newenvironment{DoxyPostcond}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @pre +\newenvironment{DoxyPrecond}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @copyright +\newenvironment{DoxyCopyright}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @remark +\newenvironment{DoxyRemark}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @return and @returns +\newenvironment{DoxyReturn}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @since +\newenvironment{DoxySince}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @see +\newenvironment{DoxySeeAlso}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @version +\newenvironment{DoxyVersion}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @warning +\newenvironment{DoxyWarning}[1]{% + \begin{DoxyDesc}{#1}% +}{% + \end{DoxyDesc}% +} + +% Used by @internal +\newenvironment{DoxyInternal}[1]{% + \paragraph*{#1}% +}{% +} + +% Used by @par and @paragraph +\newenvironment{DoxyParagraph}[1]{% + \begin{list}{}{% + \settowidth{\labelwidth}{40pt}% + \setlength{\leftmargin}{\labelwidth}% + \setlength{\parsep}{0pt}% + \setlength{\itemsep}{-4pt}% + \renewcommand{\makelabel}{\entrylabel}% + }% + \item[#1]% +}{% + \end{list}% +} + +% Used by parameter lists +\newenvironment{DoxyParams}[2][]{% + \tabulinesep=1mm% + \par% + \ifthenelse{\equal{#1}{}}% + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|}}% name + description + {\ifthenelse{\equal{#1}{1}}% + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + name + desc + {\begin{longtabu*}spread 0pt [l]{|X[-1,l]|X[-1,l]|X[-1,l]|X[-1,l]|}}% in/out + type + name + desc + } + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #2}\\[1ex]% + \hline% + \endhead% +}{% + \end{longtabu*}% + \vspace{6pt}% +} + +% Used for fields of simple structs +\newenvironment{DoxyFields}[1]{% + \tabulinesep=1mm% + \par% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|X[-1,l]|}% + \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{3}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endhead% +}{% + \end{longtabu*}% + \vspace{6pt}% +} + +% Used for fields simple class style enums +\newenvironment{DoxyEnumFields}[1]{% + \tabulinesep=1mm% + \par% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endhead% +}{% + \end{longtabu*}% + \vspace{6pt}% +} + +% Used for parameters within a detailed function description +\newenvironment{DoxyParamCaption}{% + \renewcommand{\item}[2][]{\\ \hspace*{2.0cm} ##1 {\em ##2}}% +}{% +} + +% Used by return value lists +\newenvironment{DoxyRetVals}[1]{% + \tabulinesep=1mm% + \par% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endhead% +}{% + \end{longtabu*}% + \vspace{6pt}% +} + +% Used by exception lists +\newenvironment{DoxyExceptions}[1]{% + \tabulinesep=1mm% + \par% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endhead% +}{% + \end{longtabu*}% + \vspace{6pt}% +} + +% Used by template parameter lists +\newenvironment{DoxyTemplParams}[1]{% + \tabulinesep=1mm% + \par% + \begin{longtabu*}spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endhead% +}{% + \end{longtabu*}% + \vspace{6pt}% +} + +% Used for member lists +\newenvironment{DoxyCompactItemize}{% + \begin{itemize}% + \setlength{\itemsep}{-3pt}% + \setlength{\parsep}{0pt}% + \setlength{\topsep}{0pt}% + \setlength{\partopsep}{0pt}% +}{% + \end{itemize}% +} + +% Used for member descriptions +\newenvironment{DoxyCompactList}{% + \begin{list}{}{% + \setlength{\leftmargin}{0.5cm}% + \setlength{\itemsep}{0pt}% + \setlength{\parsep}{0pt}% + \setlength{\topsep}{0pt}% + \renewcommand{\makelabel}{\hfill}% + }% +}{% + \end{list}% +} + +% Used for reference lists (@bug, @deprecated, @todo, etc.) +\newenvironment{DoxyRefList}{% + \begin{list}{}{% + \setlength{\labelwidth}{10pt}% + \setlength{\leftmargin}{\labelwidth}% + \addtolength{\leftmargin}{\labelsep}% + \renewcommand{\makelabel}{\xreflabel}% + }% +}{% + \end{list}% +} + +% Used by @bug, @deprecated, @todo, etc. +\newenvironment{DoxyRefDesc}[1]{% + \begin{list}{}{% + \renewcommand\makelabel[1]{\textbf{##1}}% + \settowidth\labelwidth{\makelabel{#1}}% + \setlength\leftmargin{\labelwidth+\labelsep}% + }% +}{% + \end{list}% +} + +% Used by parameter lists and simple sections +\newenvironment{Desc} +{\begin{list}{}{% + \settowidth{\labelwidth}{20pt}% + \setlength{\parsep}{0pt}% + \setlength{\itemsep}{0pt}% + \setlength{\leftmargin}{\labelwidth+\labelsep}% + \renewcommand{\makelabel}{\entrylabel}% + } +}{% + \end{list}% +} + +% Used by tables +\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}% +\newenvironment{TabularC}[1]% +{\tabulinesep=1mm +\begin{longtabu*}spread 0pt [c]{*#1{|X[-1]}|}}% +{\end{longtabu*}\par}% + +\newenvironment{TabularNC}[1]% +{\begin{tabu}spread 0pt [l]{*#1{|X[-1]}|}}% +{\end{tabu}\par}% + +% Used for member group headers +\newenvironment{Indent}{% + \begin{list}{}{% + \setlength{\leftmargin}{0.5cm}% + }% + \item[]\ignorespaces% +}{% + \unskip% + \end{list}% +} + +% Used when hyperlinks are turned off +\newcommand{\doxyref}[3]{% + \textbf{#1} (\textnormal{#2}\,\pageref{#3})% +} + +% Used to link to a table when hyperlinks are turned on +\newcommand{\doxytablelink}[2]{% + \ref{#1}% +} + +% Used to link to a table when hyperlinks are turned off +\newcommand{\doxytableref}[3]{% + \ref{#3}% +} + +% Used by @addindex +\newcommand{\lcurly}{\{} +\newcommand{\rcurly}{\}} + +% Colors used for syntax highlighting +\definecolor{comment}{rgb}{0.5,0.0,0.0} +\definecolor{keyword}{rgb}{0.0,0.5,0.0} +\definecolor{keywordtype}{rgb}{0.38,0.25,0.125} +\definecolor{keywordflow}{rgb}{0.88,0.5,0.0} +\definecolor{preprocessor}{rgb}{0.5,0.38,0.125} +\definecolor{stringliteral}{rgb}{0.0,0.125,0.25} +\definecolor{charliteral}{rgb}{0.0,0.5,0.5} +\definecolor{vhdldigit}{rgb}{1.0,0.0,1.0} +\definecolor{vhdlkeyword}{rgb}{0.43,0.0,0.43} +\definecolor{vhdllogic}{rgb}{1.0,0.0,0.0} +\definecolor{vhdlchar}{rgb}{0.0,0.0,0.0} + +% Color used for table heading +\newcommand{\tableheadbgcolor}{lightgray}% + +% Version of hypertarget with correct landing location +\newcommand{\Hypertarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}} + +% Define caption that is also suitable in a table +\makeatletter +\def\doxyfigcaption{% +\refstepcounter{figure}% +\@dblarg{\@caption{figure}}} +\makeatother diff --git a/docs/latex/dual_numbers_8h.tex b/docs/latex/dual_numbers_8h.tex new file mode 100644 index 0000000..ed8b5c4 --- /dev/null +++ b/docs/latex/dual_numbers_8h.tex @@ -0,0 +1,82 @@ +\hypertarget{dual_numbers_8h}{}\section{src/dual\+Numbers.h File Reference} +\label{dual_numbers_8h}\index{src/dualNumbers.h@{src/dualNumbers.h}} + + +Implementation of dual numbers. + + +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$iostream$>$}\newline +\subsection*{Classes} +\begin{DoxyCompactItemize} +\item +struct \mbox{\hyperlink{struct_dual}{Dual}} +\end{DoxyCompactItemize} +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +\mbox{\Hypertarget{dual_numbers_8h_a7e876df68c9fcebc82457238215694da}\label{dual_numbers_8h_a7e876df68c9fcebc82457238215694da}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries operator+} (const \mbox{\hyperlink{struct_dual}{Dual}} \&u, const \mbox{\hyperlink{struct_dual}{Dual}} \&v) +\item +\mbox{\Hypertarget{dual_numbers_8h_a8f1cdd4183d913fe44983dc3aa3c3050}\label{dual_numbers_8h_a8f1cdd4183d913fe44983dc3aa3c3050}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries operator-\/} (const \mbox{\hyperlink{struct_dual}{Dual}} \&u, const \mbox{\hyperlink{struct_dual}{Dual}} \&v) +\item +\mbox{\Hypertarget{dual_numbers_8h_aa100fce02604176a8731f1997032ff4b}\label{dual_numbers_8h_aa100fce02604176a8731f1997032ff4b}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries operator $\ast$} (const \mbox{\hyperlink{struct_dual}{Dual}} \&u, const \mbox{\hyperlink{struct_dual}{Dual}} \&v) +\item +\mbox{\Hypertarget{dual_numbers_8h_a2f24c51c6b7d90a5d8c0bfea18eba147}\label{dual_numbers_8h_a2f24c51c6b7d90a5d8c0bfea18eba147}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries operator/} (const \mbox{\hyperlink{struct_dual}{Dual}} \&u, const \mbox{\hyperlink{struct_dual}{Dual}} \&v) +\item +\mbox{\Hypertarget{dual_numbers_8h_a4bd6c01d6e43f564da01f1b22056d993}\label{dual_numbers_8h_a4bd6c01d6e43f564da01f1b22056d993}} +std\+::ostream \& {\bfseries operator$<$$<$} (std\+::ostream \&os, const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_ab6f6742bed07872104bb4f6642223407}\label{dual_numbers_8h_ab6f6742bed07872104bb4f6642223407}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries pow} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d, const long double \&p) +\item +\mbox{\Hypertarget{dual_numbers_8h_a485addef41a1b3955b9fc2993e51b376}\label{dual_numbers_8h_a485addef41a1b3955b9fc2993e51b376}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries root} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d, const long double \&p) +\item +\mbox{\Hypertarget{dual_numbers_8h_abb6cc335a04bddd22cc5da673eb72378}\label{dual_numbers_8h_abb6cc335a04bddd22cc5da673eb72378}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries exp} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_a201b19edf887bdc1e3a1fa7f5fd6aa8a}\label{dual_numbers_8h_a201b19edf887bdc1e3a1fa7f5fd6aa8a}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries log} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_a0aa3b51c693e3ad5156b09bb41c762c1}\label{dual_numbers_8h_a0aa3b51c693e3ad5156b09bb41c762c1}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries sin} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_a51720522ba2ebe6400829e5464ac83d5}\label{dual_numbers_8h_a51720522ba2ebe6400829e5464ac83d5}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries cos} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_acaa46dca6569d5348a542a7dd8df2996}\label{dual_numbers_8h_acaa46dca6569d5348a542a7dd8df2996}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries tan} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_ac744360314e266d4378a24295c5701a0}\label{dual_numbers_8h_ac744360314e266d4378a24295c5701a0}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries asin} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_a58dfb3b5cd7adf92b9600de6a634cf03}\label{dual_numbers_8h_a58dfb3b5cd7adf92b9600de6a634cf03}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries acos} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_aad929d60f1ee2abc0b17c87cd361139d}\label{dual_numbers_8h_aad929d60f1ee2abc0b17c87cd361139d}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries atan} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_aac6dfef617937b661461065fd4449899}\label{dual_numbers_8h_aac6dfef617937b661461065fd4449899}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries sinh} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_ab3bcd4179893314472bf166a07e93d53}\label{dual_numbers_8h_ab3bcd4179893314472bf166a07e93d53}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries cosh} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\item +\mbox{\Hypertarget{dual_numbers_8h_ae8926c8a959de76f9a1fdbd9ce81aafa}\label{dual_numbers_8h_ae8926c8a959de76f9a1fdbd9ce81aafa}} +\mbox{\hyperlink{struct_dual}{Dual}} {\bfseries tanh} (const \mbox{\hyperlink{struct_dual}{Dual}} \&d) +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Implementation of dual numbers. + +In linear algebra, the dual numbers extend the real numbers by adjoining one new element ε with the property ε$^\wedge$2 = 0 (ε is nilpotent). + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 3/\+Feb/2019. \ No newline at end of file diff --git a/docs/latex/files.tex b/docs/latex/files.tex new file mode 100644 index 0000000..69c3c19 --- /dev/null +++ b/docs/latex/files.tex @@ -0,0 +1,18 @@ +\section{File List} +Here is a list of all documented files with brief descriptions\+:\begin{DoxyCompactList} +\item\contentsline{section}{src/\mbox{\hyperlink{bbp_type_formula_8h}{bbp\+Type\+Formula.\+h}} \\*B\+PP Type formula calculation }{\pageref{bbp_type_formula_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{binom_8h}{binom.\+h}} \\*Calculate binomial coefficient }{\pageref{binom_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{brent_salamin_formula_8h}{brent\+Salamin\+Formula.\+h}} \\*Brent-\/\+Salamin Formula }{\pageref{brent_salamin_formula_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{devrandom_8h}{devrandom.\+h}} \\*Generate random numbers/strings from /dev/random }{\pageref{devrandom_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{discrete_fourier_transform_8h}{discrete\+Fourier\+Transform.\+h}} \\*Functions for D\+FT and I\+D\+FT }{\pageref{discrete_fourier_transform_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{dual_numbers_8h}{dual\+Numbers.\+h}} \\*Implementation of dual numbers }{\pageref{dual_numbers_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{fixed_point_iteration_8h}{fixed\+Point\+Iteration.\+h}} \\*Fixed point iteration }{\pageref{fixed_point_iteration_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{golden_section_search_8h}{golden\+Section\+Search.\+h}} \\*Golden Section Search }{\pageref{golden_section_search_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{integer_factorization_8h}{integer\+Factorization.\+h}} \\*Implements Pollard rho algorithm }{\pageref{integer_factorization_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{lagrange_interpolation_8h}{lagrange\+Interpolation.\+h}} \\*Lagrange Interpolation }{\pageref{lagrange_interpolation_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{lcg_8h}{lcg.\+h}} \\*Linear Congruential Generator }{\pageref{lcg_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{metropolis_hastings_8h}{metropolis\+Hastings.\+h}} \\*Metropolis-\/\+Hastings algorithm }{\pageref{metropolis_hastings_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{numerical_integration_8h}{numerical\+Integration.\+h}} \\*Numerical integration methods }{\pageref{numerical_integration_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{runge_kutta_8h}{runge\+Kutta.\+h}} \\*Runge-\/\+Kutta Order Four }{\pageref{runge_kutta_8h}}{} +\item\contentsline{section}{src/\mbox{\hyperlink{statistics_8h}{statistics.\+h}} \\*Statistics related functions }{\pageref{statistics_8h}}{} +\end{DoxyCompactList} diff --git a/docs/latex/fixed_point_iteration_8h.tex b/docs/latex/fixed_point_iteration_8h.tex new file mode 100644 index 0000000..ba6b1fa --- /dev/null +++ b/docs/latex/fixed_point_iteration_8h.tex @@ -0,0 +1,55 @@ +\hypertarget{fixed_point_iteration_8h}{}\section{src/fixed\+Point\+Iteration.h File Reference} +\label{fixed_point_iteration_8h}\index{src/fixedPointIteration.h@{src/fixedPointIteration.h}} + + +Fixed point iteration. + + +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$functional$>$}\newline +{\ttfamily \#include $<$iostream$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{fixed_point_iteration_8h_aaf9f035e8febfeea962a34a78b93f689}{fixed\+Point\+Iter}} (T p0, const T \&tol, const unsigned long \&N0, const std\+::function$<$ T(T)$>$ \&\mbox{\hyperlink{integer_factorization_8h_a04c9bfd9ad8855a08d4a860652560e76}{g}}) +\begin{DoxyCompactList}\small\item\em Find a solution to p = g(p) given an initial approximation p0. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Fixed point iteration. + +Fixed Point Iteration is a method of computing fixed points of iterated functions. We can write an equation f(x)=0 in x=g(x) form and we can find this equation’s fixed point and solve first equation. + +Algorithm 2.\+2 (Numerical Analysis, Ninth Edition, Burden, Faires) + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{fixed_point_iteration_8h_aaf9f035e8febfeea962a34a78b93f689}\label{fixed_point_iteration_8h_aaf9f035e8febfeea962a34a78b93f689}} +\index{fixedPointIteration.h@{fixedPointIteration.h}!fixedPointIter@{fixedPointIter}} +\index{fixedPointIter@{fixedPointIter}!fixedPointIteration.h@{fixedPointIteration.h}} +\subsubsection{\texorpdfstring{fixedPointIter()}{fixedPointIter()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T fixed\+Point\+Iter (\begin{DoxyParamCaption}\item[{T}]{p0, }\item[{const T \&}]{tol, }\item[{const unsigned long \&}]{N0, }\item[{const std\+::function$<$ T(T)$>$ \&}]{g }\end{DoxyParamCaption})} + + + +Find a solution to p = g(p) given an initial approximation p0. + + +\begin{DoxyParams}{Parameters} +{\em p0} & Initial approximation. \\ +\hline +{\em tol} & Tolerance. \\ +\hline +{\em N0} & Maximum number of iterations. \\ +\hline +{\em g} & The function.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Approximate solution p or message of failure.. +\end{DoxyReturn} diff --git a/docs/latex/golden_section_search_8h.tex b/docs/latex/golden_section_search_8h.tex new file mode 100644 index 0000000..385a85e --- /dev/null +++ b/docs/latex/golden_section_search_8h.tex @@ -0,0 +1,59 @@ +\hypertarget{golden_section_search_8h}{}\section{src/golden\+Section\+Search.h File Reference} +\label{golden_section_search_8h}\index{src/goldenSectionSearch.h@{src/goldenSectionSearch.h}} + + +Golden Section Search. + + +{\ttfamily \#include $<$stdio.\+h$>$}\newline +{\ttfamily \#include $<$cassert$>$}\newline +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$functional$>$}\newline +\subsection*{Classes} +\begin{DoxyCompactItemize} +\item +struct \mbox{\hyperlink{struct_result}{Result}} +\begin{DoxyCompactList}\small\item\em The struct that stores result. \end{DoxyCompactList}\end{DoxyCompactItemize} +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = long double$>$ }\\\mbox{\hyperlink{struct_result}{Result}} \mbox{\hyperlink{golden_section_search_8h_a68d217c205739ac83c123723b3bb8a78}{Golden\+Section\+Search}} (long double a, long double b, const long double \&tol, const std\+::function$<$ long double(long double)$>$ \&func) +\begin{DoxyCompactList}\small\item\em Golden Section Search. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Golden Section Search. + +The golden-\/section search is a technique for finding the extremum (minimum or maximum) of a strictly unimodal function by successively narrowing the range of values inside which the extremum is known to exist. The technique derives its name from the fact that the algorithm maintains the function values for triples of points whose distances form a golden ratio. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{golden_section_search_8h_a68d217c205739ac83c123723b3bb8a78}\label{golden_section_search_8h_a68d217c205739ac83c123723b3bb8a78}} +\index{goldenSectionSearch.h@{goldenSectionSearch.h}!GoldenSectionSearch@{GoldenSectionSearch}} +\index{GoldenSectionSearch@{GoldenSectionSearch}!goldenSectionSearch.h@{goldenSectionSearch.h}} +\subsubsection{\texorpdfstring{GoldenSectionSearch()}{GoldenSectionSearch()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +\mbox{\hyperlink{struct_result}{Result}} Golden\+Section\+Search (\begin{DoxyParamCaption}\item[{long double}]{a, }\item[{long double}]{b, }\item[{const long double \&}]{tol, }\item[{const std\+::function$<$ long double(long double)$>$ \&}]{func }\end{DoxyParamCaption})} + + + +Golden Section Search. + + +\begin{DoxyParams}{Parameters} +{\em a} & Lower bound. \\ +\hline +{\em b} & Upper bound. \\ +\hline +{\em tol} & Tolerance. \\ +\hline +{\em func} & The function.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +The interval with d-\/c$<$=tol. +\end{DoxyReturn} diff --git a/docs/latex/integer_factorization_8h.tex b/docs/latex/integer_factorization_8h.tex new file mode 100644 index 0000000..1837ca5 --- /dev/null +++ b/docs/latex/integer_factorization_8h.tex @@ -0,0 +1,106 @@ +\hypertarget{integer_factorization_8h}{}\section{src/integer\+Factorization.h File Reference} +\label{integer_factorization_8h}\index{src/integerFactorization.h@{src/integerFactorization.h}} + + +Implements Pollard rho algorithm. + + +{\ttfamily \#include $<$cmath$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T $>$ }\\T \mbox{\hyperlink{integer_factorization_8h_a04c9bfd9ad8855a08d4a860652560e76}{g}} (T x, T n) +\begin{DoxyCompactList}\small\item\em Helper function for generate a pseudo-\/random sequence. \end{DoxyCompactList}\item +{\footnotesize template$<$typename T $>$ }\\T \mbox{\hyperlink{integer_factorization_8h_a6d0c00ce731e98f3789b4f14ce95cf85}{gcd}} (T x, T y) +\begin{DoxyCompactList}\small\item\em Greatest common divisor. \end{DoxyCompactList}\item +{\footnotesize template$<$typename T $>$ }\\T \mbox{\hyperlink{integer_factorization_8h_a78298440d6bfc9f2cc7eb1dc790dc429}{rho}} (T n) +\begin{DoxyCompactList}\small\item\em Pollard rho algorithm. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Implements Pollard rho algorithm. + +Pollard\textquotesingle{}s rho algorithm is an algorithm for integer factorization. It was invented by John Pollard in 1975.\mbox{[}1\mbox{]} It uses only a small amount of space, and its expected running time is proportional to the square root of the size of the smallest prime factor of the composite number being factorized. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 26/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{integer_factorization_8h_a04c9bfd9ad8855a08d4a860652560e76}\label{integer_factorization_8h_a04c9bfd9ad8855a08d4a860652560e76}} +\index{integerFactorization.h@{integerFactorization.h}!g@{g}} +\index{g@{g}!integerFactorization.h@{integerFactorization.h}} +\subsubsection{\texorpdfstring{g()}{g()}} +{\footnotesize\ttfamily template$<$typename T $>$ \\ +T g (\begin{DoxyParamCaption}\item[{T}]{x, }\item[{T}]{n }\end{DoxyParamCaption})} + + + +Helper function for generate a pseudo-\/random sequence. + + +\begin{DoxyTemplParams}{Template Parameters} +{\em T} & A type. \\ +\hline +\end{DoxyTemplParams} + +\begin{DoxyParams}{Parameters} +{\em x} & Input. \\ +\hline +{\em n} & The number which will be factorized.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Pseudo-\/random number. +\end{DoxyReturn} +\mbox{\Hypertarget{integer_factorization_8h_a6d0c00ce731e98f3789b4f14ce95cf85}\label{integer_factorization_8h_a6d0c00ce731e98f3789b4f14ce95cf85}} +\index{integerFactorization.h@{integerFactorization.h}!gcd@{gcd}} +\index{gcd@{gcd}!integerFactorization.h@{integerFactorization.h}} +\subsubsection{\texorpdfstring{gcd()}{gcd()}} +{\footnotesize\ttfamily template$<$typename T $>$ \\ +T gcd (\begin{DoxyParamCaption}\item[{T}]{x, }\item[{T}]{y }\end{DoxyParamCaption})} + + + +Greatest common divisor. + + +\begin{DoxyTemplParams}{Template Parameters} +{\em T} & A type. \\ +\hline +\end{DoxyTemplParams} + +\begin{DoxyParams}{Parameters} +{\em x} & Number 1. \\ +\hline +{\em y} & Number 2.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +G\+CD of x and y. +\end{DoxyReturn} +\mbox{\Hypertarget{integer_factorization_8h_a78298440d6bfc9f2cc7eb1dc790dc429}\label{integer_factorization_8h_a78298440d6bfc9f2cc7eb1dc790dc429}} +\index{integerFactorization.h@{integerFactorization.h}!rho@{rho}} +\index{rho@{rho}!integerFactorization.h@{integerFactorization.h}} +\subsubsection{\texorpdfstring{rho()}{rho()}} +{\footnotesize\ttfamily template$<$typename T $>$ \\ +T rho (\begin{DoxyParamCaption}\item[{T}]{n }\end{DoxyParamCaption})} + + + +Pollard rho algorithm. + + +\begin{DoxyTemplParams}{Template Parameters} +{\em T} & A type. \\ +\hline +\end{DoxyTemplParams} + +\begin{DoxyParams}{Parameters} +{\em n} & The number which will be factorized.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +A non-\/trivial factor of n. +\end{DoxyReturn} diff --git a/docs/latex/lagrange_interpolation_8h.tex b/docs/latex/lagrange_interpolation_8h.tex new file mode 100644 index 0000000..a534b67 --- /dev/null +++ b/docs/latex/lagrange_interpolation_8h.tex @@ -0,0 +1,51 @@ +\hypertarget{lagrange_interpolation_8h}{}\section{src/lagrange\+Interpolation.h File Reference} +\label{lagrange_interpolation_8h}\index{src/lagrangeInterpolation.h@{src/lagrangeInterpolation.h}} + + +Lagrange Interpolation. + + +{\ttfamily \#include $<$cassert$>$}\newline +{\ttfamily \#include $<$functional$>$}\newline +{\ttfamily \#include $<$iostream$>$}\newline +{\ttfamily \#include $<$vector$>$}\newline +\subsection*{Classes} +\begin{DoxyCompactItemize} +\item +struct \mbox{\hyperlink{struct_data}{Data$<$ T $>$}} +\end{DoxyCompactItemize} +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T $>$ }\\std\+::function$<$ T(T)$>$ \mbox{\hyperlink{lagrange_interpolation_8h_aad726fcf5685b281362fd5b8339a7345}{lagrange\+Poly}} (const \mbox{\hyperlink{struct_data}{Data}}$<$ T $>$ \&data) +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Lagrange Interpolation. + +In numerical analysis, Lagrange polynomials are used for polynomial interpolation. For a given set of points \{\textbackslash{}displaystyle (x\+\_\+\{j\},y\+\_\+\{j\})\} with no two x\+\_\+\{j\} values equal, the Lagrange polynomial is the polynomial of lowest degree that assumes at each value x\+\_\+\{j\} the corresponding value y\+\_\+\{j\} (i.\+e. the functions coincide at each point). + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 31/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{lagrange_interpolation_8h_aad726fcf5685b281362fd5b8339a7345}\label{lagrange_interpolation_8h_aad726fcf5685b281362fd5b8339a7345}} +\index{lagrangeInterpolation.h@{lagrangeInterpolation.h}!lagrangePoly@{lagrangePoly}} +\index{lagrangePoly@{lagrangePoly}!lagrangeInterpolation.h@{lagrangeInterpolation.h}} +\subsubsection{\texorpdfstring{lagrangePoly()}{lagrangePoly()}} +{\footnotesize\ttfamily template$<$typename T $>$ \\ +std\+::function$<$T(T)$>$ lagrange\+Poly (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{struct_data}{Data}}$<$ T $>$ \&}]{data }\end{DoxyParamCaption})} + +Lagrange polynomial. + + +\begin{DoxyParams}{Parameters} +{\em data} & A data.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Lagrange interpolation polynomial. +\end{DoxyReturn} diff --git a/docs/latex/lcg_8h.tex b/docs/latex/lcg_8h.tex new file mode 100644 index 0000000..6ad100a --- /dev/null +++ b/docs/latex/lcg_8h.tex @@ -0,0 +1,56 @@ +\hypertarget{lcg_8h}{}\section{src/lcg.h File Reference} +\label{lcg_8h}\index{src/lcg.h@{src/lcg.h}} + + +Linear Congruential Generator. + + +{\ttfamily \#include $<$stdio.\+h$>$}\newline +{\ttfamily \#include $<$cassert$>$}\newline +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$vector$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = int$>$ }\\std\+::vector$<$ T $>$ \mbox{\hyperlink{lcg_8h_aedbaa5d71f32ced097260807afd850e5}{lcg}} (const int \&seed, const int \&mod, const int \&mult, const int \&incr, const int \&count) +\begin{DoxyCompactList}\small\item\em Linear Congruential Generator. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Linear Congruential Generator. + +Linear Congruential Generator is an algorithm that yields a sequence of pseudo–randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best–known pseudorandom number generator algorithms. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{lcg_8h_aedbaa5d71f32ced097260807afd850e5}\label{lcg_8h_aedbaa5d71f32ced097260807afd850e5}} +\index{lcg.h@{lcg.h}!lcg@{lcg}} +\index{lcg@{lcg}!lcg.h@{lcg.h}} +\subsubsection{\texorpdfstring{lcg()}{lcg()}} +{\footnotesize\ttfamily template$<$typename T = int$>$ \\ +std\+::vector$<$T$>$ lcg (\begin{DoxyParamCaption}\item[{const int \&}]{seed, }\item[{const int \&}]{mod, }\item[{const int \&}]{mult, }\item[{const int \&}]{incr, }\item[{const int \&}]{count }\end{DoxyParamCaption})} + + + +Linear Congruential Generator. + + +\begin{DoxyParams}{Parameters} +{\em seed} & Seed. \\ +\hline +{\em mod} & Modulus. \\ +\hline +{\em mult} & Multiplier. \\ +\hline +{\em incr} & Increment. \\ +\hline +{\em count} & Count of generated numbers.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Vector of generated numbers. +\end{DoxyReturn} diff --git a/docs/latex/metropolis_hastings_8h.tex b/docs/latex/metropolis_hastings_8h.tex new file mode 100644 index 0000000..682f1aa --- /dev/null +++ b/docs/latex/metropolis_hastings_8h.tex @@ -0,0 +1,52 @@ +\hypertarget{metropolis_hastings_8h}{}\section{src/metropolis\+Hastings.h File Reference} +\label{metropolis_hastings_8h}\index{src/metropolisHastings.h@{src/metropolisHastings.h}} + + +Metropolis-\/\+Hastings algorithm. + + +{\ttfamily \#include $<$ctime$>$}\newline +{\ttfamily \#include $<$functional$>$}\newline +{\ttfamily \#include $<$vector$>$}\newline +{\ttfamily \#include \char`\"{}statistics.\+h\char`\"{}}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = long double$>$ }\\std\+::vector$<$ T $>$ \mbox{\hyperlink{metropolis_hastings_8h_a679aa5f574c9cae53e917238746133df}{generate}} (const std\+::function$<$ T(T)$>$ \&target, const unsigned int \&count, const unsigned int \&burn\+\_\+in\+\_\+period) +\begin{DoxyCompactList}\small\item\em Metropolis-\/\+Hastings algorithm. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Metropolis-\/\+Hastings algorithm. + +Metropolis-\/\+Hastings Algorithm is a Markov chain Monte Carlo (M\+C\+MC) method for obtaining a sequence of random samples from a probability distribution from which direct sampling is difficult. This sequence can be used to approximate the distribution or to compute an integral. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{metropolis_hastings_8h_a679aa5f574c9cae53e917238746133df}\label{metropolis_hastings_8h_a679aa5f574c9cae53e917238746133df}} +\index{metropolisHastings.h@{metropolisHastings.h}!generate@{generate}} +\index{generate@{generate}!metropolisHastings.h@{metropolisHastings.h}} +\subsubsection{\texorpdfstring{generate()}{generate()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +std\+::vector$<$T$>$ generate (\begin{DoxyParamCaption}\item[{const std\+::function$<$ T(T)$>$ \&}]{target, }\item[{const unsigned int \&}]{count, }\item[{const unsigned int \&}]{burn\+\_\+in\+\_\+period }\end{DoxyParamCaption})} + + + +Metropolis-\/\+Hastings algorithm. + + +\begin{DoxyParams}{Parameters} +{\em target} & The target distribution. \\ +\hline +{\em count} & Count of generated numbers. \\ +\hline +{\em burn\+\_\+in\+\_\+period} & Burn-\/in period.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Vector of generated numbers. +\end{DoxyReturn} diff --git a/docs/latex/numerical_integration_8h.tex b/docs/latex/numerical_integration_8h.tex new file mode 100644 index 0000000..48339c9 --- /dev/null +++ b/docs/latex/numerical_integration_8h.tex @@ -0,0 +1,120 @@ +\hypertarget{numerical_integration_8h}{}\section{src/numerical\+Integration.h File Reference} +\label{numerical_integration_8h}\index{src/numericalIntegration.h@{src/numericalIntegration.h}} + + +Numerical integration methods. + + +{\ttfamily \#include $<$cassert$>$}\newline +{\ttfamily \#include $<$cstdio$>$}\newline +{\ttfamily \#include $<$functional$>$}\newline +{\ttfamily \#include $<$iostream$>$}\newline +{\ttfamily \#include $<$numeric$>$}\newline +{\ttfamily \#include \char`\"{}statistics.\+h\char`\"{}}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{numerical_integration_8h_a2a49b6efd60f3f4bd9b132455392127a}{composite\+Simpsons}} (const T \&a, const T \&b, const unsigned long \&n, const std\+::function$<$ T(T)$>$ \&func) +\begin{DoxyCompactList}\small\item\em Composite Simpson’s Integration. \end{DoxyCompactList}\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{numerical_integration_8h_a8a2700261385eec68fa80882704ea6de}{double\+Integral}} (const T \&a, const T \&b, const unsigned long \&m, const unsigned long \&n, const std\+::function$<$ T(T)$>$ \&c, const std\+::function$<$ T(T)$>$ \&d, const std\+::function$<$ T(T, T)$>$ \&func) +\begin{DoxyCompactList}\small\item\em Double Simpson’s Integration. \end{DoxyCompactList}\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{numerical_integration_8h_a032561911785237d600ba4bd287f6f05}{monte\+Carlo\+Integration}} (const T \&a, const T \&b, const unsigned long \&n, std\+::function$<$ T(T)$>$ \&func) +\begin{DoxyCompactList}\small\item\em Monte-\/\+Carlo Integration. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Numerical integration methods. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{numerical_integration_8h_a2a49b6efd60f3f4bd9b132455392127a}\label{numerical_integration_8h_a2a49b6efd60f3f4bd9b132455392127a}} +\index{numericalIntegration.h@{numericalIntegration.h}!compositeSimpsons@{compositeSimpsons}} +\index{compositeSimpsons@{compositeSimpsons}!numericalIntegration.h@{numericalIntegration.h}} +\subsubsection{\texorpdfstring{compositeSimpsons()}{compositeSimpsons()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T composite\+Simpsons (\begin{DoxyParamCaption}\item[{const T \&}]{a, }\item[{const T \&}]{b, }\item[{const unsigned long \&}]{n, }\item[{const std\+::function$<$ T(T)$>$ \&}]{func }\end{DoxyParamCaption})} + + + +Composite Simpson’s Integration. + +Composite Simpson is a method for the numerical approximation of definite integrals. + + +\begin{DoxyParams}{Parameters} +{\em a} & Endpoint. \\ +\hline +{\em b} & Endpoint. \\ +\hline +{\em n} & Iteration count. \\ +\hline +{\em func} & The function that will be integrated.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Approximation to integral. +\end{DoxyReturn} +\mbox{\Hypertarget{numerical_integration_8h_a8a2700261385eec68fa80882704ea6de}\label{numerical_integration_8h_a8a2700261385eec68fa80882704ea6de}} +\index{numericalIntegration.h@{numericalIntegration.h}!doubleIntegral@{doubleIntegral}} +\index{doubleIntegral@{doubleIntegral}!numericalIntegration.h@{numericalIntegration.h}} +\subsubsection{\texorpdfstring{doubleIntegral()}{doubleIntegral()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T double\+Integral (\begin{DoxyParamCaption}\item[{const T \&}]{a, }\item[{const T \&}]{b, }\item[{const unsigned long \&}]{m, }\item[{const unsigned long \&}]{n, }\item[{const std\+::function$<$ T(T)$>$ \&}]{c, }\item[{const std\+::function$<$ T(T)$>$ \&}]{d, }\item[{const std\+::function$<$ T(T, T)$>$ \&}]{func }\end{DoxyParamCaption})} + + + +Double Simpson’s Integration. + +Double Simpson is a method for the numerical approximation of double integrals. + + +\begin{DoxyParams}{Parameters} +{\em a} & Endpoint. \\ +\hline +{\em b} & Endpoint. \\ +\hline +{\em m} & Iteration count. \\ +\hline +{\em n} & Iteration count. \\ +\hline +{\em c} & A function. \\ +\hline +{\em d} & A function. \\ +\hline +{\em func} & The function that will be integrated.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Approximation to integral. +\end{DoxyReturn} +\mbox{\Hypertarget{numerical_integration_8h_a032561911785237d600ba4bd287f6f05}\label{numerical_integration_8h_a032561911785237d600ba4bd287f6f05}} +\index{numericalIntegration.h@{numericalIntegration.h}!monteCarloIntegration@{monteCarloIntegration}} +\index{monteCarloIntegration@{monteCarloIntegration}!numericalIntegration.h@{numericalIntegration.h}} +\subsubsection{\texorpdfstring{monteCarloIntegration()}{monteCarloIntegration()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T monte\+Carlo\+Integration (\begin{DoxyParamCaption}\item[{const T \&}]{a, }\item[{const T \&}]{b, }\item[{const unsigned long \&}]{n, }\item[{std\+::function$<$ T(T)$>$ \&}]{func }\end{DoxyParamCaption})} + + + +Monte-\/\+Carlo Integration. + +Monte-\/\+Carlo Integration is a technique for numerical integration using random numbers. It is a particular Monte Carlo method that numerically computes a definite integral. + + +\begin{DoxyParams}{Parameters} +{\em a} & Endpoint. \\ +\hline +{\em b} & Endpoint. \\ +\hline +{\em n} & Iteration count. \\ +\hline +{\em func} & The function that will be integrated.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Approximation to integral. +\end{DoxyReturn} diff --git a/docs/latex/refman.tex b/docs/latex/refman.tex new file mode 100644 index 0000000..3e41e8e --- /dev/null +++ b/docs/latex/refman.tex @@ -0,0 +1,196 @@ +\let\mypdfximage\pdfximage\def\pdfximage{\immediate\mypdfximage}\documentclass[twoside]{book} + +% Packages required by doxygen +\usepackage{fixltx2e} +\usepackage{calc} +\usepackage{doxygen} +\usepackage{graphicx} +\usepackage[utf8]{inputenc} +\usepackage{makeidx} +\usepackage{multicol} +\usepackage{multirow} +\PassOptionsToPackage{warn}{textcomp} +\usepackage{textcomp} +\usepackage[nointegrals]{wasysym} +\usepackage[table]{xcolor} +\usepackage{ifpdf,ifxetex} + +% Font selection +\usepackage[T1]{fontenc} +\usepackage[scaled=.90]{helvet} +\usepackage{courier} +\usepackage{amssymb} +\usepackage{sectsty} +\renewcommand{\familydefault}{\sfdefault} +\allsectionsfont{% + \fontseries{bc}\selectfont% + \color{darkgray}% +} +\renewcommand{\DoxyLabelFont}{% + \fontseries{bc}\selectfont% + \color{darkgray}% +} +\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}} + +% Arguments of doxygenemoji: +% 1) '::' form of the emoji, already "LaTeX"-escaped +% 2) file with the name of the emoji without the .png extension +% in case image exist use this otherwise use the '::' form +\newcommand{\doxygenemoji}[2]{% + \IfFileExists{./#2.png}{\raisebox{-0.1em}{\includegraphics[height=0.9em]{./#2.png}}}{#1}% +} +% Page & text layout +\usepackage{geometry} +\geometry{% + a4paper,% + top=2.5cm,% + bottom=2.5cm,% + left=2.5cm,% + right=2.5cm% +} +\tolerance=750 +\hfuzz=15pt +\hbadness=750 +\setlength{\emergencystretch}{15pt} +\setlength{\parindent}{0cm} +\newcommand{\doxynormalparskip}{\setlength{\parskip}{3ex plus 2ex minus 2ex}} +\newcommand{\doxytocparskip}{\setlength{\parskip}{1ex plus 0ex minus 0ex}} +\doxynormalparskip +\makeatletter +\renewcommand{\paragraph}{% + \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{% + \normalfont\normalsize\bfseries\SS@parafont% + }% +} +\renewcommand{\subparagraph}{% + \@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{% + \normalfont\normalsize\bfseries\SS@subparafont% + }% +} +\makeatother + +% Headers & footers +\usepackage{fancyhdr} +\pagestyle{fancyplain} +\fancyhead[LE]{\fancyplain{}{\bfseries\thepage}} +\fancyhead[CE]{\fancyplain{}{}} +\fancyhead[RE]{\fancyplain{}{\bfseries\leftmark}} +\fancyhead[LO]{\fancyplain{}{\bfseries\rightmark}} +\fancyhead[CO]{\fancyplain{}{}} +\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}} +\fancyfoot[LE]{\fancyplain{}{}} +\fancyfoot[CE]{\fancyplain{}{}} +\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} +\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated by Doxygen }} +\fancyfoot[CO]{\fancyplain{}{}} +\fancyfoot[RO]{\fancyplain{}{}} +\renewcommand{\footrulewidth}{0.4pt} +\renewcommand{\chaptermark}[1]{% + \markboth{#1}{}% +} +\renewcommand{\sectionmark}[1]{% + \markright{\thesection\ #1}% +} + +% Indices & bibliography +\usepackage{natbib} +\usepackage[titles]{tocloft} +\setcounter{tocdepth}{3} +\setcounter{secnumdepth}{5} +\makeindex + +\usepackage{newunicodechar} + \newunicodechar{⁻}{${}^{-}$}% Superscript minus + \newunicodechar{²}{${}^{2}$}% Superscript two + \newunicodechar{³}{${}^{3}$}% Superscript three + +% Hyperlinks (required, but should be loaded last) +\ifpdf + \usepackage[pdftex,pagebackref=true]{hyperref} +\else + \ifxetex + \usepackage[pagebackref=true]{hyperref} + \else + \usepackage[ps2pdf,pagebackref=true]{hyperref} + \fi +\fi + +\hypersetup{% + colorlinks=true,% + linkcolor=blue,% + citecolor=blue,% + unicode% +} + +% Custom commands +\newcommand{\clearemptydoublepage}{% + \newpage{\pagestyle{empty}\cleardoublepage}% +} + +\usepackage{caption} +\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top} + +\usepackage{etoc} +\etocsettocstyle{\doxytocparskip}{\doxynormalparskip} +\renewcommand{\numberline}[1]{#1~} +%===== C O N T E N T S ===== + +\begin{document} + +% Titlepage & ToC +\hypersetup{pageanchor=false, + bookmarksnumbered=true, + pdfencoding=unicode + } +\pagenumbering{alph} +\begin{titlepage} +\vspace*{7cm} +\begin{center}% +{\Large Cpp Examples }\\ +\vspace*{1cm} +{\large Generated by Doxygen 1.8.15}\\ +\end{center} +\end{titlepage} +\clearemptydoublepage +\pagenumbering{roman} +\tableofcontents +\clearemptydoublepage +\pagenumbering{arabic} +\hypersetup{pageanchor=true} + +%--- Begin generated contents --- +\chapter{Class Index} +\input{annotated} +\chapter{File Index} +\input{files} +\chapter{Class Documentation} +\input{struct_data} +\input{struct_dual} +\input{struct_result} +\chapter{File Documentation} +\input{bbp_type_formula_8h} +\input{binom_8h} +\input{brent_salamin_formula_8h} +\input{devrandom_8h} +\input{discrete_fourier_transform_8h} +\input{dual_numbers_8h} +\input{fixed_point_iteration_8h} +\input{golden_section_search_8h} +\input{integer_factorization_8h} +\input{lagrange_interpolation_8h} +\input{lcg_8h} +\input{metropolis_hastings_8h} +\input{numerical_integration_8h} +\input{runge_kutta_8h} +\input{statistics_8h} +%--- End generated contents --- + +% Index +\backmatter +\newpage +\phantomsection +\clearemptydoublepage +\addcontentsline{toc}{chapter}{\indexname} +\printindex + +\end{document} diff --git a/docs/latex/runge_kutta_8h.tex b/docs/latex/runge_kutta_8h.tex new file mode 100644 index 0000000..2dbda0d --- /dev/null +++ b/docs/latex/runge_kutta_8h.tex @@ -0,0 +1,59 @@ +\hypertarget{runge_kutta_8h}{}\section{src/runge\+Kutta.h File Reference} +\label{runge_kutta_8h}\index{src/rungeKutta.h@{src/rungeKutta.h}} + + +Runge-\/\+Kutta Order Four. + + +{\ttfamily \#include $<$stdio.\+h$>$}\newline +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$functional$>$}\newline +{\ttfamily \#include $<$iostream$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +\mbox{\Hypertarget{runge_kutta_8h_a8aa61474fe715e80f13ff7b946ac55d1}\label{runge_kutta_8h_a8aa61474fe715e80f13ff7b946ac55d1}} +void {\bfseries formatted\+Print} (long double t, long double w) +\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{runge_kutta_8h_a24a416ea1925a669f4887e06e071d562}{R\+K4}} (const T \&a, const T \&b, const unsigned int \&N, const T \&init, const std\+::function$<$ T(T, T)$>$ \&func) +\begin{DoxyCompactList}\small\item\em Runge-\/\+Kutta Order Four. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Runge-\/\+Kutta Order Four. + +Runge-\/\+Kutta methods are a family of implicit and explicit iterative methods, which include the well-\/known routine called the Euler Method, used in temporal discretization for the approximate solutions of ordinary differential equations. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{runge_kutta_8h_a24a416ea1925a669f4887e06e071d562}\label{runge_kutta_8h_a24a416ea1925a669f4887e06e071d562}} +\index{rungeKutta.h@{rungeKutta.h}!RK4@{RK4}} +\index{RK4@{RK4}!rungeKutta.h@{rungeKutta.h}} +\subsubsection{\texorpdfstring{RK4()}{RK4()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T R\+K4 (\begin{DoxyParamCaption}\item[{const T \&}]{a, }\item[{const T \&}]{b, }\item[{const unsigned int \&}]{N, }\item[{const T \&}]{init, }\item[{const std\+::function$<$ T(T, T)$>$ \&}]{func }\end{DoxyParamCaption})} + + + +Runge-\/\+Kutta Order Four. + + +\begin{DoxyParams}{Parameters} +{\em a} & Endpoint. \\ +\hline +{\em b} & Endpoint. \\ +\hline +{\em N} & Iteration count. \\ +\hline +{\em init} & Initial condition. \\ +\hline +{\em func} & A function.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +Approximation to exact solution. +\end{DoxyReturn} diff --git a/docs/latex/statistics_8h.tex b/docs/latex/statistics_8h.tex new file mode 100644 index 0000000..6115bb6 --- /dev/null +++ b/docs/latex/statistics_8h.tex @@ -0,0 +1,119 @@ +\hypertarget{statistics_8h}{}\section{src/statistics.h File Reference} +\label{statistics_8h}\index{src/statistics.h@{src/statistics.h}} + + +Statistics related functions. + + +{\ttfamily \#include $<$cmath$>$}\newline +{\ttfamily \#include $<$cstdlib$>$}\newline +{\ttfamily \#include $<$numeric$>$}\newline +{\ttfamily \#include $<$random$>$}\newline +{\ttfamily \#include $<$vector$>$}\newline +\subsection*{Functions} +\begin{DoxyCompactItemize} +\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{statistics_8h_a99282c9573327898307cbd3492de0bdc}{runif}} (const T \&a=0, const T \&b=1) +\begin{DoxyCompactList}\small\item\em Uniform number generator. \end{DoxyCompactList}\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{statistics_8h_ad96ad8747ff6dabc632d0e262c9c7bb2}{rnorm}} (const T \&mean=0, const T \&sd=1) +\begin{DoxyCompactList}\small\item\em Normal number generator with Box–\+Muller transform. \end{DoxyCompactList}\item +{\footnotesize template$<$typename T = long double$>$ }\\T \mbox{\hyperlink{statistics_8h_a4368c6ff543bcea59b8608f494f55651}{pchisq}} (const T \&stat, const unsigned int \&k) +\begin{DoxyCompactList}\small\item\em Chi-\/\+Squared distribution. \end{DoxyCompactList}\item +bool \mbox{\hyperlink{statistics_8h_a2b05c840d8c2f659d0e0985fb6cad65a}{jb\+\_\+test}} (const std\+::vector$<$ long double $>$ \&x) +\begin{DoxyCompactList}\small\item\em Jarque–\+Bera test. \end{DoxyCompactList}\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +Statistics related functions. + +\begin{DoxyAuthor}{Author} +Murat Koptur \href{mailto:mkoptur3@gmail.com}{\texttt{ mkoptur3@gmail.\+com}} +\end{DoxyAuthor} +Last updated\+: 22/\+Jan/2019. + +\subsection{Function Documentation} +\mbox{\Hypertarget{statistics_8h_a2b05c840d8c2f659d0e0985fb6cad65a}\label{statistics_8h_a2b05c840d8c2f659d0e0985fb6cad65a}} +\index{statistics.h@{statistics.h}!jb\_test@{jb\_test}} +\index{jb\_test@{jb\_test}!statistics.h@{statistics.h}} +\subsubsection{\texorpdfstring{jb\_test()}{jb\_test()}} +{\footnotesize\ttfamily bool jb\+\_\+test (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ long double $>$ \&}]{x }\end{DoxyParamCaption})} + + + +Jarque–\+Bera test. + +Jarque–\+Bera test is a goodness-\/of-\/fit test of whether sample data have the skewness and kurtosis matching a normal distribution. + + +\begin{DoxyParams}{Parameters} +{\em x} & Vector of numbers.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +A boolean which indicates that x is normally distributed or not. +\end{DoxyReturn} +\mbox{\Hypertarget{statistics_8h_a4368c6ff543bcea59b8608f494f55651}\label{statistics_8h_a4368c6ff543bcea59b8608f494f55651}} +\index{statistics.h@{statistics.h}!pchisq@{pchisq}} +\index{pchisq@{pchisq}!statistics.h@{statistics.h}} +\subsubsection{\texorpdfstring{pchisq()}{pchisq()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T pchisq (\begin{DoxyParamCaption}\item[{const T \&}]{stat, }\item[{const unsigned int \&}]{k }\end{DoxyParamCaption})} + + + +Chi-\/\+Squared distribution. + + +\begin{DoxyParams}{Parameters} +{\em stat} & Test statistic. \\ +\hline +{\em k} & Degrees of freedom.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +A probability. +\end{DoxyReturn} +\mbox{\Hypertarget{statistics_8h_ad96ad8747ff6dabc632d0e262c9c7bb2}\label{statistics_8h_ad96ad8747ff6dabc632d0e262c9c7bb2}} +\index{statistics.h@{statistics.h}!rnorm@{rnorm}} +\index{rnorm@{rnorm}!statistics.h@{statistics.h}} +\subsubsection{\texorpdfstring{rnorm()}{rnorm()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T rnorm (\begin{DoxyParamCaption}\item[{const T \&}]{mean = {\ttfamily 0}, }\item[{const T \&}]{sd = {\ttfamily 1} }\end{DoxyParamCaption})} + + + +Normal number generator with Box–\+Muller transform. + +Box–\+Muller transform is a pseudo-\/random number sampling method for generating pairs of independent, standard, normally distributed (zero expectation, unit variance) random numbers, given a source of uniformly distributed random numbers. + + +\begin{DoxyParams}{Parameters} +{\em mean} & Mean of distribution. \\ +\hline +{\em sd} & Standart deviation of distribution.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +A random number. +\end{DoxyReturn} +\mbox{\Hypertarget{statistics_8h_a99282c9573327898307cbd3492de0bdc}\label{statistics_8h_a99282c9573327898307cbd3492de0bdc}} +\index{statistics.h@{statistics.h}!runif@{runif}} +\index{runif@{runif}!statistics.h@{statistics.h}} +\subsubsection{\texorpdfstring{runif()}{runif()}} +{\footnotesize\ttfamily template$<$typename T = long double$>$ \\ +T runif (\begin{DoxyParamCaption}\item[{const T \&}]{a = {\ttfamily 0}, }\item[{const T \&}]{b = {\ttfamily 1} }\end{DoxyParamCaption})} + + + +Uniform number generator. + + +\begin{DoxyParams}{Parameters} +{\em a} & Lower bound. \\ +\hline +{\em b} & Upper bound.\\ +\hline +\end{DoxyParams} +\begin{DoxyReturn}{Returns} +A random number between \mbox{[}a, b\mbox{]}. +\end{DoxyReturn} diff --git a/docs/latex/struct_data.tex b/docs/latex/struct_data.tex new file mode 100644 index 0000000..979c0e6 --- /dev/null +++ b/docs/latex/struct_data.tex @@ -0,0 +1,35 @@ +\hypertarget{struct_data}{}\section{Data$<$ T $>$ Struct Template Reference} +\label{struct_data}\index{Data$<$ T $>$@{Data$<$ T $>$}} + + +{\ttfamily \#include $<$lagrange\+Interpolation.\+h$>$} + +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +\mbox{\Hypertarget{struct_data_a88875589ade92d5769a808de87d99966}\label{struct_data_a88875589ade92d5769a808de87d99966}} +{\bfseries Data} (std\+::vector$<$ T $>$ x, std\+::vector$<$ T $>$ y) +\end{DoxyCompactItemize} +\subsection*{Public Attributes} +\begin{DoxyCompactItemize} +\item +\mbox{\Hypertarget{struct_data_a169e63872ce770accd469a58b1e7c98b}\label{struct_data_a169e63872ce770accd469a58b1e7c98b}} +std\+::vector$<$ T $>$ {\bfseries x} +\item +\mbox{\Hypertarget{struct_data_a9b5429b1c02ecdcd67bace59b19eb952}\label{struct_data_a9b5429b1c02ecdcd67bace59b19eb952}} +std\+::vector$<$ T $>$ {\bfseries y} +\item +\mbox{\Hypertarget{struct_data_ac31fe094e02e0aaa59938dcce0189156}\label{struct_data_ac31fe094e02e0aaa59938dcce0189156}} +unsigned long {\bfseries size} +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +\subsubsection*{template$<$typename T = long double$>$\newline +struct Data$<$ T $>$} + +A struct for storing x and y values. + +The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} +\item +src/\mbox{\hyperlink{lagrange_interpolation_8h}{lagrange\+Interpolation.\+h}}\end{DoxyCompactItemize} diff --git a/docs/latex/struct_dual.tex b/docs/latex/struct_dual.tex new file mode 100644 index 0000000..330e3c0 --- /dev/null +++ b/docs/latex/struct_dual.tex @@ -0,0 +1,25 @@ +\hypertarget{struct_dual}{}\section{Dual Struct Reference} +\label{struct_dual}\index{Dual@{Dual}} +\subsection*{Public Member Functions} +\begin{DoxyCompactItemize} +\item +\mbox{\Hypertarget{struct_dual_acc8f41a481e4b8a60a8d77b64b628b87}\label{struct_dual_acc8f41a481e4b8a60a8d77b64b628b87}} +{\bfseries Dual} (const long double \&a) +\item +\mbox{\Hypertarget{struct_dual_a2bb3790feb482c6c2ac871ef1242e6ac}\label{struct_dual_a2bb3790feb482c6c2ac871ef1242e6ac}} +{\bfseries Dual} (const long double \&a, const long double \&b) +\end{DoxyCompactItemize} +\subsection*{Public Attributes} +\begin{DoxyCompactItemize} +\item +\mbox{\Hypertarget{struct_dual_a5a1ea33da03904de93907af29cdaa273}\label{struct_dual_a5a1ea33da03904de93907af29cdaa273}} +long double {\bfseries real} +\item +\mbox{\Hypertarget{struct_dual_afb4884cac1516701930c82a66674ef9e}\label{struct_dual_afb4884cac1516701930c82a66674ef9e}} +long double {\bfseries dual} +\end{DoxyCompactItemize} + + +The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} +\item +src/\mbox{\hyperlink{dual_numbers_8h}{dual\+Numbers.\+h}}\end{DoxyCompactItemize} diff --git a/docs/latex/struct_result.tex b/docs/latex/struct_result.tex new file mode 100644 index 0000000..46bee0e --- /dev/null +++ b/docs/latex/struct_result.tex @@ -0,0 +1,41 @@ +\hypertarget{struct_result}{}\section{Result Struct Reference} +\label{struct_result}\index{Result@{Result}} + + +The struct that stores result. + + + + +{\ttfamily \#include $<$golden\+Section\+Search.\+h$>$} + +\subsection*{Public Attributes} +\begin{DoxyCompactItemize} +\item +long double \mbox{\hyperlink{struct_result_ae71a2de0e642ecd81d695d3171d1c577}{a}} +\item +long double \mbox{\hyperlink{struct_result_ac790d92ce6d4b45e26415bcd904ff966}{b}} +\end{DoxyCompactItemize} + + +\subsection{Detailed Description} +The struct that stores result. + +\subsection{Member Data Documentation} +\mbox{\Hypertarget{struct_result_ae71a2de0e642ecd81d695d3171d1c577}\label{struct_result_ae71a2de0e642ecd81d695d3171d1c577}} +\index{Result@{Result}!a@{a}} +\index{a@{a}!Result@{Result}} +\subsubsection{\texorpdfstring{a}{a}} +{\footnotesize\ttfamily Result\+::a} + +Lower bound. \mbox{\Hypertarget{struct_result_ac790d92ce6d4b45e26415bcd904ff966}\label{struct_result_ac790d92ce6d4b45e26415bcd904ff966}} +\index{Result@{Result}!b@{b}} +\index{b@{b}!Result@{Result}} +\subsubsection{\texorpdfstring{b}{b}} +{\footnotesize\ttfamily Result\+::b} + +Upper bound. + +The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} +\item +src/\mbox{\hyperlink{golden_section_search_8h}{golden\+Section\+Search.\+h}}\end{DoxyCompactItemize} diff --git a/docs/lcg_8h.html b/docs/lcg_8h.html index 045cec0..54e3341 100644 --- a/docs/lcg_8h.html +++ b/docs/lcg_8h.html @@ -104,9 +104,10 @@
Result GoldenSectionSearch
- - - + + + +

Functions

std::vector< int > lcg (const int &seed, const int &mod, const int &mult, const int &incr, const int &count)
 Linear Congruential Generator. More...
 
template<typename T = int>
std::vector< T > lcg (const int &seed, const int &mod, const int &mult, const int &incr, const int &count)
 Linear Congruential Generator. More...
 

Detailed Description

Linear Congruential Generator.

@@ -114,14 +115,16 @@
Author
Murat Koptur mkopt.nosp@m.ur3@.nosp@m.gmail.nosp@m..com

Last updated: 22/Jan/2019.

Function Documentation

- -

◆ lcg()

+ +

◆ lcg()

+
+template<typename T = int>
- + diff --git a/docs/lcg_8h.js b/docs/lcg_8h.js index 44d7907..7fc18b9 100644 --- a/docs/lcg_8h.js +++ b/docs/lcg_8h.js @@ -1,4 +1,4 @@ var lcg_8h = [ - [ "lcg", "lcg_8h.html#af6d01b7bf51eb2d0133955f7c70e4179", null ] + [ "lcg", "lcg_8h.html#aedbaa5d71f32ced097260807afd850e5", null ] ]; \ No newline at end of file diff --git a/docs/lcg_8h_source.html b/docs/lcg_8h_source.html index 01537e2..51e2de8 100644 --- a/docs/lcg_8h_source.html +++ b/docs/lcg_8h_source.html @@ -90,7 +90,7 @@
lcg.h
-Go to the documentation of this file.
1 
18 #ifndef LCG_H
19 #define LCG_H
20 
21 #include <stdio.h>
22 #include <cassert>
23 #include <cmath>
24 #include <vector>
25 
38 std::vector<int> lcg(const int& seed, const int& mod, const int& mult,
39  const int& incr, const int& count);
40 
41 #endif /* LCG_H */
std::vector< int > lcg(const int &seed, const int &mod, const int &mult, const int &incr, const int &count)
Linear Congruential Generator.
Definition: lcg.cpp:32
+Go to the documentation of this file.
1 
18 #ifndef LCG_H
19 #define LCG_H
20 
21 #include <stdio.h>
22 #include <cassert>
23 #include <cmath>
24 #include <vector>
25 
38 template <typename T = int>
39 std::vector<T> lcg(const int& seed, const int& mod, const int& mult,
40  const int& incr, const int& count) {
41  assert(mod > 0);
42  assert(0 < mult < mod);
43  assert(0 <= incr < mod);
44  assert(0 <= seed < mod);
45  std::vector<T> randInts(count);
46  randInts[0] = seed;
47  for (int n = 1; n < count; n++) {
48  randInts[n] = (mult * randInts[n - 1] + incr) % mod;
49  }
50  return randInts;
51 }
52 
53 #endif /* LCG_H */
std::vector< T > lcg(const int &seed, const int &mod, const int &mult, const int &incr, const int &count)
Linear Congruential Generator.
Definition: lcg.h:39
diff --git a/docs/man/man3/Data.3 b/docs/man/man3/Data.3 new file mode 100644 index 0000000..59a9107 --- /dev/null +++ b/docs/man/man3/Data.3 @@ -0,0 +1,41 @@ +.TH "Data< T >" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Data< T > +.SH SYNOPSIS +.br +.PP +.PP +\fC#include \fP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBData\fP (std::vector< T > x, std::vector< T > y)" +.br +.in -1c +.SS "Public Attributes" + +.in +1c +.ti -1c +.RI "std::vector< T > \fBx\fP" +.br +.ti -1c +.RI "std::vector< T > \fBy\fP" +.br +.ti -1c +.RI "unsigned long \fBsize\fP" +.br +.in -1c +.SH "Detailed Description" +.PP + +.SS "template +.br +struct Data< T >" +A struct for storing x and y values\&. + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/Dual.3 b/docs/man/man3/Dual.3 new file mode 100644 index 0000000..738a416 --- /dev/null +++ b/docs/man/man3/Dual.3 @@ -0,0 +1,32 @@ +.TH "Dual" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Dual +.SH SYNOPSIS +.br +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBDual\fP (const long double &a)" +.br +.ti -1c +.RI "\fBDual\fP (const long double &a, const long double &b)" +.br +.in -1c +.SS "Public Attributes" + +.in +1c +.ti -1c +.RI "long double \fBreal\fP" +.br +.ti -1c +.RI "long double \fBdual\fP" +.br +.in -1c + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/Result.3 b/docs/man/man3/Result.3 new file mode 100644 index 0000000..127f67c --- /dev/null +++ b/docs/man/man3/Result.3 @@ -0,0 +1,34 @@ +.TH "Result" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Result \- The struct that stores result\&. + +.SH SYNOPSIS +.br +.PP +.PP +\fC#include \fP +.SS "Public Attributes" + +.in +1c +.ti -1c +.RI "long double \fBa\fP" +.br +.ti -1c +.RI "long double \fBb\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +The struct that stores result\&. +.SH "Member Data Documentation" +.PP +.SS "Result::a" +Lower bound\&. +.SS "Result::b" +Upper bound\&. + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/bbpTypeFormula.h.3 b/docs/man/man3/bbpTypeFormula.h.3 new file mode 100644 index 0000000..267574c --- /dev/null +++ b/docs/man/man3/bbpTypeFormula.h.3 @@ -0,0 +1,67 @@ +.TH "src/bbpTypeFormula.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/bbpTypeFormula.h \- BPP Type formula calculation\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template T \fBP\fP (const int &s, const int &b, const int &n, const std::vector< int > &A, const int &n_iter)" +.br +.RI "BPP Type formula calculation\&. " +.in -1c +.SH "Detailed Description" +.PP +BPP Type formula calculation\&. + +The Bailey–Borwein–Plouffe formula (BBP formula) is a spigot algorithm which is an algorithm for computing the value of a mathematical constant such as π or e which generates output digits in some base (usually 2 or a power of 2) from left to right, with limited intermediate storage\&. The name comes from the sense of the word 'spigot' for a tap or valve controlling the flow of a liquid\&. +.PP +Formula was taken from: https://bbp.carma.newcastle.edu.au/ +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template T P (const int & s, const int & b, const int & n, const std::vector< int > & A, const int & n_iter)" + +.PP +BPP Type formula calculation\&. +.PP +\fBParameters:\fP +.RS 4 +\fIs\fP An integer\&. +.br +\fIb\fP An integer\&. +.br +\fIn\fP An integer\&. +.br +\fIA\fP A sequence of integers\&. +.br +\fIn_iter\fP Iteration count\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Approximation of a number\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/binom.h.3 b/docs/man/man3/binom.h.3 new file mode 100644 index 0000000..39434c8 --- /dev/null +++ b/docs/man/man3/binom.h.3 @@ -0,0 +1,55 @@ +.TH "src/binom.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/binom.h \- Calculate binomial coefficient\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template T \fBbinomCoef\fP (const unsigned long &n, const unsigned long &k)" +.br +.RI "Calculate binomial coefficient\&. " +.in -1c +.SH "Detailed Description" +.PP +Calculate binomial coefficient\&. + + +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template T binomCoef (const unsigned long & n, const unsigned long & k)" + +.PP +Calculate binomial coefficient\&. +.PP +\fBParameters:\fP +.RS 4 +\fIn\fP An integer\&. +.br +\fIk\fP An integer\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Binomial coefficient\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/brentSalaminFormula.h.3 b/docs/man/man3/brentSalaminFormula.h.3 new file mode 100644 index 0000000..51db0a5 --- /dev/null +++ b/docs/man/man3/brentSalaminFormula.h.3 @@ -0,0 +1,60 @@ +.TH "src/brentSalaminFormula.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/brentSalaminFormula.h \- Brent-Salamin Formula\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template T \fBcalc_pi\fP (const unsigned int &n_iter)" +.br +.RI "Brent-Salamin Formula\&. " +.in -1c +.SH "Detailed Description" +.PP +Brent-Salamin Formula\&. + +The Brent-Salamin formula, also called the Gauss-Salamin formula or Salamin formula, is a formula that uses the arithmetic-geometric mean to compute pi\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 24/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template T calc_pi (const unsigned int & n_iter)" + +.PP +Brent-Salamin Formula\&. +.PP +\fBTemplate Parameters:\fP +.RS 4 +\fIT\fP Type of return value\&. Choose appropriate type for precision which you want\&. +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIn_iter\fP Iteration count\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Approximation of pi\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/devrandom.h.3 b/docs/man/man3/devrandom.h.3 new file mode 100644 index 0000000..a627c9b --- /dev/null +++ b/docs/man/man3/devrandom.h.3 @@ -0,0 +1,57 @@ +.TH "src/devrandom.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/devrandom.h \- Generate random numbers/strings from /dev/random\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template T \fBdevrandom\fP ()" +.br +.RI "A function template which takes a type as argument and returns an random element of that type\&. " +.in -1c +.SH "Detailed Description" +.PP +Generate random numbers/strings from /dev/random\&. + +/dev/random is special file that serve as pseudorandom number generator\&. They allow access to environmental noise collected from device drivers and other sources\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template T devrandom ()" + +.PP +A function template which takes a type as argument and returns an random element of that type\&. +.PP +\fBParameters:\fP +.RS 4 +\fIT\fP A type\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Random element\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/discreteFourierTransform.h.3 b/docs/man/man3/discreteFourierTransform.h.3 new file mode 100644 index 0000000..2dd13c3 --- /dev/null +++ b/docs/man/man3/discreteFourierTransform.h.3 @@ -0,0 +1,89 @@ +.TH "src/discreteFourierTransform.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/discreteFourierTransform.h \- Functions for DFT and IDFT\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Typedefs" + +.in +1c +.ti -1c +.RI "template using \fBComplex\fP = std::complex< T >" +.br +.ti -1c +.RI "template using \fBCVec\fP = std::vector< std::complex< T > >" +.br +.in -1c +.SS "Functions" + +.in +1c +.ti -1c +.RI "\fBCVec\fP \fBdft\fP (const \fBCVec\fP<> &input)" +.br +.ti -1c +.RI "\fBCVec\fP \fBidft\fP (const \fBCVec\fP<> &input)" +.br +.in -1c +.SH "Detailed Description" +.PP +Functions for DFT and IDFT\&. + +In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex-valued function of frequency\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 2/Feb/2019\&. +.SH "Typedef Documentation" +.PP +.SS "template using \fBComplex\fP = std::complex" +A type for complex numbers\&. +.SS "template using \fBCVec\fP = std::vector >" +A type for array of complex numbers\&. +.SH "Function Documentation" +.PP +.SS "\fBCVec\fP dft (const \fBCVec\fP<> & input)" +Calculate DFT for given input\&. +.PP +\fBParameters:\fP +.RS 4 +\fIinput\fP Vector of complex numbers\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +DFT\&. +.RE +.PP + +.SS "\fBCVec\fP idft (const \fBCVec\fP<> & input)" +Calculate IDFT for given input\&. +.PP +\fBParameters:\fP +.RS 4 +\fIinput\fP Vector of complex numbers\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +IDFT\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/dualNumbers.h.3 b/docs/man/man3/dualNumbers.h.3 new file mode 100644 index 0000000..30c0cef --- /dev/null +++ b/docs/man/man3/dualNumbers.h.3 @@ -0,0 +1,94 @@ +.TH "src/dualNumbers.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/dualNumbers.h \- Implementation of dual numbers\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Classes" + +.in +1c +.ti -1c +.RI "struct \fBDual\fP" +.br +.in -1c +.SS "Functions" + +.in +1c +.ti -1c +.RI "\fBDual\fP \fBoperator+\fP (const \fBDual\fP &u, const \fBDual\fP &v)" +.br +.ti -1c +.RI "\fBDual\fP \fBoperator\-\fP (const \fBDual\fP &u, const \fBDual\fP &v)" +.br +.ti -1c +.RI "\fBDual\fP \fBoperator *\fP (const \fBDual\fP &u, const \fBDual\fP &v)" +.br +.ti -1c +.RI "\fBDual\fP \fBoperator/\fP (const \fBDual\fP &u, const \fBDual\fP &v)" +.br +.ti -1c +.RI "std::ostream & \fBoperator<<\fP (std::ostream &os, const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBpow\fP (const \fBDual\fP &d, const long double &p)" +.br +.ti -1c +.RI "\fBDual\fP \fBroot\fP (const \fBDual\fP &d, const long double &p)" +.br +.ti -1c +.RI "\fBDual\fP \fBexp\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBlog\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBsin\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBcos\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBtan\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBasin\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBacos\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBatan\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBsinh\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBcosh\fP (const \fBDual\fP &d)" +.br +.ti -1c +.RI "\fBDual\fP \fBtanh\fP (const \fBDual\fP &d)" +.br +.in -1c +.SH "Detailed Description" +.PP +Implementation of dual numbers\&. + +In linear algebra, the dual numbers extend the real numbers by adjoining one new element ε with the property ε^2 = 0 (ε is nilpotent)\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 3/Feb/2019\&. +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/fixedPointIteration.h.3 b/docs/man/man3/fixedPointIteration.h.3 new file mode 100644 index 0000000..25aa433 --- /dev/null +++ b/docs/man/man3/fixedPointIteration.h.3 @@ -0,0 +1,65 @@ +.TH "src/fixedPointIteration.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/fixedPointIteration.h \- Fixed point iteration\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template T \fBfixedPointIter\fP (T p0, const T &tol, const unsigned long &N0, const std::function< T(T)> &\fBg\fP)" +.br +.RI "Find a solution to p = g(p) given an initial approximation p0\&. " +.in -1c +.SH "Detailed Description" +.PP +Fixed point iteration\&. + +Fixed Point Iteration is a method of computing fixed points of iterated functions\&. We can write an equation f(x)=0 in x=g(x) form and we can find this equation’s fixed point and solve first equation\&. +.PP +Algorithm 2\&.2 (Numerical Analysis, Ninth Edition, Burden, Faires) +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template T fixedPointIter (T p0, const T & tol, const unsigned long & N0, const std::function< T(T)> & g)" + +.PP +Find a solution to p = g(p) given an initial approximation p0\&. +.PP +\fBParameters:\fP +.RS 4 +\fIp0\fP Initial approximation\&. +.br +\fItol\fP Tolerance\&. +.br +\fIN0\fP Maximum number of iterations\&. +.br +\fIg\fP The function\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Approximate solution p or message of failure\&.\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/goldenSectionSearch.h.3 b/docs/man/man3/goldenSectionSearch.h.3 new file mode 100644 index 0000000..17af8ca --- /dev/null +++ b/docs/man/man3/goldenSectionSearch.h.3 @@ -0,0 +1,73 @@ +.TH "src/goldenSectionSearch.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/goldenSectionSearch.h \- Golden Section Search\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Classes" + +.in +1c +.ti -1c +.RI "struct \fBResult\fP" +.br +.RI "The struct that stores result\&. " +.in -1c +.SS "Functions" + +.in +1c +.ti -1c +.RI "template \fBResult\fP \fBGoldenSectionSearch\fP (long double a, long double b, const long double &tol, const std::function< long double(long double)> &func)" +.br +.RI "Golden Section Search\&. " +.in -1c +.SH "Detailed Description" +.PP +Golden Section Search\&. + +The golden-section search is a technique for finding the extremum (minimum or maximum) of a strictly unimodal function by successively narrowing the range of values inside which the extremum is known to exist\&. The technique derives its name from the fact that the algorithm maintains the function values for triples of points whose distances form a golden ratio\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template \fBResult\fP GoldenSectionSearch (long double a, long double b, const long double & tol, const std::function< long double(long double)> & func)" + +.PP +Golden Section Search\&. +.PP +\fBParameters:\fP +.RS 4 +\fIa\fP Lower bound\&. +.br +\fIb\fP Upper bound\&. +.br +\fItol\fP Tolerance\&. +.br +\fIfunc\fP The function\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +The interval with d-c<=tol\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/integerFactorization.h.3 b/docs/man/man3/integerFactorization.h.3 new file mode 100644 index 0000000..269c6a9 --- /dev/null +++ b/docs/man/man3/integerFactorization.h.3 @@ -0,0 +1,112 @@ +.TH "src/integerFactorization.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/integerFactorization.h \- Implements Pollard rho algorithm\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template T \fBg\fP (T x, T n)" +.br +.RI "Helper function for generate a pseudo-random sequence\&. " +.ti -1c +.RI "template T \fBgcd\fP (T x, T y)" +.br +.RI "Greatest common divisor\&. " +.ti -1c +.RI "template T \fBrho\fP (T n)" +.br +.RI "Pollard rho algorithm\&. " +.in -1c +.SH "Detailed Description" +.PP +Implements Pollard rho algorithm\&. + +Pollard's rho algorithm is an algorithm for integer factorization\&. It was invented by John Pollard in 1975\&.[1] It uses only a small amount of space, and its expected running time is proportional to the square root of the size of the smallest prime factor of the composite number being factorized\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 26/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template T g (T x, T n)" + +.PP +Helper function for generate a pseudo-random sequence\&. +.PP +\fBTemplate Parameters:\fP +.RS 4 +\fIT\fP A type\&. +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIx\fP Input\&. +.br +\fIn\fP The number which will be factorized\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Pseudo-random number\&. +.RE +.PP + +.SS "template T gcd (T x, T y)" + +.PP +Greatest common divisor\&. +.PP +\fBTemplate Parameters:\fP +.RS 4 +\fIT\fP A type\&. +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIx\fP Number 1\&. +.br +\fIy\fP Number 2\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +GCD of x and y\&. +.RE +.PP + +.SS "template T rho (T n)" + +.PP +Pollard rho algorithm\&. +.PP +\fBTemplate Parameters:\fP +.RS 4 +\fIT\fP A type\&. +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIn\fP The number which will be factorized\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +A non-trivial factor of n\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/lagrangeInterpolation.h.3 b/docs/man/man3/lagrangeInterpolation.h.3 new file mode 100644 index 0000000..1952a3a --- /dev/null +++ b/docs/man/man3/lagrangeInterpolation.h.3 @@ -0,0 +1,63 @@ +.TH "src/lagrangeInterpolation.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/lagrangeInterpolation.h \- Lagrange Interpolation\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Classes" + +.in +1c +.ti -1c +.RI "struct \fBData< T >\fP" +.br +.in -1c +.SS "Functions" + +.in +1c +.ti -1c +.RI "template std::function< T(T)> \fBlagrangePoly\fP (const \fBData\fP< T > &data)" +.br +.in -1c +.SH "Detailed Description" +.PP +Lagrange Interpolation\&. + +In numerical analysis, Lagrange polynomials are used for polynomial interpolation\&. For a given set of points {\\displaystyle (x_{j},y_{j})} with no two x_{j} values equal, the Lagrange polynomial is the polynomial of lowest degree that assumes at each value x_{j} the corresponding value y_{j} (i\&.e\&. the functions coincide at each point)\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 31/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template std::function lagrangePoly (const \fBData\fP< T > & data)" +Lagrange polynomial\&. +.PP +\fBParameters:\fP +.RS 4 +\fIdata\fP A data\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Lagrange interpolation polynomial\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/lcg.h.3 b/docs/man/man3/lcg.h.3 new file mode 100644 index 0000000..54f7ac1 --- /dev/null +++ b/docs/man/man3/lcg.h.3 @@ -0,0 +1,67 @@ +.TH "src/lcg.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/lcg.h \- Linear Congruential Generator\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template std::vector< T > \fBlcg\fP (const int &seed, const int &mod, const int &mult, const int &incr, const int &count)" +.br +.RI "Linear Congruential Generator\&. " +.in -1c +.SH "Detailed Description" +.PP +Linear Congruential Generator\&. + +Linear Congruential Generator is an algorithm that yields a sequence of pseudo–randomized numbers calculated with a discontinuous piecewise linear equation\&. The method represents one of the oldest and best–known pseudorandom number generator algorithms\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template std::vector lcg (const int & seed, const int & mod, const int & mult, const int & incr, const int & count)" + +.PP +Linear Congruential Generator\&. +.PP +\fBParameters:\fP +.RS 4 +\fIseed\fP Seed\&. +.br +\fImod\fP Modulus\&. +.br +\fImult\fP Multiplier\&. +.br +\fIincr\fP Increment\&. +.br +\fIcount\fP Count of generated numbers\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Vector of generated numbers\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/metropolisHastings.h.3 b/docs/man/man3/metropolisHastings.h.3 new file mode 100644 index 0000000..ed84805 --- /dev/null +++ b/docs/man/man3/metropolisHastings.h.3 @@ -0,0 +1,63 @@ +.TH "src/metropolisHastings.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/metropolisHastings.h \- Metropolis-Hastings algorithm\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include 'statistics\&.h'\fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template std::vector< T > \fBgenerate\fP (const std::function< T(T)> &target, const unsigned int &count, const unsigned int &burn_in_period)" +.br +.RI "Metropolis-Hastings algorithm\&. " +.in -1c +.SH "Detailed Description" +.PP +Metropolis-Hastings algorithm\&. + +Metropolis-Hastings Algorithm is a Markov chain Monte Carlo (MCMC) method for obtaining a sequence of random samples from a probability distribution from which direct sampling is difficult\&. This sequence can be used to approximate the distribution or to compute an integral\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template std::vector generate (const std::function< T(T)> & target, const unsigned int & count, const unsigned int & burn_in_period)" + +.PP +Metropolis-Hastings algorithm\&. +.PP +\fBParameters:\fP +.RS 4 +\fItarget\fP The target distribution\&. +.br +\fIcount\fP Count of generated numbers\&. +.br +\fIburn_in_period\fP Burn-in period\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Vector of generated numbers\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/numericalIntegration.h.3 b/docs/man/man3/numericalIntegration.h.3 new file mode 100644 index 0000000..3280eda --- /dev/null +++ b/docs/man/man3/numericalIntegration.h.3 @@ -0,0 +1,127 @@ +.TH "src/numericalIntegration.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/numericalIntegration.h \- Numerical integration methods\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include 'statistics\&.h'\fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template T \fBcompositeSimpsons\fP (const T &a, const T &b, const unsigned long &n, const std::function< T(T)> &func)" +.br +.RI "Composite Simpson’s Integration\&. " +.ti -1c +.RI "template T \fBdoubleIntegral\fP (const T &a, const T &b, const unsigned long &m, const unsigned long &n, const std::function< T(T)> &c, const std::function< T(T)> &d, const std::function< T(T, T)> &func)" +.br +.RI "Double Simpson’s Integration\&. " +.ti -1c +.RI "template T \fBmonteCarloIntegration\fP (const T &a, const T &b, const unsigned long &n, std::function< T(T)> &func)" +.br +.RI "Monte-Carlo Integration\&. " +.in -1c +.SH "Detailed Description" +.PP +Numerical integration methods\&. + + +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template T compositeSimpsons (const T & a, const T & b, const unsigned long & n, const std::function< T(T)> & func)" + +.PP +Composite Simpson’s Integration\&. Composite Simpson is a method for the numerical approximation of definite integrals\&. +.PP +\fBParameters:\fP +.RS 4 +\fIa\fP Endpoint\&. +.br +\fIb\fP Endpoint\&. +.br +\fIn\fP Iteration count\&. +.br +\fIfunc\fP The function that will be integrated\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Approximation to integral\&. +.RE +.PP + +.SS "template T doubleIntegral (const T & a, const T & b, const unsigned long & m, const unsigned long & n, const std::function< T(T)> & c, const std::function< T(T)> & d, const std::function< T(T, T)> & func)" + +.PP +Double Simpson’s Integration\&. Double Simpson is a method for the numerical approximation of double integrals\&. +.PP +\fBParameters:\fP +.RS 4 +\fIa\fP Endpoint\&. +.br +\fIb\fP Endpoint\&. +.br +\fIm\fP Iteration count\&. +.br +\fIn\fP Iteration count\&. +.br +\fIc\fP A function\&. +.br +\fId\fP A function\&. +.br +\fIfunc\fP The function that will be integrated\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Approximation to integral\&. +.RE +.PP + +.SS "template T monteCarloIntegration (const T & a, const T & b, const unsigned long & n, std::function< T(T)> & func)" + +.PP +Monte-Carlo Integration\&. Monte-Carlo Integration is a technique for numerical integration using random numbers\&. It is a particular Monte Carlo method that numerically computes a definite integral\&. +.PP +\fBParameters:\fP +.RS 4 +\fIa\fP Endpoint\&. +.br +\fIb\fP Endpoint\&. +.br +\fIn\fP Iteration count\&. +.br +\fIfunc\fP The function that will be integrated\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Approximation to integral\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/rungeKutta.h.3 b/docs/man/man3/rungeKutta.h.3 new file mode 100644 index 0000000..3cadddd --- /dev/null +++ b/docs/man/man3/rungeKutta.h.3 @@ -0,0 +1,70 @@ +.TH "src/rungeKutta.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/rungeKutta.h \- Runge-Kutta Order Four\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "void \fBformattedPrint\fP (long double t, long double w)" +.br +.ti -1c +.RI "template T \fBRK4\fP (const T &a, const T &b, const unsigned int &N, const T &init, const std::function< T(T, T)> &func)" +.br +.RI "Runge-Kutta Order Four\&. " +.in -1c +.SH "Detailed Description" +.PP +Runge-Kutta Order Four\&. + +Runge-Kutta methods are a family of implicit and explicit iterative methods, which include the well-known routine called the Euler Method, used in temporal discretization for the approximate solutions of ordinary differential equations\&. +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "template T RK4 (const T & a, const T & b, const unsigned int & N, const T & init, const std::function< T(T, T)> & func)" + +.PP +Runge-Kutta Order Four\&. +.PP +\fBParameters:\fP +.RS 4 +\fIa\fP Endpoint\&. +.br +\fIb\fP Endpoint\&. +.br +\fIN\fP Iteration count\&. +.br +\fIinit\fP Initial condition\&. +.br +\fIfunc\fP A function\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +Approximation to exact solution\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/man/man3/statistics.h.3 b/docs/man/man3/statistics.h.3 new file mode 100644 index 0000000..79b6c09 --- /dev/null +++ b/docs/man/man3/statistics.h.3 @@ -0,0 +1,127 @@ +.TH "src/statistics.h" 3 "Sun Oct 13 2019" "Cpp Examples" \" -*- nroff -*- +.ad l +.nh +.SH NAME +src/statistics.h \- Statistics related functions\&. + +.SH SYNOPSIS +.br +.PP +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br +\fC#include \fP +.br + +.SS "Functions" + +.in +1c +.ti -1c +.RI "template T \fBrunif\fP (const T &a=0, const T &b=1)" +.br +.RI "Uniform number generator\&. " +.ti -1c +.RI "template T \fBrnorm\fP (const T &mean=0, const T &sd=1)" +.br +.RI "Normal number generator with Box–Muller transform\&. " +.ti -1c +.RI "template T \fBpchisq\fP (const T &stat, const unsigned int &k)" +.br +.RI "Chi-Squared distribution\&. " +.ti -1c +.RI "bool \fBjb_test\fP (const std::vector< long double > &x)" +.br +.RI "Jarque–Bera test\&. " +.in -1c +.SH "Detailed Description" +.PP +Statistics related functions\&. + + +.PP +\fBAuthor:\fP +.RS 4 +Murat Koptur mkoptur3@gmail.com +.RE +.PP +Last updated: 22/Jan/2019\&. +.SH "Function Documentation" +.PP +.SS "bool jb_test (const std::vector< long double > & x)" + +.PP +Jarque–Bera test\&. Jarque–Bera test is a goodness-of-fit test of whether sample data have the skewness and kurtosis matching a normal distribution\&. +.PP +\fBParameters:\fP +.RS 4 +\fIx\fP Vector of numbers\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +A boolean which indicates that x is normally distributed or not\&. +.RE +.PP + +.SS "template T pchisq (const T & stat, const unsigned int & k)" + +.PP +Chi-Squared distribution\&. +.PP +\fBParameters:\fP +.RS 4 +\fIstat\fP Test statistic\&. +.br +\fIk\fP Degrees of freedom\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +A probability\&. +.RE +.PP + +.SS "template T rnorm (const T & mean = \fC0\fP, const T & sd = \fC1\fP)" + +.PP +Normal number generator with Box–Muller transform\&. Box–Muller transform is a pseudo-random number sampling method for generating pairs of independent, standard, normally distributed (zero expectation, unit variance) random numbers, given a source of uniformly distributed random numbers\&. +.PP +\fBParameters:\fP +.RS 4 +\fImean\fP Mean of distribution\&. +.br +\fIsd\fP Standart deviation of distribution\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +A random number\&. +.RE +.PP + +.SS "template T runif (const T & a = \fC0\fP, const T & b = \fC1\fP)" + +.PP +Uniform number generator\&. +.PP +\fBParameters:\fP +.RS 4 +\fIa\fP Lower bound\&. +.br +\fIb\fP Upper bound\&. +.RE +.PP +\fBReturns:\fP +.RS 4 +A random number between [a, b]\&. +.RE +.PP + +.SH "Author" +.PP +Generated automatically by Doxygen for Cpp Examples from the source code\&. diff --git a/docs/menudata.js b/docs/menudata.js index 114c275..e35e48d 100644 --- a/docs/menudata.js +++ b/docs/menudata.js @@ -32,28 +32,6 @@ var menudata={children:[ {text:"Files",url:"files.html",children:[ {text:"File List",url:"files.html"}, {text:"File Members",url:"globals.html",children:[ -{text:"All",url:"globals.html",children:[ -{text:"b",url:"globals.html#index_b"}, -{text:"c",url:"globals.html#index_c"}, -{text:"d",url:"globals.html#index_d"}, -{text:"f",url:"globals.html#index_f"}, -{text:"g",url:"globals.html#index_g"}, -{text:"i",url:"globals.html#index_i"}, -{text:"j",url:"globals.html#index_j"}, -{text:"l",url:"globals.html#index_l"}, -{text:"m",url:"globals.html#index_m"}, -{text:"p",url:"globals.html#index_p"}, -{text:"r",url:"globals.html#index_r"}]}, -{text:"Functions",url:"globals_func.html",children:[ -{text:"b",url:"globals_func.html#index_b"}, -{text:"c",url:"globals_func.html#index_c"}, -{text:"d",url:"globals_func.html#index_d"}, -{text:"f",url:"globals_func.html#index_f"}, -{text:"g",url:"globals_func.html#index_g"}, -{text:"i",url:"globals_func.html#index_i"}, -{text:"j",url:"globals_func.html#index_j"}, -{text:"l",url:"globals_func.html#index_l"}, -{text:"m",url:"globals_func.html#index_m"}, -{text:"p",url:"globals_func.html#index_p"}, -{text:"r",url:"globals_func.html#index_r"}]}, +{text:"All",url:"globals.html"}, +{text:"Functions",url:"globals_func.html"}, {text:"Typedefs",url:"globals_type.html"}]}]}]} diff --git a/docs/metropolis_hastings_8h.html b/docs/metropolis_hastings_8h.html index 4ab32d6..762cd21 100644 --- a/docs/metropolis_hastings_8h.html +++ b/docs/metropolis_hastings_8h.html @@ -98,15 +98,16 @@
#include <ctime>
#include <functional>
#include <vector>
-#include "../src/statistics.h"
+#include "statistics.h"

Go to the source code of this file.

std::vector<int> lcg std::vector<T> lcg ( const int &  seed,
- - - + + + +

Functions

std::vector< long double > generate (const std::function< long double(long double)> &target, const unsigned int &count, const unsigned int &burn_in_period)
 Metropolis-Hastings algorithm. More...
 
template<typename T = long double>
std::vector< T > generate (const std::function< T(T)> &target, const unsigned int &count, const unsigned int &burn_in_period)
 Metropolis-Hastings algorithm. More...
 

Detailed Description

Metropolis-Hastings algorithm.

@@ -114,16 +115,18 @@
Author
Murat Koptur mkopt.nosp@m.ur3@.nosp@m.gmail.nosp@m..com

Last updated: 22/Jan/2019.

Function Documentation

- -

◆ generate()

+ +

◆ generate()

+
+template<typename T = long double>
- + - + diff --git a/docs/metropolis_hastings_8h.js b/docs/metropolis_hastings_8h.js index 270ad2b..26b06d2 100644 --- a/docs/metropolis_hastings_8h.js +++ b/docs/metropolis_hastings_8h.js @@ -1,4 +1,4 @@ var metropolis_hastings_8h = [ - [ "generate", "metropolis_hastings_8h.html#ad3101184c27d8806759d0823af13489b", null ] + [ "generate", "metropolis_hastings_8h.html#a679aa5f574c9cae53e917238746133df", null ] ]; \ No newline at end of file diff --git a/docs/metropolis_hastings_8h_source.html b/docs/metropolis_hastings_8h_source.html index 9ca3e33..a99cfd4 100644 --- a/docs/metropolis_hastings_8h_source.html +++ b/docs/metropolis_hastings_8h_source.html @@ -90,7 +90,10 @@
metropolisHastings.h
-Go to the documentation of this file.
1 
18 #ifndef METROPOLISHASTINGS_H
19 #define METROPOLISHASTINGS_H
20 
21 #include <ctime>
22 #include <functional>
23 #include <vector>
24 #include "../src/statistics.h"
25 
36 std::vector<long double> generate(
37  const std::function<long double(long double)> &target,
38  const unsigned int &count, const unsigned int &burn_in_period);
39 
40 #endif // METROPOLISHASTINGS_H
std::vector< long double > generate(const std::function< long double(long double)> &target, const unsigned int &count, const unsigned int &burn_in_period)
Metropolis-Hastings algorithm.
Definition: metropolisHastings.cpp:30
+Go to the documentation of this file.
1 
18 #ifndef METROPOLISHASTINGS_H
19 #define METROPOLISHASTINGS_H
20 
21 #include <ctime>
22 #include <functional>
23 #include <vector>
24 #include "statistics.h"
25 
36 template <typename T = long double>
37 std::vector<T> generate(const std::function<T(T)> &target,
38  const unsigned int &count,
39  const unsigned int &burn_in_period) {
40  std::srand(std::clock());
41 
42  std::vector<T> x(count + burn_in_period, 0);
43  x[0] = 1;
44 
45  for (auto i = 1; i < count + burn_in_period; i++) {
46  auto current_x = x[i - 1];
47  auto proposed_x = current_x + rnorm();
48  auto A = target(proposed_x) / target(current_x);
49  if (runif() < A) {
50  x[i] = proposed_x;
51  } else {
52  x[i] = current_x;
53  }
54  }
55  x.erase(x.begin(), x.begin() + burn_in_period);
56 
57  return x;
58 }
59 
60 #endif // METROPOLISHASTINGS_H
Statistics related functions.
+
T rnorm(const T &mean=0, const T &sd=1)
Normal number generator with Box–Muller transform.
Definition: statistics.h:51
+
std::vector< T > generate(const std::function< T(T)> &target, const unsigned int &count, const unsigned int &burn_in_period)
Metropolis-Hastings algorithm.
Definition: metropolisHastings.h:37
+
T runif(const T &a=0, const T &b=1)
Uniform number generator.
Definition: statistics.h:31
diff --git a/docs/navtreedata.js b/docs/navtreedata.js index 84c24d0..fcff2e0 100644 --- a/docs/navtreedata.js +++ b/docs/navtreedata.js @@ -45,7 +45,7 @@ var NAVTREE = var NAVTREEINDEX = [ -"_numerical_integration_8cpp.html" +"annotated.html" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/docs/navtreeindex0.js b/docs/navtreeindex0.js index d2f14e8..6170fcc 100644 --- a/docs/navtreeindex0.js +++ b/docs/navtreeindex0.js @@ -1,9 +1,5 @@ var NAVTREEINDEX0 = { -"_numerical_integration_8cpp.html":[1,0,0,15], -"_numerical_integration_8cpp.html#a017cb13f34621723a92a789d14565f83":[1,0,0,15,2], -"_numerical_integration_8cpp.html#a2c0b0418fa5b1481669d937b005c92b6":[1,0,0,15,1], -"_numerical_integration_8cpp.html#aa6efda2fcf775fc079c9c4fc809b035e":[1,0,0,15,0], "annotated.html":[0,0], "bbp_type_formula_8h.html":[1,0,0,0], "bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50":[1,0,0,0,0], @@ -54,52 +50,40 @@ var NAVTREEINDEX0 = "globals.html":[1,1,0], "globals_func.html":[1,1,1], "globals_type.html":[1,1,2], -"golden_section_search_8cpp.html":[1,0,0,7], -"golden_section_search_8cpp.html#a92b3f1ee0a763faf7e75bf4169ee9de3":[1,0,0,7,0], -"golden_section_search_8h.html":[1,0,0,8], -"golden_section_search_8h.html#a92b3f1ee0a763faf7e75bf4169ee9de3":[1,0,0,8,1], -"golden_section_search_8h_source.html":[1,0,0,8], +"golden_section_search_8h.html":[1,0,0,7], +"golden_section_search_8h.html#a68d217c205739ac83c123723b3bb8a78":[1,0,0,7,1], +"golden_section_search_8h_source.html":[1,0,0,7], "index.html":[], -"integer_factorization_8h.html":[1,0,0,9], -"integer_factorization_8h.html#a04c9bfd9ad8855a08d4a860652560e76":[1,0,0,9,0], -"integer_factorization_8h.html#a6d0c00ce731e98f3789b4f14ce95cf85":[1,0,0,9,1], -"integer_factorization_8h.html#a78298440d6bfc9f2cc7eb1dc790dc429":[1,0,0,9,2], -"integer_factorization_8h_source.html":[1,0,0,9], -"lagrange_interpolation_8h.html":[1,0,0,10], -"lagrange_interpolation_8h.html#aad726fcf5685b281362fd5b8339a7345":[1,0,0,10,1], -"lagrange_interpolation_8h_source.html":[1,0,0,10], -"lcg_8cpp.html":[1,0,0,11], -"lcg_8cpp.html#af6d01b7bf51eb2d0133955f7c70e4179":[1,0,0,11,0], -"lcg_8h.html":[1,0,0,12], -"lcg_8h.html#af6d01b7bf51eb2d0133955f7c70e4179":[1,0,0,12,0], -"lcg_8h_source.html":[1,0,0,12], -"metropolis_hastings_8cpp.html":[1,0,0,13], -"metropolis_hastings_8cpp.html#ad3101184c27d8806759d0823af13489b":[1,0,0,13,0], -"metropolis_hastings_8h.html":[1,0,0,14], -"metropolis_hastings_8h.html#ad3101184c27d8806759d0823af13489b":[1,0,0,14,0], -"metropolis_hastings_8h_source.html":[1,0,0,14], -"numerical_integration_8h.html":[1,0,0,16], -"numerical_integration_8h.html#a017cb13f34621723a92a789d14565f83":[1,0,0,16,2], -"numerical_integration_8h.html#a2c0b0418fa5b1481669d937b005c92b6":[1,0,0,16,1], -"numerical_integration_8h.html#aa6efda2fcf775fc079c9c4fc809b035e":[1,0,0,16,0], -"numerical_integration_8h_source.html":[1,0,0,16], +"integer_factorization_8h.html":[1,0,0,8], +"integer_factorization_8h.html#a04c9bfd9ad8855a08d4a860652560e76":[1,0,0,8,0], +"integer_factorization_8h.html#a6d0c00ce731e98f3789b4f14ce95cf85":[1,0,0,8,1], +"integer_factorization_8h.html#a78298440d6bfc9f2cc7eb1dc790dc429":[1,0,0,8,2], +"integer_factorization_8h_source.html":[1,0,0,8], +"lagrange_interpolation_8h.html":[1,0,0,9], +"lagrange_interpolation_8h.html#aad726fcf5685b281362fd5b8339a7345":[1,0,0,9,1], +"lagrange_interpolation_8h_source.html":[1,0,0,9], +"lcg_8h.html":[1,0,0,10], +"lcg_8h.html#aedbaa5d71f32ced097260807afd850e5":[1,0,0,10,0], +"lcg_8h_source.html":[1,0,0,10], +"metropolis_hastings_8h.html":[1,0,0,11], +"metropolis_hastings_8h.html#a679aa5f574c9cae53e917238746133df":[1,0,0,11,0], +"metropolis_hastings_8h_source.html":[1,0,0,11], +"numerical_integration_8h.html":[1,0,0,12], +"numerical_integration_8h.html#a032561911785237d600ba4bd287f6f05":[1,0,0,12,2], +"numerical_integration_8h.html#a2a49b6efd60f3f4bd9b132455392127a":[1,0,0,12,0], +"numerical_integration_8h.html#a8a2700261385eec68fa80882704ea6de":[1,0,0,12,1], +"numerical_integration_8h_source.html":[1,0,0,12], "pages.html":[], -"runge_kutta_8cpp.html":[1,0,0,17], -"runge_kutta_8cpp.html#a8aa61474fe715e80f13ff7b946ac55d1":[1,0,0,17,0], -"runge_kutta_8cpp.html#a9255c9662ed42d1740a1c223b8581d98":[1,0,0,17,1], -"runge_kutta_8h.html":[1,0,0,18], -"runge_kutta_8h.html#a9255c9662ed42d1740a1c223b8581d98":[1,0,0,18,0], -"runge_kutta_8h_source.html":[1,0,0,18], -"statistics_8cpp.html":[1,0,0,19], -"statistics_8cpp.html#a134529a21f4976c167ca97eaaf310a3e":[1,0,0,19,1], -"statistics_8cpp.html#a1994b2d115f8daaab6cf904763fc2846":[1,0,0,19,2], -"statistics_8cpp.html#a2b05c840d8c2f659d0e0985fb6cad65a":[1,0,0,19,0], -"statistics_8cpp.html#a6023a4811d245e4abe3319d6630ece01":[1,0,0,19,3], -"statistics_8h.html":[1,0,0,20], -"statistics_8h.html#a0aeb5d9b565f5850b4084a0e6904ccf5":[1,0,0,20,2], -"statistics_8h.html#a2b05c840d8c2f659d0e0985fb6cad65a":[1,0,0,20,0], -"statistics_8h.html#adbc26f30c08787855613161d64715894":[1,0,0,20,1], -"statistics_8h_source.html":[1,0,0,20], +"runge_kutta_8h.html":[1,0,0,13], +"runge_kutta_8h.html#a24a416ea1925a669f4887e06e071d562":[1,0,0,13,1], +"runge_kutta_8h.html#a8aa61474fe715e80f13ff7b946ac55d1":[1,0,0,13,0], +"runge_kutta_8h_source.html":[1,0,0,13], +"statistics_8h.html":[1,0,0,14], +"statistics_8h.html#a2b05c840d8c2f659d0e0985fb6cad65a":[1,0,0,14,0], +"statistics_8h.html#a4368c6ff543bcea59b8608f494f55651":[1,0,0,14,1], +"statistics_8h.html#a99282c9573327898307cbd3492de0bdc":[1,0,0,14,3], +"statistics_8h.html#ad96ad8747ff6dabc632d0e262c9c7bb2":[1,0,0,14,2], +"statistics_8h_source.html":[1,0,0,14], "struct_data.html":[0,0,0], "struct_data.html#a169e63872ce770accd469a58b1e7c98b":[0,0,0,2], "struct_data.html#a88875589ade92d5769a808de87d99966":[0,0,0,0], diff --git a/docs/numerical_integration_8h.html b/docs/numerical_integration_8h.html index b06ddbf..b62b07a 100644 --- a/docs/numerical_integration_8h.html +++ b/docs/numerical_integration_8h.html @@ -106,37 +106,42 @@
std::vector<long double> generate std::vector<T> generate (const std::function< long double(long double)> & const std::function< T(T)> &  target,
- - - - - - - - - + + + + + + + + + + + +

Functions

long double compositeSimpsons (const long double &a, const long double &b, const unsigned long &n, const std::function< long double(long double)> &func)
 Composite Simpson’s Integration. More...
 
long double doubleIntegral (const long double &a, const long double &b, const unsigned long &m, const unsigned long &n, const std::function< long double(long double)> &c, const std::function< long double(long double)> &d, const std::function< long double(long double, long double)> &func)
 Double Simpson’s Integration. More...
 
long double monteCarloIntegration (const long double &a, const long double &b, const unsigned long &n, std::function< long double(long double)> &func)
 Monte-Carlo Integration. More...
 
template<typename T = long double>
compositeSimpsons (const T &a, const T &b, const unsigned long &n, const std::function< T(T)> &func)
 Composite Simpson’s Integration. More...
 
template<typename T = long double>
doubleIntegral (const T &a, const T &b, const unsigned long &m, const unsigned long &n, const std::function< T(T)> &c, const std::function< T(T)> &d, const std::function< T(T, T)> &func)
 Double Simpson’s Integration. More...
 
template<typename T = long double>
monteCarloIntegration (const T &a, const T &b, const unsigned long &n, std::function< T(T)> &func)
 Monte-Carlo Integration. More...
 

Detailed Description

Numerical integration methods.

Author
Murat Koptur mkopt.nosp@m.ur3@.nosp@m.gmail.nosp@m..com

Last updated: 22/Jan/2019.

Function Documentation

- -

◆ compositeSimpsons()

+ +

◆ compositeSimpsons()

+
+template<typename T = long double>
- + - + - + @@ -148,7 +153,7 @@

- + @@ -174,22 +179,24 @@

-

◆ doubleIntegral()

+ +

◆ doubleIntegral()

+
+template<typename T = long double>
long double compositeSimpsons T compositeSimpsons (const long double & const T &  a,
const long double & const T &  b,
const std::function< long double(long double)> & const std::function< T(T)> &  func 
- + - + - + @@ -207,19 +214,19 @@

- + - + - + @@ -248,22 +255,24 @@

-

◆ monteCarloIntegration()

+ +

◆ monteCarloIntegration()

+
+template<typename T = long double>
long double doubleIntegral T doubleIntegral (const long double & const T &  a,
const long double & const T &  b,
const std::function< long double(long double)> & const std::function< T(T)> &  c,
const std::function< long double(long double)> & const std::function< T(T)> &  d,
const std::function< long double(long double, long double)> & const std::function< T(T, T)> &  func 
- + - + - + @@ -275,7 +284,7 @@

- + diff --git a/docs/numerical_integration_8h.js b/docs/numerical_integration_8h.js index 8658f96..c946c46 100644 --- a/docs/numerical_integration_8h.js +++ b/docs/numerical_integration_8h.js @@ -1,6 +1,6 @@ var numerical_integration_8h = [ - [ "compositeSimpsons", "numerical_integration_8h.html#aa6efda2fcf775fc079c9c4fc809b035e", null ], - [ "doubleIntegral", "numerical_integration_8h.html#a2c0b0418fa5b1481669d937b005c92b6", null ], - [ "monteCarloIntegration", "numerical_integration_8h.html#a017cb13f34621723a92a789d14565f83", null ] + [ "compositeSimpsons", "numerical_integration_8h.html#a2a49b6efd60f3f4bd9b132455392127a", null ], + [ "doubleIntegral", "numerical_integration_8h.html#a8a2700261385eec68fa80882704ea6de", null ], + [ "monteCarloIntegration", "numerical_integration_8h.html#a032561911785237d600ba4bd287f6f05", null ] ]; \ No newline at end of file diff --git a/docs/numerical_integration_8h_source.html b/docs/numerical_integration_8h_source.html index bacfc82..e520247 100644 --- a/docs/numerical_integration_8h_source.html +++ b/docs/numerical_integration_8h_source.html @@ -90,10 +90,11 @@
numericalIntegration.h
-Go to the documentation of this file.
1 
12 #ifndef NUMERICALINTEGRATION_H
13 #define NUMERICALINTEGRATION_H
14 
15 #include <cassert>
16 #include <cstdio>
17 #include <functional>
18 #include <iostream>
19 #include <numeric>
20 #include "statistics.h"
21 
36 long double compositeSimpsons(
37  const long double &a, const long double &b, const unsigned long &n,
38  const std::function<long double(long double)> &func);
39 
57 long double doubleIntegral(
58  const long double &a, const long double &b, const unsigned long &m,
59  const unsigned long &n, const std::function<long double(long double)> &c,
60  const std::function<long double(long double)> &d,
61  const std::function<long double(long double, long double)> &func);
62 
79 long double monteCarloIntegration(
80  const long double &a, const long double &b, const unsigned long &n,
81  std::function<long double(long double)> &func);
82 
83 #endif /* NUMERICALINTEGRATION_H */
long double doubleIntegral(const long double &a, const long double &b, const unsigned long &m, const unsigned long &n, const std::function< long double(long double)> &c, const std::function< long double(long double)> &d, const std::function< long double(long double, long double)> &func)
Double Simpson’s Integration.
Definition: NumericalIntegration.cpp:71
+Go to the documentation of this file.
1 
12 #ifndef NUMERICALINTEGRATION_H
13 #define NUMERICALINTEGRATION_H
14 
15 #include <cassert>
16 #include <cstdio>
17 #include <functional>
18 #include <iostream>
19 #include <numeric>
20 #include "statistics.h"
21 
36 template <typename T = long double>
37 T compositeSimpsons(const T &a, const T &b, const unsigned long &n,
38  const std::function<T(T)> &func) {
39  auto XI = 0.0;
40  // STEP 1
41  auto h = (b - a) / n;
42  // STEP 2
43  auto XI0 = func(a) + func(b);
44  auto XI1 = 0.0;
45  auto XI2 = 0.0;
46  // STEP 3
47  for (auto i = 1; i <= n - 1; i++) {
48  // STEP 4
49  auto X = a + i * h;
50  // STEP 5
51  if (i % 2 == 0) {
52  XI2 = XI2 + func(X);
53  } else {
54  XI1 = XI1 + func(X);
55  }
56  }
57  XI = h * (XI0 + 2 * XI2 + 4 * XI1) / 3;
58  std::cout << "Approximation to integral: " << XI << std::endl;
59  return XI;
60 }
61 
79 template <typename T = long double>
80 T doubleIntegral(const T &a, const T &b, const unsigned long &m,
81  const unsigned long &n, const std::function<T(T)> &c,
82  const std::function<T(T)> &d,
83  const std::function<T(T, T)> &func) {
84  assert(m % 2 == 0);
85  assert(n % 2 == 0);
86  auto J = 0.0;
87  // STEP 1
88  auto h = (b - a) / n;
89  auto J1 = 0.0;
90  auto J2 = 0.0;
91  auto J3 = 0.0;
92  // STEP 2
93  for (auto i = 0; i <= n; i++) {
94  // STEP 3
95  auto x = a + i * h;
96  auto cx = c(x);
97  auto dx = d(x);
98  auto HX = (dx - cx) / m;
99  auto K1 = func(x, cx) + func(x, dx);
100  auto K2 = 0.0;
101  auto K3 = 0.0;
102  // STEP 4
103  for (auto j = 1; j <= m - 1; j++) {
104  // STEP 5
105  auto y = cx + j * HX;
106  auto Q = func(x, y);
107  // STEP 6
108  if (j % 2 == 0) {
109  K2 += Q;
110  } else {
111  K3 += Q;
112  }
113  }
114  // STEP 7
115  auto L = (K1 + 2 * K2 + 4 * K3) * HX / 3;
116  // STEP 8
117  if (i == 0 || i == n) {
118  J1 += L;
119  } else if (i % 2 == 0) {
120  J2 += L;
121  } else {
122  J3 += L;
123  }
124  }
125  // STEP 9
126  J = h * (J1 + 2 * J2 + 4 * J3) / 3;
127  std::cout << "Approximation to integral: " << J << std::endl;
128  return J;
129 }
130 
147 template <typename T = long double>
148 T monteCarloIntegration(const T &a, const T &b, const unsigned long &n,
149  std::function<T(T)> &func) {
150  std::vector<T> X(n, 0);
151  for (auto i = 0; i < n; i++) {
152  X[i] = runif(a, b);
153  }
154 
155  T sum = 0;
156  for (auto xi : X) {
157  sum += func(xi);
158  }
159 
160  auto result = (b - a) / n * sum;
161 
162  std::cout << "Approximation to integral: " << result << std::endl;
163  return result;
164 }
165 
166 #endif /* NUMERICALINTEGRATION_H */
T monteCarloIntegration(const T &a, const T &b, const unsigned long &n, std::function< T(T)> &func)
Monte-Carlo Integration.
Definition: numericalIntegration.h:148
Statistics related functions.
-
long double compositeSimpsons(const long double &a, const long double &b, const unsigned long &n, const std::function< long double(long double)> &func)
Composite Simpson’s Integration.
Definition: NumericalIntegration.cpp:28
-
long double monteCarloIntegration(const long double &a, const long double &b, const unsigned long &n, std::function< long double(long double)> &func)
Monte-Carlo Integration.
Definition: NumericalIntegration.cpp:139
+
T doubleIntegral(const T &a, const T &b, const unsigned long &m, const unsigned long &n, const std::function< T(T)> &c, const std::function< T(T)> &d, const std::function< T(T, T)> &func)
Double Simpson’s Integration.
Definition: numericalIntegration.h:80
+
T runif(const T &a=0, const T &b=1)
Uniform number generator.
Definition: statistics.h:31
+
T compositeSimpsons(const T &a, const T &b, const unsigned long &n, const std::function< T(T)> &func)
Composite Simpson’s Integration.
Definition: numericalIntegration.h:37
diff --git a/docs/rtf/refman.rtf b/docs/rtf/refman.rtf new file mode 100644 index 0000000..22eee99 --- /dev/null +++ b/docs/rtf/refman.rtf @@ -0,0 +1,2199 @@ +{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033 +{\fonttbl {\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} +{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;} +{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;} +} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red0\green128\blue0;\red96\green64\blue32;\rede0\green128\blue0;\red128\green0\blue0;\red128\green96\blue32;\red0\green32\blue128;\red0\green128\blue128;\red255\green0\blue255;\red0\green0\blue0;\red112\green0\blue112;\red255\green0\blue0;} +{\stylesheet +{\widctlpar\adjustright \fs20\cgrid \snext0 Normal;} +{\paperw11900\paperh16840\margl1800\margr1800\margt1440\margb1440\gutter0\ltrsect} +{\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid \sbasedon0 \snext0 heading 1;} +{\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid \sbasedon0 \snext0 heading 2;} +{\s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid \sbasedon0 \snext0 heading 3;} +{\s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid \sbasedon0 \snext0 heading 4;}{\*\cs10 \additive Default Paragraph Font;} +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid \sbasedon0 \snext0 heading 5;}{\*\cs10 \additive Default Paragraph Font;} +{\s15\qc\sb240\sa60\widctlpar\outlinelevel0\adjustright \b\f1\fs32\kerning28\cgrid \sbasedon0 \snext15 Title;} +{\s16\qc\sa60\widctlpar\outlinelevel1\adjustright \f1\cgrid \sbasedon0 \snext16 Subtitle;} +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid \sbasedon0 \snext17 BodyText;} +{\s18\widctlpar\fs22\cgrid \sbasedon0 \snext18 DenseText;} +{\s28\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext28 header;} +{\s29\widctlpar\tqc\tx4320\tqr\tx8640\qr\adjustright \fs20\cgrid \sbasedon0 \snext29 footer;} +{\s30\li360\sa60\sb120\keepn\widctlpar\adjustright \b\f1\fs20\cgrid \sbasedon0 \snext30 GroupHeader;} +{\s40\li0\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext41 Code Example 0;} +{\s41\li360\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext42 Code Example 1;} +{\s42\li720\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext43 Code Example 2;} +{\s43\li1080\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext44 Code Example 3;} +{\s44\li1440\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext45 Code Example 4;} +{\s45\li1800\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext46 Code Example 5;} +{\s46\li2160\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext47 Code Example 6;} +{\s47\li2520\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext48 Code Example 7;} +{\s48\li2880\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext49 Code Example 8;} +{\s49\li3240\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext50 Code Example 9;} +{\s50\li3600\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext51 Code Example 10;} +{\s51\li3960\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext52 Code Example 11;} +{\s52\li4320\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext53 Code Example 12;} +{\s53\li4680\widctlpar\adjustright \shading1000\cbpat8 \f2\fs16\cgrid \sbasedon0 \snext53 Code Example 13;} +{\s60\li0\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext61 List Continue 0;} +{\s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext62 List Continue 1;} +{\s62\li720\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext63 List Continue 2;} +{\s63\li1080\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext64 List Continue 3;} +{\s64\li1440\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext65 List Continue 4;} +{\s65\li1800\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext66 List Continue 5;} +{\s66\li2160\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext67 List Continue 6;} +{\s67\li2520\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext68 List Continue 7;} +{\s68\li2880\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext69 List Continue 8;} +{\s69\li3240\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext70 List Continue 9;} +{\s70\li3600\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext71 List Continue 10;} +{\s71\li3960\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext72 List Continue 11;} +{\s72\li4320\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext73 List Continue 12;} +{\s73\li4680\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid \sbasedon0 \snext73 List Continue 13;} +{\s80\li0\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext81 DescContinue 0;} +{\s81\li360\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext82 DescContinue 1;} +{\s82\li720\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext83 DescContinue 2;} +{\s83\li1080\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext84 DescContinue 3;} +{\s84\li1440\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext85 DescContinue 4;} +{\s85\li1800\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext86 DescContinue 5;} +{\s86\li2160\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext87 DescContinue 6;} +{\s87\li2520\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext88 DescContinue 7;} +{\s88\li2880\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext89 DescContinue 8;} +{\s89\li3240\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext90 DescContinue 9;} +{\s90\li3600\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext91 DescContinue 10;} +{\s91\li3960\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext92 DescContinue 11;} +{\s92\li4320\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext93 DescContinue 12;} +{\s93\li4680\widctlpar\ql\adjustright \fs20\cgrid \sbasedon0 \snext93 DescContinue 13;} +{\s100\li0\sa30\sb30\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext101 LatexTOC 0;} +{\s101\li360\sa27\sb27\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext102 LatexTOC 1;} +{\s102\li720\sa24\sb24\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext103 LatexTOC 2;} +{\s103\li1080\sa21\sb21\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext104 LatexTOC 3;} +{\s104\li1440\sa18\sb18\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext105 LatexTOC 4;} +{\s105\li1800\sa15\sb15\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext106 LatexTOC 5;} +{\s106\li2160\sa12\sb12\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext107 LatexTOC 6;} +{\s107\li2520\sa9\sb9\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext108 LatexTOC 7;} +{\s108\li2880\sa6\sb6\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext109 LatexTOC 8;} +{\s109\li3240\sa3\sb3\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext110 LatexTOC 9;} +{\s110\li3600\sa3\sb3\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext111 LatexTOC 10;} +{\s111\li3960\sa3\sb3\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext112 LatexTOC 11;} +{\s112\li4320\sa3\sb3\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext113 LatexTOC 12;} +{\s113\li4680\sa3\sb3\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext113 LatexTOC 13;} +{\s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext121 \sautoupd List Bullet 0;} +{\s121\fi-360\li720\widctlpar\jclisttab\tx720{\*\pn \pnlvlbody\ilvl0\ls2\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext122 \sautoupd List Bullet 1;} +{\s122\fi-360\li1080\widctlpar\jclisttab\tx1080{\*\pn \pnlvlbody\ilvl0\ls3\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext123 \sautoupd List Bullet 2;} +{\s123\fi-360\li1440\widctlpar\jclisttab\tx1440{\*\pn \pnlvlbody\ilvl0\ls4\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext124 \sautoupd List Bullet 3;} +{\s124\fi-360\li1800\widctlpar\jclisttab\tx1800{\*\pn \pnlvlbody\ilvl0\ls5\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext125 \sautoupd List Bullet 4;} +{\s125\fi-360\li2160\widctlpar\jclisttab\tx2160{\*\pn \pnlvlbody\ilvl0\ls6\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext126 \sautoupd List Bullet 5;} +{\s126\fi-360\li2520\widctlpar\jclisttab\tx2520{\*\pn \pnlvlbody\ilvl0\ls7\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext127 \sautoupd List Bullet 6;} +{\s127\fi-360\li2880\widctlpar\jclisttab\tx2880{\*\pn \pnlvlbody\ilvl0\ls8\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext128 \sautoupd List Bullet 7;} +{\s128\fi-360\li3240\widctlpar\jclisttab\tx3240{\*\pn \pnlvlbody\ilvl0\ls9\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext129 \sautoupd List Bullet 8;} +{\s129\fi-360\li3600\widctlpar\jclisttab\tx3600{\*\pn \pnlvlbody\ilvl0\ls10\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext130 \sautoupd List Bullet 9;} +{\s130\fi-360\li3960\widctlpar\jclisttab\tx3960{\*\pn \pnlvlbody\ilvl0\ls11\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext131 \sautoupd List Bullet 10;} +{\s131\fi-360\li4320\widctlpar\jclisttab\tx4320{\*\pn \pnlvlbody\ilvl0\ls12\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext132 \sautoupd List Bullet 11;} +{\s132\fi-360\li4680\widctlpar\jclisttab\tx4680{\*\pn \pnlvlbody\ilvl0\ls13\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext133 \sautoupd List Bullet 12;} +{\s133\fi-360\li5040\widctlpar\jclisttab\tx5040{\*\pn \pnlvlbody\ilvl0\ls14\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid \sbasedon0 \snext133 \sautoupd List Bullet 13;} +{\s140\fi-360\li360\widctlpar\fs20\cgrid \sbasedon0 \snext141 \sautoupd List Enum 0;} +{\s141\fi-360\li720\widctlpar\fs20\cgrid \sbasedon0 \snext142 \sautoupd List Enum 1;} +{\s142\fi-360\li1080\widctlpar\fs20\cgrid \sbasedon0 \snext143 \sautoupd List Enum 2;} +{\s143\fi-360\li1440\widctlpar\fs20\cgrid \sbasedon0 \snext144 \sautoupd List Enum 3;} +{\s144\fi-360\li1800\widctlpar\fs20\cgrid \sbasedon0 \snext145 \sautoupd List Enum 4;} +{\s145\fi-360\li2160\widctlpar\fs20\cgrid \sbasedon0 \snext146 \sautoupd List Enum 5;} +{\s146\fi-360\li2520\widctlpar\fs20\cgrid \sbasedon0 \snext147 \sautoupd List Enum 6;} +{\s147\fi-360\li2880\widctlpar\fs20\cgrid \sbasedon0 \snext148 \sautoupd List Enum 7;} +{\s148\fi-360\li3240\widctlpar\fs20\cgrid \sbasedon0 \snext149 \sautoupd List Enum 8;} +{\s149\fi-360\li3600\widctlpar\fs20\cgrid \sbasedon0 \snext150 \sautoupd List Enum 9;} +{\s150\fi-360\li3960\widctlpar\fs20\cgrid \sbasedon0 \snext151 \sautoupd List Enum 10;} +{\s151\fi-360\li4320\widctlpar\fs20\cgrid \sbasedon0 \snext152 \sautoupd List Enum 11;} +{\s152\fi-360\li4680\widctlpar\fs20\cgrid \sbasedon0 \snext153 \sautoupd List Enum 12;} +{\s153\fi-360\li5040\widctlpar\fs20\cgrid \sbasedon0 \snext153 \sautoupd List Enum 13;} +} +{\info +{\title {\comment Cpp Examples }Cpp Examples} +{\comment Generated by doxygen.} +{\creatim \yr2019\mo10\dy13\hr20\min7\sec8} +}\pard\plain +\sectd\pgnlcrm +{\footer \s29\widctlpar\tqc\tx4320\tqr\tx8640\qr\adjustright \fs20\cgrid {\chpgn}} +\pard\plain \s16\qc\sa60\widctlpar\outlinelevel1\adjustright \f1\cgrid +\vertalc\qc\par\par\par\par\par\par\par +\pard\plain \s15\qc\sb240\sa60\widctlpar\outlinelevel0\adjustright \b\f1\fs32\kerning28\cgrid +{\field\fldedit {\*\fldinst TITLE \\*MERGEFORMAT}{\fldrslt Cpp Examples}}\par +\pard\plain \s16\qc\sa60\widctlpar\outlinelevel1\adjustright \f1\cgrid +\par +\par\par\par\par\par\par\par\par\par\par\par\par +\pard\plain \s16\qc\sa60\widctlpar\outlinelevel1\adjustright \f1\cgrid +{\field\fldedit {\*\fldinst AUTHOR \\*MERGEFORMAT}{\fldrslt AUTHOR}}\par +Version \par{\field\fldedit {\*\fldinst CREATEDATE \\*MERGEFORMAT}{\fldrslt Sun Oct 13 2019 }}\par +\page\page\vertalt +\pard\plain +\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid Table of Contents\par +\pard\plain \par +{\field\fldedit {\*\fldinst TOC \\f \\*MERGEFORMAT}{\fldrslt Table of contents}}\par +\pard\plain +\sect \sbkpage \pgndec \pgnrestart +\sect \sectd \sbknone +{\footer \s29\widctlpar\tqc\tx4320\tqr\tx8640\qr\adjustright \fs20\cgrid {\chpgn}} + +\pard\plain \sect\sbkpage +\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid +Class Index\par \pard\plain +{\tc \v Class Index} +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +Class List\par \pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid Here are the classes, structs, unions and interfaces with brief descriptions:} +{ +\par +\pard\plain \s101\li360\sa27\sb27\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid +{\b {\b Data< T >} } \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAACG \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b {\b Dual} } \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAACL \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b {\b Result} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +The struct that stores result })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAACQ \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +\par} +\pard\plain \sect\sbkpage +\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid +File Index\par \pard\plain +{\tc \v File Index} +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +File List\par \pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid Here is a list of all documented files with brief descriptions:} +{ +\par +\pard\plain \s101\li360\sa27\sb27\widctlpar\tqr\tldot\tx8640\adjustright \fs20\cgrid +{\b src/{\b bbpTypeFormula.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +BPP Type formula calculation })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAAAA \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b binom.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Calculate binomial coefficient })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAAAC \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b brentSalaminFormula.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Brent-Salamin Formula })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAAAE \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b devrandom.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Generate random numbers/strings from /dev/random })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAAAG \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b discreteFourierTransform.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Functions for DFT and IDFT })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAAAI \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b dualNumbers.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Implementation of dual numbers })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAAAN \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b fixedPointIteration.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Fixed point iteration })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAABG \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b goldenSectionSearch.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Golden Section Search })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAABI \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b integerFactorization.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Implements Pollard rho algorithm })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAABK \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b lagrangeInterpolation.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Lagrange Interpolation })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAABO \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b lcg.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Linear Congruential Generator })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAABQ \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b metropolisHastings.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Metropolis-Hastings algorithm })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAABS \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b numericalIntegration.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Numerical integration methods })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAABU \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b rungeKutta.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Runge-Kutta Order Four })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAABY \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +{\b src/{\b statistics.h} ({\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Statistics related functions })} \tab {\field\fldedit {\*\fldinst PAGEREF AAAAAAAACB \\*MERGEFORMAT}{\fldrslt pagenum}} +\par +\par} +\pard\plain \sect\sbkpage +\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid +Class Documentation{\tc \v Class Documentation} +\par \pard\plain +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +Data< T > Struct Template Reference\par \pard\plain +{\tc\tcl2 \v Data< T >} +{\xe \v Data< T >} +{\bkmkstart AAAAAAAACG} +{\bkmkend AAAAAAAACG} +\par +{ +{\f2 #include }}\par +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Public Member Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Data} (std::vector< T > x, std::vector< T > y){\bkmkstart AAAAAAAACH} +{\bkmkend AAAAAAAACH} +\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Public Attributes\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +std::vector< T > {\b x}{\bkmkstart AAAAAAAACI} +{\bkmkend AAAAAAAACI} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +std::vector< T > {\b y}{\bkmkstart AAAAAAAACJ} +{\bkmkend AAAAAAAACJ} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +unsigned long {\b size}{\bkmkstart AAAAAAAACK} +{\bkmkend AAAAAAAACK} +\par +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{ +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +template\par +struct Data< T >\par +} + +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +A struct for storing x and y values. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +The documentation for this struct was generated from the following file:{\par +\pard\plain \s121\fi-360\li720\widctlpar\jclisttab\tx720{\*\pn \pnlvlbody\ilvl0\ls2\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +src/{\b lagrangeInterpolation.h}\par +}\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +Dual Struct Reference\par \pard\plain +{\tc\tcl2 \v Dual} +{\xe \v Dual} +{\bkmkstart AAAAAAAACL} +{\bkmkend AAAAAAAACL} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Public Member Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} (const long double &a){\bkmkstart AAAAAAAACM} +{\bkmkend AAAAAAAACM} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} (const long double &a, const long double &b){\bkmkstart AAAAAAAACN} +{\bkmkend AAAAAAAACN} +\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Public Attributes\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +long double {\b real}{\bkmkstart AAAAAAAACO} +{\bkmkend AAAAAAAACO} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +long double {\b dual}{\bkmkstart AAAAAAAACP} +{\bkmkend AAAAAAAACP} +\par +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +The documentation for this struct was generated from the following file:{\par +\pard\plain \s121\fi-360\li720\widctlpar\jclisttab\tx720{\*\pn \pnlvlbody\ilvl0\ls2\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +src/{\b dualNumbers.h}\par +}\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +Result Struct Reference\par \pard\plain +{\tc\tcl2 \v Result} +{\xe \v Result} +{\bkmkstart AAAAAAAACQ} +{\bkmkend AAAAAAAACQ} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +The struct that stores result. }}\par +{ +{\f2 #include }}\par +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Public Attributes\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +long double {\b a}\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +long double {\b b}\par +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +The struct that stores result. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Member Data Documentation\par +\pard\plain +{\xe \v a\:Result} +{\xe \v Result\:a} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +Result::a}} +\par +{\bkmkstart AAAAAAAACR} +{\bkmkend AAAAAAAACR} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Lower bound. \par +}} +{\xe \v b\:Result} +{\xe \v Result\:b} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +Result::b}} +\par +{\bkmkstart AAAAAAAACS} +{\bkmkend AAAAAAAACS} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Upper bound. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +The documentation for this struct was generated from the following file:{\par +\pard\plain \s121\fi-360\li720\widctlpar\jclisttab\tx720{\*\pn \pnlvlbody\ilvl0\ls2\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +src/{\b goldenSectionSearch.h}\par +} +\pard\plain \sect\sbkpage +\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid +File Documentation{\tc \v File Documentation} +\par \pard\plain +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/bbpTypeFormula.h File Reference\par \pard\plain +{\tc\tcl2 \v src/bbpTypeFormula.h} +{\xe \v src/bbpTypeFormula.h} +{\bkmkstart AAAAAAAAAA} +{\bkmkend AAAAAAAAAA} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +BPP Type formula calculation. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b P} (const int &s, const int &b, const int &n, const std::vector< int > &A, const int &n_iter)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +BPP Type formula calculation. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +BPP Type formula calculation. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +The Bailey\'E2\'80\'93Borwein\'E2\'80\'93Plouffe formula (BBP formula) is a spigot algorithm which is an algorithm for computing the value of a mathematical constant such as \'CF\'80 or e which generates output digits in some base (usually 2 or a power of 2) from left to right, with limited intermediate storage. The name comes from the sense of the word "spigot" for a tap or valve controlling the flow of a liquid.\par +Formula was taken from: {\f2 https://bbp.carma.newcastle.edu.au/}\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v P\:bbpTypeFormula.h} +{\xe \v bbpTypeFormula.h\:P} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T P (const int & {\i s}, const int & {\i b}, const int & {\i n}, const std::vector< int > & {\i A}, const int & {\i n_iter})}} +\par +{\bkmkstart AAAAAAAAAB} +{\bkmkend AAAAAAAAAB} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +BPP Type formula calculation. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i s} \cell }{An integer. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i b} \cell }{An integer. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n} \cell }{An integer. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i A} \cell }{A sequence of integers. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n_iter} \cell }{Iteration count.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Approximation of a number. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/binom.h File Reference\par \pard\plain +{\tc\tcl2 \v src/binom.h} +{\xe \v src/binom.h} +{\bkmkstart AAAAAAAAAC} +{\bkmkend AAAAAAAAAC} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Calculate binomial coefficient. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b binomCoef} (const unsigned long &n, const unsigned long &k)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Calculate binomial coefficient. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Calculate binomial coefficient. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v binomCoef\:binom.h} +{\xe \v binom.h\:binomCoef} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T binomCoef (const unsigned long & {\i n}, const unsigned long & {\i k})}} +\par +{\bkmkstart AAAAAAAAAD} +{\bkmkend AAAAAAAAAD} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Calculate binomial coefficient. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n} \cell }{An integer. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i k} \cell }{An integer.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Binomial coefficient. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/brentSalaminFormula.h File Reference\par \pard\plain +{\tc\tcl2 \v src/brentSalaminFormula.h} +{\xe \v src/brentSalaminFormula.h} +{\bkmkstart AAAAAAAAAE} +{\bkmkend AAAAAAAAAE} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Brent-Salamin Formula. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b calc_pi} (const unsigned int &n_iter)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Brent-Salamin Formula. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Brent-Salamin Formula. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +The Brent-Salamin formula, also called the Gauss-Salamin formula or Salamin formula, is a formula that uses the arithmetic-geometric mean to compute pi.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 24/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v calc_pi\:brentSalaminFormula.h} +{\xe \v brentSalaminFormula.h\:calc_pi} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T calc_pi (const unsigned int & {\i n_iter})}} +\par +{\bkmkstart AAAAAAAAAF} +{\bkmkend AAAAAAAAAF} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Brent-Salamin Formula. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Template Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i T} \cell }{Type of return value. Choose appropriate type for precision which you want. \cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n_iter} \cell }{Iteration count.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Approximation of pi. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/devrandom.h File Reference\par \pard\plain +{\tc\tcl2 \v src/devrandom.h} +{\xe \v src/devrandom.h} +{\bkmkstart AAAAAAAAAG} +{\bkmkend AAAAAAAAAG} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Generate random numbers/strings from /dev/random. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b devrandom} ()\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +A function template which takes a type as argument and returns an random element of that type. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Generate random numbers/strings from /dev/random. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +/dev/random is special file that serve as pseudorandom number generator. They allow access to environmental noise collected from device drivers and other sources.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v devrandom\:devrandom.h} +{\xe \v devrandom.h\:devrandom} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T devrandom ()}} +\par +{\bkmkstart AAAAAAAAAH} +{\bkmkend AAAAAAAAAH} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +A function template which takes a type as argument and returns an random element of that type. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i T} \cell }{A type.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Random element. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/discreteFourierTransform.h File Reference\par \pard\plain +{\tc\tcl2 \v src/discreteFourierTransform.h} +{\xe \v src/discreteFourierTransform.h} +{\bkmkstart AAAAAAAAAI} +{\bkmkend AAAAAAAAAI} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Functions for DFT and IDFT. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Typedefs\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template using {\b Complex} = std::complex< T >\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template using {\b CVec} = std::vector< std::complex< T > >\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +{\b CVec} {\b dft} (const {\b CVec}<> &input)\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +{\b CVec} {\b idft} (const {\b CVec}<> &input)\par +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Functions for DFT and IDFT. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex-valued function of frequency.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 2/Feb/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Typedef Documentation\par +\pard\plain +{\xe \v Complex\:discreteFourierTransform.h} +{\xe \v discreteFourierTransform.h\:Complex} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template using {\b Complex} = std::complex}} +\par +{\bkmkstart AAAAAAAAAJ} +{\bkmkend AAAAAAAAAJ} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +A type for complex numbers. \par +}} +{\xe \v CVec\:discreteFourierTransform.h} +{\xe \v discreteFourierTransform.h\:CVec} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template using {\b CVec} = std::vector >}} +\par +{\bkmkstart AAAAAAAAAK} +{\bkmkend AAAAAAAAAK} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +A type for array of complex numbers. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v dft\:discreteFourierTransform.h} +{\xe \v discreteFourierTransform.h\:dft} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +{\b CVec} dft (const {\b CVec}<> & {\i input})}} +\par +{\bkmkstart AAAAAAAAAL} +{\bkmkend AAAAAAAAAL} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Calculate DFT for given input.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i input} \cell }{Vector of complex numbers.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid DFT. \par +}}} +{\xe \v idft\:discreteFourierTransform.h} +{\xe \v discreteFourierTransform.h\:idft} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +{\b CVec} idft (const {\b CVec}<> & {\i input})}} +\par +{\bkmkstart AAAAAAAAAM} +{\bkmkend AAAAAAAAAM} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Calculate IDFT for given input.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i input} \cell }{Vector of complex numbers.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid IDFT. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/dualNumbers.h File Reference\par \pard\plain +{\tc\tcl2 \v src/dualNumbers.h} +{\xe \v src/dualNumbers.h} +{\bkmkstart AAAAAAAAAN} +{\bkmkend AAAAAAAAAN} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Implementation of dual numbers. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Classes\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +struct {\b Dual}\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b operator+} (const {\b Dual} &u, const {\b Dual} &v){\bkmkstart AAAAAAAAAO} +{\bkmkend AAAAAAAAAO} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b operator-} (const {\b Dual} &u, const {\b Dual} &v){\bkmkstart AAAAAAAAAP} +{\bkmkend AAAAAAAAAP} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b operator *} (const {\b Dual} &u, const {\b Dual} &v){\bkmkstart AAAAAAAAAQ} +{\bkmkend AAAAAAAAAQ} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b operator/} (const {\b Dual} &u, const {\b Dual} &v){\bkmkstart AAAAAAAAAR} +{\bkmkend AAAAAAAAAR} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +std::ostream & {\b operator<<} (std::ostream &os, const {\b Dual} &d){\bkmkstart AAAAAAAAAS} +{\bkmkend AAAAAAAAAS} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b pow} (const {\b Dual} &d, const long double &p){\bkmkstart AAAAAAAAAT} +{\bkmkend AAAAAAAAAT} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b root} (const {\b Dual} &d, const long double &p){\bkmkstart AAAAAAAAAU} +{\bkmkend AAAAAAAAAU} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b exp} (const {\b Dual} &d){\bkmkstart AAAAAAAAAV} +{\bkmkend AAAAAAAAAV} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b log} (const {\b Dual} &d){\bkmkstart AAAAAAAAAW} +{\bkmkend AAAAAAAAAW} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b sin} (const {\b Dual} &d){\bkmkstart AAAAAAAAAX} +{\bkmkend AAAAAAAAAX} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b cos} (const {\b Dual} &d){\bkmkstart AAAAAAAAAY} +{\bkmkend AAAAAAAAAY} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b tan} (const {\b Dual} &d){\bkmkstart AAAAAAAAAZ} +{\bkmkend AAAAAAAAAZ} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b asin} (const {\b Dual} &d){\bkmkstart AAAAAAAABA} +{\bkmkend AAAAAAAABA} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b acos} (const {\b Dual} &d){\bkmkstart AAAAAAAABB} +{\bkmkend AAAAAAAABB} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b atan} (const {\b Dual} &d){\bkmkstart AAAAAAAABC} +{\bkmkend AAAAAAAABC} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b sinh} (const {\b Dual} &d){\bkmkstart AAAAAAAABD} +{\bkmkend AAAAAAAABD} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b cosh} (const {\b Dual} &d){\bkmkstart AAAAAAAABE} +{\bkmkend AAAAAAAABE} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +{\b Dual} {\b tanh} (const {\b Dual} &d){\bkmkstart AAAAAAAABF} +{\bkmkend AAAAAAAABF} +\par +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Implementation of dual numbers. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +In linear algebra, the dual numbers extend the real numbers by adjoining one new element \'CE\'B5 with the property \'CE\'B5^2 = 0 (\'CE\'B5 is nilpotent).\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 3/Feb/2019. \par +}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/fixedPointIteration.h File Reference\par \pard\plain +{\tc\tcl2 \v src/fixedPointIteration.h} +{\xe \v src/fixedPointIteration.h} +{\bkmkstart AAAAAAAABG} +{\bkmkend AAAAAAAABG} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Fixed point iteration. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b fixedPointIter} (T p0, const T &tol, const unsigned long &N0, const std::function< T(T)> &{\b g})\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Find a solution to p = g(p) given an initial approximation p0. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Fixed point iteration. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Fixed Point Iteration is a method of computing fixed points of iterated functions. We can write an equation f(x)=0 in x=g(x) form and we can find this equation\'92s fixed point and solve first equation.\par +Algorithm 2.2 (Numerical Analysis, Ninth Edition, Burden, Faires)\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v fixedPointIter\:fixedPointIteration.h} +{\xe \v fixedPointIteration.h\:fixedPointIter} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T fixedPointIter (T {\i p0}, const T & {\i tol}, const unsigned long & {\i N0}, const std::function< T(T)> & {\i g})}} +\par +{\bkmkstart AAAAAAAABH} +{\bkmkend AAAAAAAABH} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Find a solution to p = g(p) given an initial approximation p0. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i p0} \cell }{Initial approximation. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i tol} \cell }{Tolerance. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i N0} \cell }{Maximum number of iterations. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i g} \cell }{The function.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Approximate solution p or message of failure.. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/goldenSectionSearch.h File Reference\par \pard\plain +{\tc\tcl2 \v src/goldenSectionSearch.h} +{\xe \v src/goldenSectionSearch.h} +{\bkmkstart AAAAAAAABI} +{\bkmkend AAAAAAAABI} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Golden Section Search. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Classes\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +struct {\b Result}\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +The struct that stores result. }}\par} +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template {\b Result} {\b GoldenSectionSearch} (long double a, long double b, const long double &tol, const std::function< long double(long double)> &func)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Golden Section Search. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Golden Section Search. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +The golden-section search is a technique for finding the extremum (minimum or maximum) of a strictly unimodal function by successively narrowing the range of values inside which the extremum is known to exist. The technique derives its name from the fact that the algorithm maintains the function values for triples of points whose distances form a golden ratio.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v GoldenSectionSearch\:goldenSectionSearch.h} +{\xe \v goldenSectionSearch.h\:GoldenSectionSearch} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template {\b Result} GoldenSectionSearch (long double {\i a}, long double {\i b}, const long double & {\i tol}, const std::function< long double(long double)> & {\i func})}} +\par +{\bkmkstart AAAAAAAABJ} +{\bkmkend AAAAAAAABJ} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Golden Section Search. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i a} \cell }{Lower bound. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i b} \cell }{Upper bound. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i tol} \cell }{Tolerance. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i func} \cell }{The function.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid The interval with d-c<=tol. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/integerFactorization.h File Reference\par \pard\plain +{\tc\tcl2 \v src/integerFactorization.h} +{\xe \v src/integerFactorization.h} +{\bkmkstart AAAAAAAABK} +{\bkmkend AAAAAAAABK} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Implements Pollard rho algorithm. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b g} (T x, T n)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Helper function for generate a pseudo-random sequence. }{ +}\par +}\par} +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b gcd} (T x, T y)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Greatest common divisor. }{ +}\par +}\par} +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b rho} (T n)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Pollard rho algorithm. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Implements Pollard rho algorithm. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Pollard's rho algorithm is an algorithm for integer factorization. It was invented by John Pollard in 1975.[1] It uses only a small amount of space, and its expected running time is proportional to the square root of the size of the smallest prime factor of the composite number being factorized.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 26/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v g\:integerFactorization.h} +{\xe \v integerFactorization.h\:g} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T g (T {\i x}, T {\i n})}} +\par +{\bkmkstart AAAAAAAABL} +{\bkmkend AAAAAAAABL} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Helper function for generate a pseudo-random sequence. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Template Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i T} \cell }{A type. \cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i x} \cell }{Input. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n} \cell }{The number which will be factorized.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Pseudo-random number. \par +}}} +{\xe \v gcd\:integerFactorization.h} +{\xe \v integerFactorization.h\:gcd} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T gcd (T {\i x}, T {\i y})}} +\par +{\bkmkstart AAAAAAAABM} +{\bkmkend AAAAAAAABM} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Greatest common divisor. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Template Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i T} \cell }{A type. \cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i x} \cell }{Number 1. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i y} \cell }{Number 2.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid GCD of x and y. \par +}}} +{\xe \v rho\:integerFactorization.h} +{\xe \v integerFactorization.h\:rho} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T rho (T {\i n})}} +\par +{\bkmkstart AAAAAAAABN} +{\bkmkend AAAAAAAABN} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Pollard rho algorithm. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Template Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i T} \cell }{A type. \cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n} \cell }{The number which will be factorized.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid A non-trivial factor of n. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/lagrangeInterpolation.h File Reference\par \pard\plain +{\tc\tcl2 \v src/lagrangeInterpolation.h} +{\xe \v src/lagrangeInterpolation.h} +{\bkmkstart AAAAAAAABO} +{\bkmkend AAAAAAAABO} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Lagrange Interpolation. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Classes\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +struct {\b Data< T >}\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template std::function< T(T)> {\b lagrangePoly} (const {\b Data}< T > &data)\par +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Lagrange Interpolation. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +In numerical analysis, Lagrange polynomials are used for polynomial interpolation. For a given set of points \{\\displaystyle (x_\{j\},y_\{j\})\} with no two x_\{j\} values equal, the Lagrange polynomial is the polynomial of lowest degree that assumes at each value x_\{j\} the corresponding value y_\{j\} (i.e. the functions coincide at each point).\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 31/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v lagrangePoly\:lagrangeInterpolation.h} +{\xe \v lagrangeInterpolation.h\:lagrangePoly} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template std::function lagrangePoly (const {\b Data}< T > & {\i data})}} +\par +{\bkmkstart AAAAAAAABP} +{\bkmkend AAAAAAAABP} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Lagrange polynomial.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i data} \cell }{A data.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Lagrange interpolation polynomial. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/lcg.h File Reference\par \pard\plain +{\tc\tcl2 \v src/lcg.h} +{\xe \v src/lcg.h} +{\bkmkstart AAAAAAAABQ} +{\bkmkend AAAAAAAABQ} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Linear Congruential Generator. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template std::vector< T > {\b lcg} (const int &seed, const int &mod, const int &mult, const int &incr, const int &count)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Linear Congruential Generator. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Linear Congruential Generator. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Linear Congruential Generator is an algorithm that yields a sequence of pseudo\'96randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best\'96known pseudorandom number generator algorithms.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v lcg\:lcg.h} +{\xe \v lcg.h\:lcg} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template std::vector lcg (const int & {\i seed}, const int & {\i mod}, const int & {\i mult}, const int & {\i incr}, const int & {\i count})}} +\par +{\bkmkstart AAAAAAAABR} +{\bkmkend AAAAAAAABR} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Linear Congruential Generator. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i seed} \cell }{Seed. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i mod} \cell }{Modulus. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i mult} \cell }{Multiplier. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i incr} \cell }{Increment. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i count} \cell }{Count of generated numbers.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Vector of generated numbers. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/metropolisHastings.h File Reference\par \pard\plain +{\tc\tcl2 \v src/metropolisHastings.h} +{\xe \v src/metropolisHastings.h} +{\bkmkstart AAAAAAAABS} +{\bkmkend AAAAAAAABS} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Metropolis-Hastings algorithm. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include "statistics.h"}\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template std::vector< T > {\b generate} (const std::function< T(T)> &target, const unsigned int &count, const unsigned int &burn_in_period)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Metropolis-Hastings algorithm. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Metropolis-Hastings algorithm. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Metropolis-Hastings Algorithm is a Markov chain Monte Carlo (MCMC) method for obtaining a sequence of random samples from a probability distribution from which direct sampling is difficult. This sequence can be used to approximate the distribution or to compute an integral.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v generate\:metropolisHastings.h} +{\xe \v metropolisHastings.h\:generate} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template std::vector generate (const std::function< T(T)> & {\i target}, const unsigned int & {\i count}, const unsigned int & {\i burn_in_period})}} +\par +{\bkmkstart AAAAAAAABT} +{\bkmkend AAAAAAAABT} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Metropolis-Hastings algorithm. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i target} \cell }{The target distribution. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i count} \cell }{Count of generated numbers. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i burn_in_period} \cell }{Burn-in period.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Vector of generated numbers. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/numericalIntegration.h File Reference\par \pard\plain +{\tc\tcl2 \v src/numericalIntegration.h} +{\xe \v src/numericalIntegration.h} +{\bkmkstart AAAAAAAABU} +{\bkmkend AAAAAAAABU} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Numerical integration methods. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include "statistics.h"}\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b compositeSimpsons} (const T &a, const T &b, const unsigned long &n, const std::function< T(T)> &func)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Composite Simpson\'92s Integration. }{ +}\par +}\par} +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b doubleIntegral} (const T &a, const T &b, const unsigned long &m, const unsigned long &n, const std::function< T(T)> &c, const std::function< T(T)> &d, const std::function< T(T, T)> &func)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Double Simpson\'92s Integration. }{ +}\par +}\par} +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b monteCarloIntegration} (const T &a, const T &b, const unsigned long &n, std::function< T(T)> &func)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Monte-Carlo Integration. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Numerical integration methods. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v compositeSimpsons\:numericalIntegration.h} +{\xe \v numericalIntegration.h\:compositeSimpsons} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T compositeSimpsons (const T & {\i a}, const T & {\i b}, const unsigned long & {\i n}, const std::function< T(T)> & {\i func})}} +\par +{\bkmkstart AAAAAAAABV} +{\bkmkend AAAAAAAABV} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Composite Simpson\'92s Integration. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Composite Simpson is a method for the numerical approximation of definite integrals.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i a} \cell }{Endpoint. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i b} \cell }{Endpoint. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n} \cell }{Iteration count. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i func} \cell }{The function that will be integrated.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Approximation to integral. \par +}}} +{\xe \v doubleIntegral\:numericalIntegration.h} +{\xe \v numericalIntegration.h\:doubleIntegral} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T doubleIntegral (const T & {\i a}, const T & {\i b}, const unsigned long & {\i m}, const unsigned long & {\i n}, const std::function< T(T)> & {\i c}, const std::function< T(T)> & {\i d}, const std::function< T(T, T)> & {\i func})}} +\par +{\bkmkstart AAAAAAAABW} +{\bkmkend AAAAAAAABW} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Double Simpson\'92s Integration. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Double Simpson is a method for the numerical approximation of double integrals.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i a} \cell }{Endpoint. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i b} \cell }{Endpoint. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i m} \cell }{Iteration count. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n} \cell }{Iteration count. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i c} \cell }{A function. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i d} \cell }{A function. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i func} \cell }{The function that will be integrated.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Approximation to integral. \par +}}} +{\xe \v monteCarloIntegration\:numericalIntegration.h} +{\xe \v numericalIntegration.h\:monteCarloIntegration} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T monteCarloIntegration (const T & {\i a}, const T & {\i b}, const unsigned long & {\i n}, std::function< T(T)> & {\i func})}} +\par +{\bkmkstart AAAAAAAABX} +{\bkmkend AAAAAAAABX} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Monte-Carlo Integration. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Monte-Carlo Integration is a technique for numerical integration using random numbers. It is a particular Monte Carlo method that numerically computes a definite integral.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i a} \cell }{Endpoint. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i b} \cell }{Endpoint. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i n} \cell }{Iteration count. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i func} \cell }{The function that will be integrated.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Approximation to integral. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/rungeKutta.h File Reference\par \pard\plain +{\tc\tcl2 \v src/rungeKutta.h} +{\xe \v src/rungeKutta.h} +{\bkmkstart AAAAAAAABY} +{\bkmkend AAAAAAAABY} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Runge-Kutta Order Four. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid + +void {\b formattedPrint} (long double t, long double w){\bkmkstart AAAAAAAABZ} +{\bkmkend AAAAAAAABZ} +\par +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b RK4} (const T &a, const T &b, const unsigned int &N, const T &init, const std::function< T(T, T)> &func)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Runge-Kutta Order Four. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Runge-Kutta Order Four. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Runge-Kutta methods are a family of implicit and explicit iterative methods, which include the well-known routine called the Euler Method, used in temporal discretization for the approximate solutions of ordinary differential equations.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v RK4\:rungeKutta.h} +{\xe \v rungeKutta.h\:RK4} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T RK4 (const T & {\i a}, const T & {\i b}, const unsigned int & {\i N}, const T & {\i init}, const std::function< T(T, T)> & {\i func})}} +\par +{\bkmkstart AAAAAAAACA} +{\bkmkend AAAAAAAACA} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Runge-Kutta Order Four. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i a} \cell }{Endpoint. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i b} \cell }{Endpoint. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i N} \cell }{Iteration count. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i init} \cell }{Initial condition. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i func} \cell }{A function.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid Approximation to exact solution. \par +}}} +\par \pard\plain + +\pard\plain \sect\sbkpage +\s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +\pard\plain \s2\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\kerning28\cgrid +src/statistics.h File Reference\par \pard\plain +{\tc\tcl2 \v src/statistics.h} +{\xe \v src/statistics.h} +{\bkmkstart AAAAAAAACB} +{\bkmkend AAAAAAAACB} +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Statistics related functions. }}\par +{ +\pard\plain \s18\widctlpar\fs22\cgrid {\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +{\f2 #include }\par +} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Functions\par +\pard\plain + +{ +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b runif} (const T &a=0, const T &b=1)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Uniform number generator. }{ +}\par +}\par} +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b rnorm} (const T &mean=0, const T &sd=1)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Normal number generator with Box\'96Muller transform. }{ +}\par +}\par} +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +template T {\b pchisq} (const T &stat, const unsigned int &k)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Chi-Squared distribution. }{ +}\par +}\par} +\pard\plain \s120\fi-360\li360\widctlpar\jclisttab\tx360{\*\pn \pnlvlbody\ilvl0\ls1\pnrnot0\pndec }\ls1\adjustright \fs20\cgrid +bool {\b jb_test} (const std::vector< long double > &x)\par +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid {\i {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Jarque\'96Bera test. }{ +}\par +}\par} +} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Detailed Description\par +\pard\plain +{ +\pard\plain \s17\sa60\sb30\widctlpar\qj \fs22\cgrid {\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Statistics related functions. \par +}{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Author:\par}\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid Murat Koptur {\f2 mkoptur3@gmail.com}\par +}Last updated: 22/Jan/2019. \par +}} +{\pard\widctlpar\brdrb\brdrs\brdrw5\brsp20 \adjustright \par} +\pard\plain \s3\sb240\sa60\keepn\widctlpar\adjustright \b\f1\cgrid +Function Documentation\par +\pard\plain +{\xe \v jb_test\:statistics.h} +{\xe \v statistics.h\:jb_test} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +bool jb_test (const std::vector< long double > & {\i x})}} +\par +{\bkmkstart AAAAAAAACC} +{\bkmkend AAAAAAAACC} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Jarque\'96Bera test. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Jarque\'96Bera test is a goodness-of-fit test of whether sample data have the skewness and kurtosis matching a normal distribution.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i x} \cell }{Vector of numbers.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid A boolean which indicates that x is normally distributed or not. \par +}}} +{\xe \v pchisq\:statistics.h} +{\xe \v statistics.h\:pchisq} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T pchisq (const T & {\i stat}, const unsigned int & {\i k})}} +\par +{\bkmkstart AAAAAAAACD} +{\bkmkend AAAAAAAACD} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Chi-Squared distribution. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i stat} \cell }{Test statistic. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i k} \cell }{Degrees of freedom.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid A probability. \par +}}} +{\xe \v rnorm\:statistics.h} +{\xe \v statistics.h\:rnorm} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T rnorm (const T & {\i mean} = {\f2 0}, const T & {\i sd} = {\f2 1})}} +\par +{\bkmkstart AAAAAAAACE} +{\bkmkend AAAAAAAACE} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Normal number generator with Box\'96Muller transform. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Box\'96Muller transform is a pseudo-random number sampling method for generating pairs of independent, standard, normally distributed (zero expectation, unit variance) random numbers, given a source of uniformly distributed random numbers.\par +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i mean} \cell }{Mean of distribution. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i sd} \cell }{Standart deviation of distribution.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid A random number. \par +}}} +{\xe \v runif\:statistics.h} +{\xe \v statistics.h\:runif} +\pard\plain \s4\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs20\cgrid { +{\b +template T runif (const T & {\i a} = {\f2 0}, const T & {\i b} = {\f2 1})}} +\par +{\bkmkstart AAAAAAAACF} +{\bkmkend AAAAAAAACF} +{ +\pard\plain \s61\li360\sa60\sb30\qj\widctlpar\qj\adjustright \fs20\cgrid +\par +{ +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +Uniform number generator. }}\par +{\s17\sa60\sb30\widctlpar\qj \fs22\cgrid +{\par +{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Parameters:\par} +\pard\plain \s81\li360\widctlpar\ql\adjustright \fs20\cgrid \trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i a} \cell }{Lower bound. \cell } +{\row } +\trowd \trgaph108\trleft426\tblind426\trbrdrt\brdrs\brdrw10\brdrcf15 \trbrdrl\brdrs\brdrw10\brdrcf15 \trbrdrb\brdrs\brdrw10\brdrcf15 \trbrdrr\brdrs\brdrw10\brdrcf15 \trbrdrh\brdrs\brdrw10\brdrcf15 \trbrdrv\brdrs\brdrw10\brdrcf15 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx2187 +\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf15 \clbrdrl\brdrs\brdrw10\brdrcf15 \clbrdrb\brdrs\brdrw10\brdrcf15 \clbrdrr \brdrs\brdrw10\brdrcf15 \cltxlrtb \cellx8748 +\pard \widctlpar\intbl\adjustright +{{\i b} \cell }{Upper bound.\cell } +{\row } +} +{{\s5\sb90\sa30\keepn\widctlpar\adjustright \b\f1\fs20\cgrid +Returns:\par}\pard\plain \s82\li720\widctlpar\ql\adjustright \fs20\cgrid A random number between [a, b]. \par +}}} + +\pard\plain \sect\sbkpage +\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid +\s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs36\kerning36\cgrid Index\par +\pard\plain +{\tc \v Index} +{\field\fldedit {\*\fldinst INDEX \\c2 \\*MERGEFORMAT}{\fldrslt INDEX}} +} \ No newline at end of file diff --git a/docs/runge_kutta_8h.html b/docs/runge_kutta_8h.html index 7d9b6a4..10b634c 100644 --- a/docs/runge_kutta_8h.html +++ b/docs/runge_kutta_8h.html @@ -104,9 +104,13 @@
long double monteCarloIntegration T monteCarloIntegration (const long double & const T &  a,
const long double & const T &  b,
std::function< long double(long double)> & std::function< T(T)> &  func 
- - - + + + + + +

Functions

long double RK4 (const long double &a, const long double &b, const unsigned int &N, const long double &init, const std::function< long double(long double, long double)> &func)
 Runge-Kutta Order Four. More...
 
+void formattedPrint (long double t, long double w)
 
template<typename T = long double>
RK4 (const T &a, const T &b, const unsigned int &N, const T &init, const std::function< T(T, T)> &func)
 Runge-Kutta Order Four. More...
 

Detailed Description

Runge-Kutta Order Four.

@@ -114,22 +118,24 @@
Author
Murat Koptur mkopt.nosp@m.ur3@.nosp@m.gmail.nosp@m..com

Last updated: 22/Jan/2019.

Function Documentation

- -

◆ RK4()

+ +

◆ RK4()

+
+template<typename T = long double>
- + - + - + @@ -141,13 +147,13 @@

- + - + diff --git a/docs/runge_kutta_8h.js b/docs/runge_kutta_8h.js index 3c5026f..0507255 100644 --- a/docs/runge_kutta_8h.js +++ b/docs/runge_kutta_8h.js @@ -1,4 +1,5 @@ var runge_kutta_8h = [ - [ "RK4", "runge_kutta_8h.html#a9255c9662ed42d1740a1c223b8581d98", null ] + [ "formattedPrint", "runge_kutta_8h.html#a8aa61474fe715e80f13ff7b946ac55d1", null ], + [ "RK4", "runge_kutta_8h.html#a24a416ea1925a669f4887e06e071d562", null ] ]; \ No newline at end of file diff --git a/docs/runge_kutta_8h_source.html b/docs/runge_kutta_8h_source.html index f3eafa9..e625275 100644 --- a/docs/runge_kutta_8h_source.html +++ b/docs/runge_kutta_8h_source.html @@ -90,7 +90,7 @@
rungeKutta.h
-Go to the documentation of this file.
1 
18 #ifndef RUNGEKUTTA_H
19 #define RUNGEKUTTA_H
20 
21 #include <stdio.h>
22 #include <cmath>
23 #include <functional>
24 #include <iostream>
25 
38 long double RK4(
39  const long double &a, const long double &b, const unsigned int &N,
40  const long double &init,
41  const std::function<long double(long double, long double)> &func);
42 
43 #endif /* RUNGEKUTTA_H */
long double RK4(const long double &a, const long double &b, const unsigned int &N, const long double &init, const std::function< long double(long double, long double)> &func)
Runge-Kutta Order Four.
Definition: rungeKutta.cpp:34
+Go to the documentation of this file.
1 
18 #ifndef RUNGEKUTTA_H
19 #define RUNGEKUTTA_H
20 
21 #include <stdio.h>
22 #include <cmath>
23 #include <functional>
24 #include <iostream>
25 
26 void formattedPrint(long double t, long double w) {
27  std::cout << t << "\t" << w << std::endl;
28 }
29 
42 template <typename T = long double>
43 T RK4(const T &a, const T &b, const unsigned int &N, const T &init,
44  const std::function<T(T, T)> &func) {
45  // STEP 1
46  auto h = (b - a) / N;
47  auto t = a;
48  auto w = init;
49  formattedPrint(t, w);
50  // STEP 2
51  for (auto i = 1; i <= N; i++) {
52  // STEP 3
53  auto K1 = h * func(t, w);
54  auto K2 = h * func(t + h / 2, w + K1 / 2);
55  auto K3 = h * func(t + h / 2, w + K2 / 2);
56  auto K4 = h * func(t + h, w + K3);
57  // STEP 4
58  w += (K1 + 2 * K2 + 2 * K3 + K4) / 6;
59  t = a + i * h;
60  // STEP 5
61  formattedPrint(t, w);
62  }
63  return w;
64 }
65 
66 #endif /* RUNGEKUTTA_H */
T RK4(const T &a, const T &b, const unsigned int &N, const T &init, const std::function< T(T, T)> &func)
Runge-Kutta Order Four.
Definition: rungeKutta.h:43
diff --git a/docs/search/all_2.js b/docs/search/all_2.js index ad43aae..b9dcfae 100644 --- a/docs/search/all_2.js +++ b/docs/search/all_2.js @@ -2,6 +2,6 @@ var searchData= [ ['calc_5fpi',['calc_pi',['../brent_salamin_formula_8h.html#a3b5f7732aa9855314ff5e7c98dca91b1',1,'brentSalaminFormula.h']]], ['complex',['Complex',['../discrete_fourier_transform_8h.html#a710b388b1d92514f461cb65049859d67',1,'discreteFourierTransform.h']]], - ['compositesimpsons',['compositeSimpsons',['../_numerical_integration_8cpp.html#aa6efda2fcf775fc079c9c4fc809b035e',1,'compositeSimpsons(const long double &a, const long double &b, const unsigned long &n, const std::function< long double(long double)> &func): NumericalIntegration.cpp'],['../numerical_integration_8h.html#aa6efda2fcf775fc079c9c4fc809b035e',1,'compositeSimpsons(const long double &a, const long double &b, const unsigned long &n, const std::function< long double(long double)> &func): NumericalIntegration.cpp']]], + ['compositesimpsons',['compositeSimpsons',['../numerical_integration_8h.html#a2a49b6efd60f3f4bd9b132455392127a',1,'numericalIntegration.h']]], ['cvec',['CVec',['../discrete_fourier_transform_8h.html#a37973646ed6a7ed0b0cf2287bdaef0e8',1,'discreteFourierTransform.h']]] ]; diff --git a/docs/search/all_3.js b/docs/search/all_3.js index 639ec4d..c553ac7 100644 --- a/docs/search/all_3.js +++ b/docs/search/all_3.js @@ -5,7 +5,7 @@ var searchData= ['devrandom_2eh',['devrandom.h',['../devrandom_8h.html',1,'']]], ['dft',['dft',['../discrete_fourier_transform_8h.html#aba405a29a7c12bd7d8b996c96978c880',1,'discreteFourierTransform.h']]], ['discretefouriertransform_2eh',['discreteFourierTransform.h',['../discrete_fourier_transform_8h.html',1,'']]], - ['doubleintegral',['doubleIntegral',['../_numerical_integration_8cpp.html#a2c0b0418fa5b1481669d937b005c92b6',1,'doubleIntegral(const long double &a, const long double &b, const unsigned long &m, const unsigned long &n, const std::function< long double(long double)> &c, const std::function< long double(long double)> &d, const std::function< long double(long double, long double)> &func): NumericalIntegration.cpp'],['../numerical_integration_8h.html#a2c0b0418fa5b1481669d937b005c92b6',1,'doubleIntegral(const long double &a, const long double &b, const unsigned long &m, const unsigned long &n, const std::function< long double(long double)> &c, const std::function< long double(long double)> &d, const std::function< long double(long double, long double)> &func): NumericalIntegration.cpp']]], + ['doubleintegral',['doubleIntegral',['../numerical_integration_8h.html#a8a2700261385eec68fa80882704ea6de',1,'numericalIntegration.h']]], ['dual',['Dual',['../struct_dual.html',1,'']]], ['dualnumbers_2eh',['dualNumbers.h',['../dual_numbers_8h.html',1,'']]] ]; diff --git a/docs/search/all_5.js b/docs/search/all_5.js index 3880f7d..57d962b 100644 --- a/docs/search/all_5.js +++ b/docs/search/all_5.js @@ -2,8 +2,7 @@ var searchData= [ ['g',['g',['../integer_factorization_8h.html#a04c9bfd9ad8855a08d4a860652560e76',1,'integerFactorization.h']]], ['gcd',['gcd',['../integer_factorization_8h.html#a6d0c00ce731e98f3789b4f14ce95cf85',1,'integerFactorization.h']]], - ['generate',['generate',['../metropolis_hastings_8cpp.html#ad3101184c27d8806759d0823af13489b',1,'generate(const std::function< long double(long double)> &target, const unsigned int &count, const unsigned int &burn_in_period): metropolisHastings.cpp'],['../metropolis_hastings_8h.html#ad3101184c27d8806759d0823af13489b',1,'generate(const std::function< long double(long double)> &target, const unsigned int &count, const unsigned int &burn_in_period): metropolisHastings.cpp']]], - ['goldensectionsearch',['GoldenSectionSearch',['../golden_section_search_8cpp.html#a92b3f1ee0a763faf7e75bf4169ee9de3',1,'GoldenSectionSearch(long double a, long double b, const long double &tol, const std::function< long double(long double)> &func): goldenSectionSearch.cpp'],['../golden_section_search_8h.html#a92b3f1ee0a763faf7e75bf4169ee9de3',1,'GoldenSectionSearch(long double a, long double b, const long double &tol, const std::function< long double(long double)> &func): goldenSectionSearch.cpp']]], - ['goldensectionsearch_2ecpp',['goldenSectionSearch.cpp',['../golden_section_search_8cpp.html',1,'']]], + ['generate',['generate',['../metropolis_hastings_8h.html#a679aa5f574c9cae53e917238746133df',1,'metropolisHastings.h']]], + ['goldensectionsearch',['GoldenSectionSearch',['../golden_section_search_8h.html#a68d217c205739ac83c123723b3bb8a78',1,'goldenSectionSearch.h']]], ['goldensectionsearch_2eh',['goldenSectionSearch.h',['../golden_section_search_8h.html',1,'']]] ]; diff --git a/docs/search/all_7.js b/docs/search/all_7.js index 43e220d..af491c6 100644 --- a/docs/search/all_7.js +++ b/docs/search/all_7.js @@ -1,4 +1,4 @@ var searchData= [ - ['jb_5ftest',['jb_test',['../statistics_8cpp.html#a2b05c840d8c2f659d0e0985fb6cad65a',1,'jb_test(const std::vector< long double > &x): statistics.cpp'],['../statistics_8h.html#a2b05c840d8c2f659d0e0985fb6cad65a',1,'jb_test(const std::vector< long double > &x): statistics.cpp']]] + ['jb_5ftest',['jb_test',['../statistics_8h.html#a2b05c840d8c2f659d0e0985fb6cad65a',1,'statistics.h']]] ]; diff --git a/docs/search/all_8.js b/docs/search/all_8.js index 15d74bd..a0defe8 100644 --- a/docs/search/all_8.js +++ b/docs/search/all_8.js @@ -2,7 +2,6 @@ var searchData= [ ['lagrangeinterpolation_2eh',['lagrangeInterpolation.h',['../lagrange_interpolation_8h.html',1,'']]], ['lagrangepoly',['lagrangePoly',['../lagrange_interpolation_8h.html#aad726fcf5685b281362fd5b8339a7345',1,'lagrangeInterpolation.h']]], - ['lcg',['lcg',['../lcg_8cpp.html#af6d01b7bf51eb2d0133955f7c70e4179',1,'lcg(const int &seed, const int &mod, const int &mult, const int &incr, const int &count): lcg.cpp'],['../lcg_8h.html#af6d01b7bf51eb2d0133955f7c70e4179',1,'lcg(const int &seed, const int &mod, const int &mult, const int &incr, const int &count): lcg.cpp']]], - ['lcg_2ecpp',['lcg.cpp',['../lcg_8cpp.html',1,'']]], + ['lcg',['lcg',['../lcg_8h.html#aedbaa5d71f32ced097260807afd850e5',1,'lcg.h']]], ['lcg_2eh',['lcg.h',['../lcg_8h.html',1,'']]] ]; diff --git a/docs/search/all_9.js b/docs/search/all_9.js index b888b9e..1778546 100644 --- a/docs/search/all_9.js +++ b/docs/search/all_9.js @@ -1,6 +1,5 @@ var searchData= [ - ['metropolishastings_2ecpp',['metropolisHastings.cpp',['../metropolis_hastings_8cpp.html',1,'']]], ['metropolishastings_2eh',['metropolisHastings.h',['../metropolis_hastings_8h.html',1,'']]], - ['montecarlointegration',['monteCarloIntegration',['../_numerical_integration_8cpp.html#a017cb13f34621723a92a789d14565f83',1,'monteCarloIntegration(const long double &a, const long double &b, const unsigned long &n, std::function< long double(long double)> &func): NumericalIntegration.cpp'],['../numerical_integration_8h.html#a017cb13f34621723a92a789d14565f83',1,'monteCarloIntegration(const long double &a, const long double &b, const unsigned long &n, std::function< long double(long double)> &func): NumericalIntegration.cpp']]] + ['montecarlointegration',['monteCarloIntegration',['../numerical_integration_8h.html#a032561911785237d600ba4bd287f6f05',1,'numericalIntegration.h']]] ]; diff --git a/docs/search/all_a.js b/docs/search/all_a.js index 11e87b8..fcfb25a 100644 --- a/docs/search/all_a.js +++ b/docs/search/all_a.js @@ -1,5 +1,4 @@ var searchData= [ - ['numericalintegration_2ecpp',['NumericalIntegration.cpp',['../_numerical_integration_8cpp.html',1,'']]], ['numericalintegration_2eh',['numericalIntegration.h',['../numerical_integration_8h.html',1,'']]] ]; diff --git a/docs/search/all_b.js b/docs/search/all_b.js index 21b9b11..4be7071 100644 --- a/docs/search/all_b.js +++ b/docs/search/all_b.js @@ -1,5 +1,5 @@ var searchData= [ ['p',['P',['../bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50',1,'bbpTypeFormula.h']]], - ['pchisq',['pchisq',['../statistics_8cpp.html#a134529a21f4976c167ca97eaaf310a3e',1,'statistics.cpp']]] + ['pchisq',['pchisq',['../statistics_8h.html#a4368c6ff543bcea59b8608f494f55651',1,'statistics.h']]] ]; diff --git a/docs/search/all_c.js b/docs/search/all_c.js index c7f8bd5..32f9aa3 100644 --- a/docs/search/all_c.js +++ b/docs/search/all_c.js @@ -2,9 +2,8 @@ var searchData= [ ['result',['Result',['../struct_result.html',1,'']]], ['rho',['rho',['../integer_factorization_8h.html#a78298440d6bfc9f2cc7eb1dc790dc429',1,'integerFactorization.h']]], - ['rk4',['RK4',['../runge_kutta_8cpp.html#a9255c9662ed42d1740a1c223b8581d98',1,'RK4(const long double &a, const long double &b, const unsigned int &N, const long double &init, const std::function< long double(long double, long double)> &func): rungeKutta.cpp'],['../runge_kutta_8h.html#a9255c9662ed42d1740a1c223b8581d98',1,'RK4(const long double &a, const long double &b, const unsigned int &N, const long double &init, const std::function< long double(long double, long double)> &func): rungeKutta.cpp']]], - ['rnorm',['rnorm',['../statistics_8cpp.html#a1994b2d115f8daaab6cf904763fc2846',1,'rnorm(const long double &mean, const long double &sd): statistics.cpp'],['../statistics_8h.html#adbc26f30c08787855613161d64715894',1,'rnorm(const long double &mean=0, const long double &sd=1): statistics.cpp']]], - ['rungekutta_2ecpp',['rungeKutta.cpp',['../runge_kutta_8cpp.html',1,'']]], + ['rk4',['RK4',['../runge_kutta_8h.html#a24a416ea1925a669f4887e06e071d562',1,'rungeKutta.h']]], + ['rnorm',['rnorm',['../statistics_8h.html#ad96ad8747ff6dabc632d0e262c9c7bb2',1,'statistics.h']]], ['rungekutta_2eh',['rungeKutta.h',['../runge_kutta_8h.html',1,'']]], - ['runif',['runif',['../statistics_8cpp.html#a6023a4811d245e4abe3319d6630ece01',1,'runif(const long double &a, const long double &b): statistics.cpp'],['../statistics_8h.html#a0aeb5d9b565f5850b4084a0e6904ccf5',1,'runif(const long double &a=0, const long double &b=1): statistics.cpp']]] + ['runif',['runif',['../statistics_8h.html#a99282c9573327898307cbd3492de0bdc',1,'statistics.h']]] ]; diff --git a/docs/search/all_d.js b/docs/search/all_d.js index 97794e5..812dbd7 100644 --- a/docs/search/all_d.js +++ b/docs/search/all_d.js @@ -1,5 +1,4 @@ var searchData= [ - ['statistics_2ecpp',['statistics.cpp',['../statistics_8cpp.html',1,'']]], ['statistics_2eh',['statistics.h',['../statistics_8h.html',1,'']]] ]; diff --git a/docs/search/files_3.js b/docs/search/files_3.js index 6a1d566..3557c86 100644 --- a/docs/search/files_3.js +++ b/docs/search/files_3.js @@ -1,5 +1,4 @@ var searchData= [ - ['goldensectionsearch_2ecpp',['goldenSectionSearch.cpp',['../golden_section_search_8cpp.html',1,'']]], ['goldensectionsearch_2eh',['goldenSectionSearch.h',['../golden_section_search_8h.html',1,'']]] ]; diff --git a/docs/search/files_5.js b/docs/search/files_5.js index a95ef0d..7369b4f 100644 --- a/docs/search/files_5.js +++ b/docs/search/files_5.js @@ -1,6 +1,5 @@ var searchData= [ ['lagrangeinterpolation_2eh',['lagrangeInterpolation.h',['../lagrange_interpolation_8h.html',1,'']]], - ['lcg_2ecpp',['lcg.cpp',['../lcg_8cpp.html',1,'']]], ['lcg_2eh',['lcg.h',['../lcg_8h.html',1,'']]] ]; diff --git a/docs/search/files_6.js b/docs/search/files_6.js index 83c1fa1..199ca31 100644 --- a/docs/search/files_6.js +++ b/docs/search/files_6.js @@ -1,5 +1,4 @@ var searchData= [ - ['metropolishastings_2ecpp',['metropolisHastings.cpp',['../metropolis_hastings_8cpp.html',1,'']]], ['metropolishastings_2eh',['metropolisHastings.h',['../metropolis_hastings_8h.html',1,'']]] ]; diff --git a/docs/search/files_7.js b/docs/search/files_7.js index 11e87b8..fcfb25a 100644 --- a/docs/search/files_7.js +++ b/docs/search/files_7.js @@ -1,5 +1,4 @@ var searchData= [ - ['numericalintegration_2ecpp',['NumericalIntegration.cpp',['../_numerical_integration_8cpp.html',1,'']]], ['numericalintegration_2eh',['numericalIntegration.h',['../numerical_integration_8h.html',1,'']]] ]; diff --git a/docs/search/files_8.js b/docs/search/files_8.js index 67241f6..f854e7c 100644 --- a/docs/search/files_8.js +++ b/docs/search/files_8.js @@ -1,5 +1,4 @@ var searchData= [ - ['rungekutta_2ecpp',['rungeKutta.cpp',['../runge_kutta_8cpp.html',1,'']]], ['rungekutta_2eh',['rungeKutta.h',['../runge_kutta_8h.html',1,'']]] ]; diff --git a/docs/search/files_9.js b/docs/search/files_9.js index 97794e5..812dbd7 100644 --- a/docs/search/files_9.js +++ b/docs/search/files_9.js @@ -1,5 +1,4 @@ var searchData= [ - ['statistics_2ecpp',['statistics.cpp',['../statistics_8cpp.html',1,'']]], ['statistics_2eh',['statistics.h',['../statistics_8h.html',1,'']]] ]; diff --git a/docs/search/functions_1.js b/docs/search/functions_1.js index bc14f43..49f2e2b 100644 --- a/docs/search/functions_1.js +++ b/docs/search/functions_1.js @@ -1,5 +1,5 @@ var searchData= [ ['calc_5fpi',['calc_pi',['../brent_salamin_formula_8h.html#a3b5f7732aa9855314ff5e7c98dca91b1',1,'brentSalaminFormula.h']]], - ['compositesimpsons',['compositeSimpsons',['../_numerical_integration_8cpp.html#aa6efda2fcf775fc079c9c4fc809b035e',1,'compositeSimpsons(const long double &a, const long double &b, const unsigned long &n, const std::function< long double(long double)> &func): NumericalIntegration.cpp'],['../numerical_integration_8h.html#aa6efda2fcf775fc079c9c4fc809b035e',1,'compositeSimpsons(const long double &a, const long double &b, const unsigned long &n, const std::function< long double(long double)> &func): NumericalIntegration.cpp']]] + ['compositesimpsons',['compositeSimpsons',['../numerical_integration_8h.html#a2a49b6efd60f3f4bd9b132455392127a',1,'numericalIntegration.h']]] ]; diff --git a/docs/search/functions_2.js b/docs/search/functions_2.js index 0a85ccd..bc3072e 100644 --- a/docs/search/functions_2.js +++ b/docs/search/functions_2.js @@ -2,5 +2,5 @@ var searchData= [ ['devrandom',['devrandom',['../devrandom_8h.html#ad3a63441da329a84f7ceb34aa1487400',1,'devrandom.h']]], ['dft',['dft',['../discrete_fourier_transform_8h.html#aba405a29a7c12bd7d8b996c96978c880',1,'discreteFourierTransform.h']]], - ['doubleintegral',['doubleIntegral',['../_numerical_integration_8cpp.html#a2c0b0418fa5b1481669d937b005c92b6',1,'doubleIntegral(const long double &a, const long double &b, const unsigned long &m, const unsigned long &n, const std::function< long double(long double)> &c, const std::function< long double(long double)> &d, const std::function< long double(long double, long double)> &func): NumericalIntegration.cpp'],['../numerical_integration_8h.html#a2c0b0418fa5b1481669d937b005c92b6',1,'doubleIntegral(const long double &a, const long double &b, const unsigned long &m, const unsigned long &n, const std::function< long double(long double)> &c, const std::function< long double(long double)> &d, const std::function< long double(long double, long double)> &func): NumericalIntegration.cpp']]] + ['doubleintegral',['doubleIntegral',['../numerical_integration_8h.html#a8a2700261385eec68fa80882704ea6de',1,'numericalIntegration.h']]] ]; diff --git a/docs/search/functions_4.js b/docs/search/functions_4.js index 84c4ba8..c60c598 100644 --- a/docs/search/functions_4.js +++ b/docs/search/functions_4.js @@ -2,6 +2,6 @@ var searchData= [ ['g',['g',['../integer_factorization_8h.html#a04c9bfd9ad8855a08d4a860652560e76',1,'integerFactorization.h']]], ['gcd',['gcd',['../integer_factorization_8h.html#a6d0c00ce731e98f3789b4f14ce95cf85',1,'integerFactorization.h']]], - ['generate',['generate',['../metropolis_hastings_8cpp.html#ad3101184c27d8806759d0823af13489b',1,'generate(const std::function< long double(long double)> &target, const unsigned int &count, const unsigned int &burn_in_period): metropolisHastings.cpp'],['../metropolis_hastings_8h.html#ad3101184c27d8806759d0823af13489b',1,'generate(const std::function< long double(long double)> &target, const unsigned int &count, const unsigned int &burn_in_period): metropolisHastings.cpp']]], - ['goldensectionsearch',['GoldenSectionSearch',['../golden_section_search_8cpp.html#a92b3f1ee0a763faf7e75bf4169ee9de3',1,'GoldenSectionSearch(long double a, long double b, const long double &tol, const std::function< long double(long double)> &func): goldenSectionSearch.cpp'],['../golden_section_search_8h.html#a92b3f1ee0a763faf7e75bf4169ee9de3',1,'GoldenSectionSearch(long double a, long double b, const long double &tol, const std::function< long double(long double)> &func): goldenSectionSearch.cpp']]] + ['generate',['generate',['../metropolis_hastings_8h.html#a679aa5f574c9cae53e917238746133df',1,'metropolisHastings.h']]], + ['goldensectionsearch',['GoldenSectionSearch',['../golden_section_search_8h.html#a68d217c205739ac83c123723b3bb8a78',1,'goldenSectionSearch.h']]] ]; diff --git a/docs/search/functions_6.js b/docs/search/functions_6.js index 43e220d..af491c6 100644 --- a/docs/search/functions_6.js +++ b/docs/search/functions_6.js @@ -1,4 +1,4 @@ var searchData= [ - ['jb_5ftest',['jb_test',['../statistics_8cpp.html#a2b05c840d8c2f659d0e0985fb6cad65a',1,'jb_test(const std::vector< long double > &x): statistics.cpp'],['../statistics_8h.html#a2b05c840d8c2f659d0e0985fb6cad65a',1,'jb_test(const std::vector< long double > &x): statistics.cpp']]] + ['jb_5ftest',['jb_test',['../statistics_8h.html#a2b05c840d8c2f659d0e0985fb6cad65a',1,'statistics.h']]] ]; diff --git a/docs/search/functions_7.js b/docs/search/functions_7.js index 8689601..cc26991 100644 --- a/docs/search/functions_7.js +++ b/docs/search/functions_7.js @@ -1,5 +1,5 @@ var searchData= [ ['lagrangepoly',['lagrangePoly',['../lagrange_interpolation_8h.html#aad726fcf5685b281362fd5b8339a7345',1,'lagrangeInterpolation.h']]], - ['lcg',['lcg',['../lcg_8cpp.html#af6d01b7bf51eb2d0133955f7c70e4179',1,'lcg(const int &seed, const int &mod, const int &mult, const int &incr, const int &count): lcg.cpp'],['../lcg_8h.html#af6d01b7bf51eb2d0133955f7c70e4179',1,'lcg(const int &seed, const int &mod, const int &mult, const int &incr, const int &count): lcg.cpp']]] + ['lcg',['lcg',['../lcg_8h.html#aedbaa5d71f32ced097260807afd850e5',1,'lcg.h']]] ]; diff --git a/docs/search/functions_8.js b/docs/search/functions_8.js index 5b466c3..265e39c 100644 --- a/docs/search/functions_8.js +++ b/docs/search/functions_8.js @@ -1,4 +1,4 @@ var searchData= [ - ['montecarlointegration',['monteCarloIntegration',['../_numerical_integration_8cpp.html#a017cb13f34621723a92a789d14565f83',1,'monteCarloIntegration(const long double &a, const long double &b, const unsigned long &n, std::function< long double(long double)> &func): NumericalIntegration.cpp'],['../numerical_integration_8h.html#a017cb13f34621723a92a789d14565f83',1,'monteCarloIntegration(const long double &a, const long double &b, const unsigned long &n, std::function< long double(long double)> &func): NumericalIntegration.cpp']]] + ['montecarlointegration',['monteCarloIntegration',['../numerical_integration_8h.html#a032561911785237d600ba4bd287f6f05',1,'numericalIntegration.h']]] ]; diff --git a/docs/search/functions_9.js b/docs/search/functions_9.js index 21b9b11..4be7071 100644 --- a/docs/search/functions_9.js +++ b/docs/search/functions_9.js @@ -1,5 +1,5 @@ var searchData= [ ['p',['P',['../bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50',1,'bbpTypeFormula.h']]], - ['pchisq',['pchisq',['../statistics_8cpp.html#a134529a21f4976c167ca97eaaf310a3e',1,'statistics.cpp']]] + ['pchisq',['pchisq',['../statistics_8h.html#a4368c6ff543bcea59b8608f494f55651',1,'statistics.h']]] ]; diff --git a/docs/search/functions_a.js b/docs/search/functions_a.js index 3c54982..9be5a53 100644 --- a/docs/search/functions_a.js +++ b/docs/search/functions_a.js @@ -1,7 +1,7 @@ var searchData= [ ['rho',['rho',['../integer_factorization_8h.html#a78298440d6bfc9f2cc7eb1dc790dc429',1,'integerFactorization.h']]], - ['rk4',['RK4',['../runge_kutta_8cpp.html#a9255c9662ed42d1740a1c223b8581d98',1,'RK4(const long double &a, const long double &b, const unsigned int &N, const long double &init, const std::function< long double(long double, long double)> &func): rungeKutta.cpp'],['../runge_kutta_8h.html#a9255c9662ed42d1740a1c223b8581d98',1,'RK4(const long double &a, const long double &b, const unsigned int &N, const long double &init, const std::function< long double(long double, long double)> &func): rungeKutta.cpp']]], - ['rnorm',['rnorm',['../statistics_8cpp.html#a1994b2d115f8daaab6cf904763fc2846',1,'rnorm(const long double &mean, const long double &sd): statistics.cpp'],['../statistics_8h.html#adbc26f30c08787855613161d64715894',1,'rnorm(const long double &mean=0, const long double &sd=1): statistics.cpp']]], - ['runif',['runif',['../statistics_8cpp.html#a6023a4811d245e4abe3319d6630ece01',1,'runif(const long double &a, const long double &b): statistics.cpp'],['../statistics_8h.html#a0aeb5d9b565f5850b4084a0e6904ccf5',1,'runif(const long double &a=0, const long double &b=1): statistics.cpp']]] + ['rk4',['RK4',['../runge_kutta_8h.html#a24a416ea1925a669f4887e06e071d562',1,'rungeKutta.h']]], + ['rnorm',['rnorm',['../statistics_8h.html#ad96ad8747ff6dabc632d0e262c9c7bb2',1,'statistics.h']]], + ['runif',['runif',['../statistics_8h.html#a99282c9573327898307cbd3492de0bdc',1,'statistics.h']]] ]; diff --git a/docs/statistics_8h.html b/docs/statistics_8h.html index 16b0a10..ee66f00 100644 --- a/docs/statistics_8h.html +++ b/docs/statistics_8h.html @@ -98,18 +98,25 @@
#include <cmath>
#include <cstdlib>
#include <numeric>
+#include <random>
#include <vector>

Go to the source code of this file.

long double RK4 T RK4 (const long double & const T &  a,
const long double & const T &  b,
const long double & const T &  init,
const std::function< long double(long double, long double)> & const std::function< T(T, T)> &  func 
- - - - - - + + + + + + + + + + + + @@ -147,23 +154,65 @@

-

◆ rnorm()

+ +

◆ pchisq()

+
+template<typename T = long double>

Functions

long double runif (const long double &a=0, const long double &b=1)
 Uniform number generator. More...
 
long double rnorm (const long double &mean=0, const long double &sd=1)
 Normal number generator with Box–Muller transform. More...
 
template<typename T = long double>
runif (const T &a=0, const T &b=1)
 Uniform number generator. More...
 
template<typename T = long double>
rnorm (const T &mean=0, const T &sd=1)
 Normal number generator with Box–Muller transform. More...
 
template<typename T = long double>
pchisq (const T &stat, const unsigned int &k)
 Chi-Squared distribution. More...
 
bool jb_test (const std::vector< long double > &x)
 Jarque–Bera test. More...
 
- + - - + + - - + + + + + + + + +
long double rnorm T pchisq (const long double & mean, const T & stat,
const long double & sd const unsigned int & k 
)
+
+ +

Chi-Squared distribution.

+
Parameters
+ + + +
statTest statistic.
kDegrees of freedom.
+
+
+
Returns
A probability.
+ +
+
+ +

◆ rnorm()

+ +
+
+
+template<typename T = long double>
+ + + + + + + + + + + + @@ -186,23 +235,25 @@

-

◆ runif()

+ +

◆ runif()

+
+template<typename T = long double>

T rnorm (const T & mean = 0,
const T & sd = 1 
- + - - + + - - + + diff --git a/docs/statistics_8h.js b/docs/statistics_8h.js index 7ad85d3..a792fd8 100644 --- a/docs/statistics_8h.js +++ b/docs/statistics_8h.js @@ -1,6 +1,7 @@ var statistics_8h = [ [ "jb_test", "statistics_8h.html#a2b05c840d8c2f659d0e0985fb6cad65a", null ], - [ "rnorm", "statistics_8h.html#adbc26f30c08787855613161d64715894", null ], - [ "runif", "statistics_8h.html#a0aeb5d9b565f5850b4084a0e6904ccf5", null ] + [ "pchisq", "statistics_8h.html#a4368c6ff543bcea59b8608f494f55651", null ], + [ "rnorm", "statistics_8h.html#ad96ad8747ff6dabc632d0e262c9c7bb2", null ], + [ "runif", "statistics_8h.html#a99282c9573327898307cbd3492de0bdc", null ] ]; \ No newline at end of file diff --git a/docs/statistics_8h_source.html b/docs/statistics_8h_source.html index 12d4959..d683e6e 100644 --- a/docs/statistics_8h_source.html +++ b/docs/statistics_8h_source.html @@ -90,9 +90,10 @@
statistics.h
-Go to the documentation of this file.
1 
12 #ifndef STATISTICS_H
13 #define STATISTICS_H
14 
15 #include <cmath>
16 #include <cstdlib>
17 #include <numeric>
18 #include <vector>
19 
29 long double runif(const long double &a = 0, const long double &b = 1);
30 
46 long double rnorm(const long double &mean = 0, const long double &sd = 1);
47 
60 bool jb_test(const std::vector<long double> &x);
61 
62 #endif // STATISTICS_H
long double runif(const long double &a=0, const long double &b=1)
Uniform number generator.
Definition: statistics.cpp:23
-
long double rnorm(const long double &mean=0, const long double &sd=1)
Normal number generator with Box–Muller transform.
Definition: statistics.cpp:42
-
bool jb_test(const std::vector< long double > &x)
Jarque–Bera test.
Definition: statistics.cpp:76
+Go to the documentation of this file.
1 
12 #ifndef STATISTICS_H
13 #define STATISTICS_H
14 
15 #include <cmath>
16 #include <cstdlib>
17 #include <numeric>
18 #include <random>
19 #include <vector>
20 
30 template <typename T = long double>
31 T runif(const T &a = 0, const T &b = 1) {
32  return a + (b - a) * (rand() / ((T)(RAND_MAX) + 1));
33 }
34 
50 template <typename T = long double>
51 T rnorm(const T &mean = 0, const T &sd = 1) {
52  // Box-Muller transform
53  auto u = runif<T>(0, 1);
54  auto v = runif<T>(0, 1);
55  return sd * (std::sqrt(-2 * std::log(u)) * std::cos(2 * M_PI * v)) + mean;
56 }
57 
68 template <typename T = long double>
69 T pchisq(const T &stat, const unsigned int &k) {
70  return (1 / ((std::pow(2, k / 2) * std::tgamma(k / 2)))) *
71  std::pow(stat, k / 2 - 1) * std::exp(-stat / 2);
72 }
73 
86 bool jb_test(const std::vector<long double> &x) {
87  const unsigned long n = x.size();
88  auto m1 = std::accumulate(x.begin(), x.end(), 0.0) / n;
89  auto m2 = 0;
90  auto m3 = 0;
91  auto m4 = 0;
92  for (auto xi : x) {
93  m2 += std::pow(xi - m1, 2);
94  m3 += std::pow(xi - m1, 3);
95  m4 += std::pow(xi - m1, 4);
96  }
97  m2 /= n;
98  m3 /= n;
99  m4 /= n;
100 
101  auto S = std::pow(m3 / std::pow(m2, 3 / 2), 2);
102  auto K = m4 / std::pow(m2, 2);
103  auto stat = n * (S / 6 + std::pow(K - 3, 2) / 24);
104  auto p_val = 1 - pchisq(stat, 2);
105  return p_val > 0.05;
106 }
107 
108 #endif // STATISTICS_H
T pchisq(const T &stat, const unsigned int &k)
Chi-Squared distribution.
Definition: statistics.h:69
+
T rnorm(const T &mean=0, const T &sd=1)
Normal number generator with Box–Muller transform.
Definition: statistics.h:51
+
T runif(const T &a=0, const T &b=1)
Uniform number generator.
Definition: statistics.h:31
+
bool jb_test(const std::vector< long double > &x)
Jarque–Bera test.
Definition: statistics.h:86
long double runif T runif (const long double & a, const T & a = 0,
const long double & b const T & b = 1