Skip to content

Commit d6e1f28

Browse files
committed
new lib structure
1 parent 1018eda commit d6e1f28

File tree

164 files changed

+869
-6493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+869
-6493
lines changed

Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ WARN_LOGFILE =
813813
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
814814
# Note: If this tag is empty the current directory is searched.
815815

816-
INPUT = /Users/muratkoptur/Desktop/github/Cpp-Examples/src
816+
INPUT = /Users/muratkoptur/Desktop/github/Cpp-Examples/lib
817817

818818
# This tag can be used to specify the character encoding of the source files
819819
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -888,7 +888,7 @@ FILE_PATTERNS = *.c \
888888
# be searched for input files as well.
889889
# The default value is: NO.
890890

891-
RECURSIVE = NO
891+
RECURSIVE = YES
892892

893893
# The EXCLUDE tag can be used to specify files and/or directories that should be
894894
# excluded from the INPUT source files. This way you can easily exclude a

bin/tests

-5.13 MB
Binary file not shown.

clang-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22
find examples/ -iname *.h -o -iname *.cpp | xargs clang-format -i
3-
find src/ -iname *.h -o -iname *.cpp | xargs clang-format -i
3+
find lib/ -iname *.h -o -iname *.cpp | xargs clang-format -i
44
find tests/ -iname *.h -o -iname *.cpp | xargs clang-format -i

docs/annotated.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,13 @@
9191
</div><!--header-->
9292
<div class="contents">
9393
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
94-
<table class="directory">
95-
<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_data.html" target="_self">Data</a></td><td class="desc"></td></tr>
96-
<tr id="row_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_dual.html" target="_self">Dual</a></td><td class="desc"></td></tr>
97-
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_result.html" target="_self">Result</a></td><td class="desc">The struct that stores result </td></tr>
94+
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
95+
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><b>AutoDiff</b></td><td class="desc"></td></tr>
96+
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_auto_diff_1_1_dual.html" target="_self">Dual</a></td><td class="desc"></td></tr>
97+
<tr id="row_1_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_1_" class="arrow" onclick="toggleFolder('1_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><b>Interpolation</b></td><td class="desc"></td></tr>
98+
<tr id="row_1_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_interpolation_1_1_data.html" target="_self">Data</a></td><td class="desc"></td></tr>
99+
<tr id="row_2_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_2_" class="arrow" onclick="toggleFolder('2_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><b>RootFinding</b></td><td class="desc"></td></tr>
100+
<tr id="row_2_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_root_finding_1_1_result.html" target="_self">Result</a></td><td class="desc">The struct that stores result </td></tr>
98101
</table>
99102
</div><!-- directory -->
100103
</div><!-- contents -->

docs/annotated_dup.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
var annotated_dup =
22
[
3-
[ "Data", "struct_data.html", "struct_data" ],
4-
[ "Dual", "struct_dual.html", "struct_dual" ],
5-
[ "Result", "struct_result.html", "struct_result" ]
3+
[ "AutoDiff", null, [
4+
[ "Dual", "struct_auto_diff_1_1_dual.html", "struct_auto_diff_1_1_dual" ]
5+
] ],
6+
[ "Interpolation", null, [
7+
[ "Data", "struct_interpolation_1_1_data.html", "struct_interpolation_1_1_data" ]
8+
] ],
9+
[ "RootFinding", null, [
10+
[ "Result", "struct_root_finding_1_1_result.html", "struct_root_finding_1_1_result" ]
11+
] ]
612
];

