Skip to content

Commit

Permalink
new lib structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtkp9993 committed Oct 16, 2019
1 parent 1018eda commit d6e1f28
Show file tree
Hide file tree
Showing 164 changed files with 869 additions and 6,493 deletions.
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

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

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

RECURSIVE = NO
RECURSIVE = YES

# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
Expand Down
Binary file removed bin/tests
Binary file not shown.
2 changes: 1 addition & 1 deletion clang-format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
find examples/ -iname *.h -o -iname *.cpp | xargs clang-format -i
find src/ -iname *.h -o -iname *.cpp | xargs clang-format -i
find lib/ -iname *.h -o -iname *.cpp | xargs clang-format -i
find tests/ -iname *.h -o -iname *.cpp | xargs clang-format -i
11 changes: 7 additions & 4 deletions docs/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
<table class="directory">
<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>
<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>
<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>
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
<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>
<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>
<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>
<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>
<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>
<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>
</table>
</div><!-- directory -->
</div><!-- contents -->
Expand Down
12 changes: 9 additions & 3 deletions docs/annotated_dup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
var annotated_dup =
[
[ "Data", "struct_data.html", "struct_data" ],
[ "Dual", "struct_dual.html", "struct_dual" ],
[ "Result", "struct_result.html", "struct_result" ]
[ "AutoDiff", null, [
[ "Dual", "struct_auto_diff_1_1_dual.html", "struct_auto_diff_1_1_dual" ]
] ],
[ "Interpolation", null, [
[ "Data", "struct_interpolation_1_1_data.html", "struct_interpolation_1_1_data" ]
] ],
[ "RootFinding", null, [
[ "Result", "struct_root_finding_1_1_result.html", "struct_root_finding_1_1_result" ]
] ]
];
18 changes: 9 additions & 9 deletions docs/bbp_type_formula_8h.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Cpp Examples: src/bbpTypeFormula.h File Reference</title>
<title>Cpp Examples: lib/numericCppExamples/bbpTypeFormula.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
Expand Down Expand Up @@ -103,10 +103,10 @@
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a97f17f569c57d68f3e40dc72557f7e50"><td class="memTemplParams" colspan="2">template&lt;typename T = long double&gt; </td></tr>
<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>
<tr class="memdesc:a97f17f569c57d68f3e40dc72557f7e50"><td class="mdescLeft">&#160;</td><td class="mdescRight">BPP Type formula calculation. <a href="#a97f17f569c57d68f3e40dc72557f7e50">More...</a><br /></td></tr>
<tr class="separator:a97f17f569c57d68f3e40dc72557f7e50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a295a4fb8eff7d64f770f896ae18d1f13"><td class="memTemplParams" colspan="2">template&lt;typename T = long double&gt; </td></tr>
<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>
<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>
<tr class="separator:a295a4fb8eff7d64f770f896ae18d1f13"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>BPP Type formula calculation. </p>
Expand All @@ -115,16 +115,16 @@
<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>
<p>Last updated: 22/Jan/2019. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a97f17f569c57d68f3e40dc72557f7e50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a97f17f569c57d68f3e40dc72557f7e50">&#9670;&nbsp;</a></span>P()</h2>
<a id="file_a295a4fb8eff7d64f770f896ae18d1f13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_a295a4fb8eff7d64f770f896ae18d1f13">&#9670;&nbsp;</a></span>P()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T = long double&gt; </div>
<table class="memname">
<tr>
<td class="memname">T P </td>
<td class="memname">T Spigot::P </td>
<td>(</td>
<td class="paramtype">const int &amp;&#160;</td>
<td class="paramname"><em>s</em>, </td>
Expand Down Expand Up @@ -181,7 +181,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a97f17f569c57d68f3e40dc72
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<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>
<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>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
Expand Down
2 changes: 1 addition & 1 deletion docs/bbp_type_formula_8h.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var bbp_type_formula_8h =
[
[ "P", "bbp_type_formula_8h.html#a97f17f569c57d68f3e40dc72557f7e50", null ]
[ "P", "bbp_type_formula_8h.html#a295a4fb8eff7d64f770f896ae18d1f13", null ]
];
6 changes: 3 additions & 3 deletions docs/bbp_type_formula_8h_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Cpp Examples: src/bbpTypeFormula.h Source File</title>
<title>Cpp Examples: lib/numericCppExamples/bbpTypeFormula.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
Expand Down Expand Up @@ -90,13 +90,13 @@
<div class="title">bbpTypeFormula.h</div> </div>
</div><!--header-->
<div class="contents">
<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>
<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>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<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>
<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>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
Expand Down
Loading

0 comments on commit d6e1f28

Please sign in to comment.