<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DFNgen: mathFunctions.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>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">DFNgen
   &#160;<span id="projectnumber">2.0</span>
   </div>
   <div id="projectbrief">DFN Model Generator</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('math_functions_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">mathFunctions.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="math_functions_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;<span class="preprocessor">#ifndef _MATHFUNCTIONS_H_</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define _MATHFUNCTIONS_H_</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keywordtype">double</span> <a class="code" href="math_functions_8h.html#a694596931b8abc5c03fcf4aaa8ecc6fc">sumDeviation</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> *data, <span class="keywordtype">int</span> n);</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="keywordtype">double</span> *<a class="code" href="math_functions_8h.html#a3f8a93afe66d001b09ae4094cf9a0b53">sumDevAry3</a>(<span class="keywordtype">double</span> *data);  </div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="keywordtype">int</span> <a class="code" href="math_functions_8h.html#a40bb4a04c41d869d8542458fa32d91ac">maxElmtIdx</a>(<span class="keywordtype">double</span> *data, <span class="keywordtype">int</span> n);</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keywordtype">int</span> *<a class="code" href="math_functions_8h.html#ae8a91d328acce433a539c5550cba001d">sortedIndex</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> *arr, <span class="keywordtype">int</span> n); </div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keywordtype">double</span> <a class="code" href="math_functions_8h.html#a78276693aa55fab858a41366e5b4aa73">getArea</a>(<span class="keyword">struct</span> <a class="code" href="struct_poly.html">Poly</a> &amp;poly);</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="keywordtype">int</span> <a class="code" href="math_functions_8h.html#a5eae1db9cbad8e807a0d677bcd805d36">indexFromProb</a>(<span class="keywordtype">float</span> *CDF, <span class="keywordtype">double</span> roll, <span class="keywordtype">int</span> size);</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="keywordtype">int</span> <a class="code" href="math_functions_8h.html#a2540d3ded7bd488a924ce2e4c2443261">indexFromProb_and_P32Status</a>(<span class="keywordtype">float</span> *CDF, <span class="keywordtype">double</span> roll, <span class="keywordtype">int</span> famSize, <span class="keywordtype">int</span> cdfSize, <span class="keywordtype">int</span> &amp;cdfIdx);</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keywordtype">void</span> <a class="code" href="math_functions_8h.html#a55646cd87f15106134e9cb832492e1f6">adjustCDF_and_famProb</a>(<span class="keywordtype">float</span> *&amp;CDF, <span class="keywordtype">float</span> *&amp;famProbability, <span class="keywordtype">int</span> &amp;cdfSize, <span class="keywordtype">int</span> idx2Remove);</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keywordtype">float</span> *<a class="code" href="math_functions_8h.html#a9422106ad945a110b0cf696050962556">createCDF</a>(<span class="keywordtype">float</span> *<a class="code" href="input_8h.html#aeb1032cfdc6f748b280a4a0a59375d11">famProb</a>, <span class="keywordtype">int</span> size);</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keywordtype">float</span> <a class="code" href="math_functions_8h.html#a132e593f161b095ca9de50bdc85a3a77">truncatedPowerLaw</a>(<span class="keywordtype">float</span> randomNum, <span class="keywordtype">float</span> <a class="code" href="input_8h.html#ae8063269aec74ddb855e2df228706c4f">emin</a>, <span class="keywordtype">float</span> <a class="code" href="input_8h.html#a672ea0daa9847198dd1ab922ca7106af">emax</a>, <span class="keywordtype">float</span> alpha);</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keywordtype">int</span> <a class="code" href="math_functions_8h.html#ad67ac7ecedfff7a737cd47a2f63b473a">cdfIdxFromFamNum</a>(<span class="keywordtype">float</span> *CDF, <span class="keywordtype">bool</span> *<a class="code" href="input_8h.html#a9d32f63bd011a629cf644c120e07eda8">p32Status</a>, <span class="keywordtype">int</span> famIdx);</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">/****************************************************/</span></div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="math_functions_8h.html#aaf4979ac027751a7358291353a23b387">   24</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="math_functions_8h.html#aaf4979ac027751a7358291353a23b387">OR</a>(<span class="keywordtype">bool</span> *dest, <span class="keywordtype">bool</span> *src){</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    dest[0] = (dest[0] | src[0]);</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    dest[1] = (dest[1] | src[1]);</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    dest[2] = (dest[2] | src[2]);</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    dest[3] = (dest[3] | src[3]);</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    dest[4] = (dest[4] | src[4]);</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    dest[5] = (dest[5] | src[5]);</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;}</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="math_functions_8h_html_a694596931b8abc5c03fcf4aaa8ecc6fc"><div class="ttname"><a href="math_functions_8h.html#a694596931b8abc5c03fcf4aaa8ecc6fc">sumDeviation</a></div><div class="ttdeci">double sumDeviation(const double *data, int n)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00019">mathFunctions.cpp:19</a></div></div>
<div class="ttc" id="struct_poly_html"><div class="ttname"><a href="struct_poly.html">Poly</a></div><div class="ttdef"><b>Definition:</b> <a href="structures_8h_source.html#l00012">structures.h:12</a></div></div>
<div class="ttc" id="math_functions_8h_html_a9422106ad945a110b0cf696050962556"><div class="ttname"><a href="math_functions_8h.html#a9422106ad945a110b0cf696050962556">createCDF</a></div><div class="ttdeci">float * createCDF(float *famProb, int size)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00244">mathFunctions.cpp:244</a></div></div>
<div class="ttc" id="math_functions_8h_html_a3f8a93afe66d001b09ae4094cf9a0b53"><div class="ttname"><a href="math_functions_8h.html#a3f8a93afe66d001b09ae4094cf9a0b53">sumDevAry3</a></div><div class="ttdeci">double * sumDevAry3(double *data)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00046">mathFunctions.cpp:46</a></div></div>
<div class="ttc" id="input_8h_html_ae8063269aec74ddb855e2df228706c4f"><div class="ttname"><a href="input_8h.html#ae8063269aec74ddb855e2df228706c4f">emin</a></div><div class="ttdeci">float * emin</div><div class="ttdef"><b>Definition:</b> <a href="read_input_8cpp_source.html#l00222">readInput.cpp:222</a></div></div>
<div class="ttc" id="math_functions_8h_html_a40bb4a04c41d869d8542458fa32d91ac"><div class="ttname"><a href="math_functions_8h.html#a40bb4a04c41d869d8542458fa32d91ac">maxElmtIdx</a></div><div class="ttdeci">int maxElmtIdx(double *data, int n)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00068">mathFunctions.cpp:68</a></div></div>
<div class="ttc" id="input_8h_html_a672ea0daa9847198dd1ab922ca7106af"><div class="ttname"><a href="input_8h.html#a672ea0daa9847198dd1ab922ca7106af">emax</a></div><div class="ttdeci">float * emax</div><div class="ttdef"><b>Definition:</b> <a href="read_input_8cpp_source.html#l00225">readInput.cpp:225</a></div></div>
<div class="ttc" id="math_functions_8h_html_a2540d3ded7bd488a924ce2e4c2443261"><div class="ttname"><a href="math_functions_8h.html#a2540d3ded7bd488a924ce2e4c2443261">indexFromProb_and_P32Status</a></div><div class="ttdeci">int indexFromProb_and_P32Status(float *CDF, double roll, int famSize, int cdfSize, int &amp;cdfIdx)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00187">mathFunctions.cpp:187</a></div></div>
<div class="ttc" id="math_functions_8h_html_ae8a91d328acce433a539c5550cba001d"><div class="ttname"><a href="math_functions_8h.html#ae8a91d328acce433a539c5550cba001d">sortedIndex</a></div><div class="ttdeci">int * sortedIndex(const double *arr, int n)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00088">mathFunctions.cpp:88</a></div></div>
<div class="ttc" id="math_functions_8h_html_aaf4979ac027751a7358291353a23b387"><div class="ttname"><a href="math_functions_8h.html#aaf4979ac027751a7358291353a23b387">OR</a></div><div class="ttdeci">void OR(bool *dest, bool *src)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8h_source.html#l00024">mathFunctions.h:24</a></div></div>
<div class="ttc" id="math_functions_8h_html_a132e593f161b095ca9de50bdc85a3a77"><div class="ttname"><a href="math_functions_8h.html#a132e593f161b095ca9de50bdc85a3a77">truncatedPowerLaw</a></div><div class="ttdeci">float truncatedPowerLaw(float randomNum, float emin, float emax, float alpha)</div><div class="ttdef"><b>Definition:</b> <a href="generating_points_8cpp_source.html#l00208">generatingPoints.cpp:208</a></div></div>
<div class="ttc" id="math_functions_8h_html_a55646cd87f15106134e9cb832492e1f6"><div class="ttname"><a href="math_functions_8h.html#a55646cd87f15106134e9cb832492e1f6">adjustCDF_and_famProb</a></div><div class="ttdeci">void adjustCDF_and_famProb(float *&amp;CDF, float *&amp;famProbability, int &amp;cdfSize, int idx2Remove)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00269">mathFunctions.cpp:269</a></div></div>
<div class="ttc" id="input_8h_html_aeb1032cfdc6f748b280a4a0a59375d11"><div class="ttname"><a href="input_8h.html#aeb1032cfdc6f748b280a4a0a59375d11">famProb</a></div><div class="ttdeci">float * famProb</div><div class="ttdef"><b>Definition:</b> <a href="read_input_8cpp_source.html#l00133">readInput.cpp:133</a></div></div>
<div class="ttc" id="input_8h_html_a9d32f63bd011a629cf644c120e07eda8"><div class="ttname"><a href="input_8h.html#a9d32f63bd011a629cf644c120e07eda8">p32Status</a></div><div class="ttdeci">bool * p32Status</div><div class="ttdef"><b>Definition:</b> <a href="read_input_8cpp_source.html#l00468">readInput.cpp:468</a></div></div>
<div class="ttc" id="math_functions_8h_html_ad67ac7ecedfff7a737cd47a2f63b473a"><div class="ttname"><a href="math_functions_8h.html#ad67ac7ecedfff7a737cd47a2f63b473a">cdfIdxFromFamNum</a></div><div class="ttdeci">int cdfIdxFromFamNum(float *CDF, bool *p32Status, int famIdx)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00221">mathFunctions.cpp:221</a></div></div>
<div class="ttc" id="math_functions_8h_html_a5eae1db9cbad8e807a0d677bcd805d36"><div class="ttname"><a href="math_functions_8h.html#a5eae1db9cbad8e807a0d677bcd805d36">indexFromProb</a></div><div class="ttdeci">int indexFromProb(float *CDF, double roll, int size)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00166">mathFunctions.cpp:166</a></div></div>
<div class="ttc" id="math_functions_8h_html_a78276693aa55fab858a41366e5b4aa73"><div class="ttname"><a href="math_functions_8h.html#a78276693aa55fab858a41366e5b4aa73">getArea</a></div><div class="ttdeci">double getArea(struct Poly &amp;poly)</div><div class="ttdef"><b>Definition:</b> <a href="math_functions_8cpp_source.html#l00110">mathFunctions.cpp:110</a></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="math_functions_8h.html">mathFunctions.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.12 </li>
  </ul>
</div>
</body>
</html>