docs/bbp_type_formula_8h.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
66
<meta name="generator" content="Doxygen 1.8.15"/>
77
<meta name="viewport" content="width=device-width, initial-scale=1"/>
8-
<title>Cpp Examples: src/bbpTypeFormula.h File Reference</title>
8+
<title>Cpp Examples: lib/numericCppExamples/bbpTypeFormula.h File Reference</title>
99
<link href="tabs.css" rel="stylesheet" type="text/css"/>
1010
<script type="text/javascript" src="jquery.js"></script>
1111
<script type="text/javascript" src="dynsections.js"></script>
@@ -103,10 +103,10 @@
103103
<table class="memberdecls">
104104
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
105105
Functions</h2></td></tr>
106-
<tr class="memitem:a97f17f569c57d68f3e40dc72557f7e50"><td class="memTemplParams" colspan="2">template&lt;typename T = long double&gt; </td></tr>
107-
<tr class="memitem:a97f17f569c57d68f3e40dc72557f7e50"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50">P</a> (const int &amp;s, const int &amp;b, const int &amp;n, const std::vector&lt; int &gt; &amp;A, const int &amp;n_iter)</td></tr>
108-
<tr class="memdesc:a97f17f569c57d68f3e40dc72557f7e50"><td class="mdescLeft">&#160;</td><td class="mdescRight">BPP Type formula calculation. <a href="#a97f17f569c57d68f3e40dc72557f7e50">More...</a><br /></td></tr>
109-
<tr class="separator:a97f17f569c57d68f3e40dc72557f7e50"><td class="memSeparator" colspan="2">&#160;</td></tr>
106+
<tr class="memitem:a295a4fb8eff7d64f770f896ae18d1f13"><td class="memTemplParams" colspan="2">template&lt;typename T = long double&gt; </td></tr>
107+
<tr class="memitem:a295a4fb8eff7d64f770f896ae18d1f13"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="bbp_type_formula_8h.html#a295a4fb8eff7d64f770f896ae18d1f13">Spigot::P</a> (const int &amp;s, const int &amp;b, const int &amp;n, const std::vector&lt; int &gt; &amp;A, const int &amp;n_iter)</td></tr>
108+
<tr class="memdesc:a295a4fb8eff7d64f770f896ae18d1f13"><td class="mdescLeft">&#160;</td><td class="mdescRight">BPP Type formula calculation. <a href="bbp_type_formula_8h.html#a295a4fb8eff7d64f770f896ae18d1f13">More...</a><br /></td></tr>
109+
<tr class="separator:a295a4fb8eff7d64f770f896ae18d1f13"><td class="memSeparator" colspan="2">&#160;</td></tr>
110110
</table>
111111
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
112112
<div class="textblock"><p>BPP Type formula calculation. </p>
@@ -115,16 +115,16 @@
115115
<dl class="section author"><dt>Author</dt><dd>Murat Koptur <a href="#" onclick="location.href='mai'+'lto:'+'mko'+'pt'+'ur3'+'@g'+'mai'+'l.'+'com'; return false;">mkopt<span style="display: none;">.nosp@m.</span>ur3@<span style="display: none;">.nosp@m.</span>gmail<span style="display: none;">.nosp@m.</span>.com</a></dd></dl>
116116
<p>Last updated: 22/Jan/2019. </p>
117117
</div><h2 class="groupheader">Function Documentation</h2>
118-
<a id="a97f17f569c57d68f3e40dc72557f7e50"></a>
119-
<h2 class="memtitle"><span class="permalink"><a href="#a97f17f569c57d68f3e40dc72557f7e50">&#9670;&nbsp;</a></span>P()</h2>
118+
<a id="file_a295a4fb8eff7d64f770f896ae18d1f13"></a>
119+
<h2 class="memtitle"><span class="permalink"><a href="#file_a295a4fb8eff7d64f770f896ae18d1f13">&#9670;&nbsp;</a></span>P()</h2>
120120

121121
<div class="memitem">
122122
<div class="memproto">
123123
<div class="memtemplate">
124124
template&lt;typename T = long double&gt; </div>
125125
<table class="memname">
126126
<tr>
127-
<td class="memname">T P </td>
127+
<td class="memname">T Spigot::P </td>
128128
<td>(</td>
129129
<td class="paramtype">const int &amp;&#160;</td>
130130
<td class="paramname"><em>s</em>, </td>
@@ -181,7 +181,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a97f17f569c57d68f3e40dc72
181181
<!-- start footer part -->
182182
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
183183
<ul>
184-
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="bbp_type_formula_8h.html">bbpTypeFormula.h</a></li>
184+
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_cac7b807d6b46cd49819c0e6d617cf50.html">numericCppExamples</a></li><li class="navelem"><a class="el" href="bbp_type_formula_8h.html">bbpTypeFormula.h</a></li>
185185
<li class="footer">Generated by
186186
<a href="http://www.doxygen.org/index.html">
187187
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>

docs/bbp_type_formula_8h.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var bbp_type_formula_8h =
22
[
3-
[ "P", "bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50", null ]
3+
[ "P", "bbp_type_formula_8h.html#a295a4fb8eff7d64f770f896ae18d1f13", null ]
44
];

docs/bbp_type_formula_8h_source.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
66
<meta name="generator" content="Doxygen 1.8.15"/>
77
<meta name="viewport" content="width=device-width, initial-scale=1"/>
8-
<title>Cpp Examples: src/bbpTypeFormula.h Source File</title>
8+
<title>Cpp Examples: lib/numericCppExamples/bbpTypeFormula.h Source File</title>
99
<link href="tabs.css" rel="stylesheet" type="text/css"/>
1010
<script type="text/javascript" src="jquery.js"></script>
1111
<script type="text/javascript" src="dynsections.js"></script>
@@ -90,13 +90,13 @@
9090
<div class="title">bbpTypeFormula.h</div> </div>
9191
</div><!--header-->
9292
<div class="contents">
93-
<a href="bbp_type_formula_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#ifndef BBPTYPEFORMULA_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#define BBPTYPEFORMULA_H</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = <span class="keywordtype">long</span> <span class="keywordtype">double</span>&gt;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50"> 44</a></span>&#160;T <a class="code" href="bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50">P</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;s, <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;b, <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;n, <span class="keyword">const</span> std::vector&lt;int&gt; &amp;A,</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;n_iter) {</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; assert(n == A.size());</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; T result = 0.0;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> k = 0; k &lt;= n_iter; k++) {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; T inv_bk = 1 / std::pow(b, k);</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; T inner_sum = 0.0;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> j = 1; j &lt;= n; j++) {</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; inner_sum += A.at(j - 1) / std::pow(n * k + j, s);</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; }</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; result += inv_bk * inner_sum;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; }</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;};</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor">#endif // BBPTYPEFORMULA_H</span></div><div class="ttc" id="bbp_type_formula_8h_html_a97f17f569c57d68f3e40dc72557f7e50"><div class="ttname"><a href="bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50">P</a></div><div class="ttdeci">T P(const int &amp;s, const int &amp;b, const int &amp;n, const std::vector&lt; int &gt; &amp;A, const int &amp;n_iter)</div><div class="ttdoc">BPP Type formula calculation.</div><div class="ttdef"><b>Definition:</b> bbpTypeFormula.h:44</div></div>
93+
<a href="bbp_type_formula_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#ifndef BBPTYPEFORMULA_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#define BBPTYPEFORMULA_H</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;cassert&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="keyword">namespace </span>Spigot {</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = <span class="keywordtype">long</span> <span class="keywordtype">double</span>&gt;</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="bbp_type_formula_8h.html#a295a4fb8eff7d64f770f896ae18d1f13"> 45</a></span>&#160;T <a class="code" href="bbp_type_formula_8h.html#a295a4fb8eff7d64f770f896ae18d1f13">P</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;s, <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;b, <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;n, <span class="keyword">const</span> std::vector&lt;int&gt; &amp;A,</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;n_iter) {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; assert(n == A.size());</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; T result = 0.0;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> k = 0; k &lt;= n_iter; k++) {</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; T inv_bk = 1 / std::pow(b, k);</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; T inner_sum = 0.0;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">auto</span> j = 1; j &lt;= n; j++) {</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; inner_sum += A.at(j - 1) / std::pow(n * k + j, s);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; result += inv_bk * inner_sum;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; }</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;}</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;} <span class="comment">// namespace Spigot</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor">#endif // BBPTYPEFORMULA_H</span></div><div class="ttc" id="bbp_type_formula_8h_html_a295a4fb8eff7d64f770f896ae18d1f13"><div class="ttname"><a href="bbp_type_formula_8h.html#a295a4fb8eff7d64f770f896ae18d1f13">Spigot::P</a></div><div class="ttdeci">T P(const int &amp;s, const int &amp;b, const int &amp;n, const std::vector&lt; int &gt; &amp;A, const int &amp;n_iter)</div><div class="ttdoc">BPP Type formula calculation.</div><div class="ttdef"><b>Definition:</b> bbpTypeFormula.h:45</div></div>
9494
</div><!-- fragment --></div><!-- contents -->
9595
</div><!-- doc-content -->
9696
<!-- start footer part -->
9797
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
9898
<ul>
99-
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="bbp_type_formula_8h.html">bbpTypeFormula.h</a></li>
99+
<li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_cac7b807d6b46cd49819c0e6d617cf50.html">numericCppExamples</a></li><li class="navelem"><a class="el" href="bbp_type_formula_8h.html">bbpTypeFormula.h</a></li>
100100
<li class="footer">Generated by
101101
<a href="http://www.doxygen.org/index.html">
102102
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>

0 commit comments

Comments
 (0)