<!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: distributions.cpp 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('distributions_8cpp_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">distributions.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="distributions_8cpp.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">#include &quot;<a class="code" href="distributions_8h.html">distributions.h</a>&quot;</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="insert_shape_8h.html">insertShape.h</a>&quot;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;float.h&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;cstdlib&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">    The Distributions class was created specifically for </span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">    easy use of a customized exponential distribution </span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">    which allows users to specify the min and max limit </span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">    which the distribution function can return. </span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">    (exponentail distribution function truncated on both sides)</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">    </span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">    The Distributions class was created keeping in mind </span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">    other distributions may be needed later. </span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">    Currently, exponential distribution is the only </span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">    distribution contained in the Distributions class.</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">/***********************************************************/</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">/******************* Constructor ***************************/</span></div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="class_distributions.html#a4b4bf0c5a106c56524960cdfc1a6c526">   30</a></span>&#160;<a class="code" href="class_distributions.html#a4b4bf0c5a106c56524960cdfc1a6c526">Distributions::Distributions</a>(std::mt19937_64 &amp;_generator, std::vector&lt;Shape&gt; &amp;shapeFamilies) {</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <span class="comment">// Maximum double less than 1.0</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="comment">// (0.9999... before being recognized as 1)</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <a class="code" href="class_distributions.html#a8b0b60226ccb10242c0430527bfadd8e">maxInput</a> = <a class="code" href="class_distributions.html#a7137b9d02061018a04100001d370eba4">getMaxDecimalForDouble</a>();</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="comment">// Init exponential dist class</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    <a class="code" href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">expDist</a> = <span class="keyword">new</span> <a class="code" href="class_exp_dist.html">ExpDist</a>(<a class="code" href="class_distributions.html#a8b0b60226ccb10242c0430527bfadd8e">maxInput</a>, _generator);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="comment">// User input check and exp dist init </span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <a class="code" href="class_distributions.html#ae843f03925301fb5f0d4d37de36ca49b">checkDistributionUserInput</a>(shapeFamilies);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;}</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="comment">/***********************************************************/</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">/******************  Get Max Digits  ***********************/</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="class_distributions.html#af713bd4bcd345464c404e6bd4f4371d9">   46</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="class_distributions.html#af713bd4bcd345464c404e6bd4f4371d9">Distributions::getMaxDigits</a>() {</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="comment">// log(2) / log (10) = 0.301029995663982</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keywordflow">return</span> std::floor(DBL_MANT_DIG * 0.30102999566398) + 2;</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;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">/***********************************************************/</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">/************** Get Max Number Less Than 1.0  **************/</span></div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="class_distributions.html#a7137b9d02061018a04100001d370eba4">   56</a></span>&#160;<span class="keywordtype">double</span> <a class="code" href="class_distributions.html#a7137b9d02061018a04100001d370eba4">Distributions::getMaxDecimalForDouble</a>() {</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keywordtype">char</span> temp[32];</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <span class="keywordtype">int</span> length = <a class="code" href="class_distributions.html#af713bd4bcd345464c404e6bd4f4371d9">getMaxDigits</a>();</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;    temp[0] = <span class="charliteral">&#39;.&#39;</span>;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; length; i++) {</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        temp[i] = <span class="charliteral">&#39;9&#39;</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;    temp[length] = <span class="charliteral">&#39;\0&#39;</span>; <span class="comment">// Add NULL char</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="keywordtype">double</span> returnVal = atof(temp);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordflow">return</span> returnVal;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;}</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="comment">/********************************************************************************/</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="comment">/*** Initialize and  Error Check On User Input for Exponendtail Distribution  ***/</span></div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="class_distributions.html#ae843f03925301fb5f0d4d37de36ca49b">   95</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_distributions.html#ae843f03925301fb5f0d4d37de36ca49b">Distributions::checkDistributionUserInput</a>(std::vector&lt;Shape&gt; &amp;shapeFamilies) {</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i &lt; shapeFamilies.size(); i++) {</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        <span class="keywordflow">switch</span> (shapeFamilies[i].distributionType) {</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            <span class="keywordtype">double</span> input;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;            <span class="keywordflow">case</span> 1: <span class="comment">// Lognormal</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            <span class="keywordflow">case</span> 2: <span class="comment">// Truncated power-law</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;            <span class="keywordflow">case</span> 3: <span class="comment">// Exponential</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;                <span class="comment">// Check exponential minimum value        </span></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                input = <a class="code" href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">expDist</a>-&gt;<a class="code" href="class_exp_dist.html#a37c73098f6602d6ac114722dfe9f9a72">computeInput</a>(shapeFamilies[i].expMin, shapeFamilies[i].expLambda);</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;                <span class="keywordflow">if</span> (input &gt;= 1) {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;\n\nWARNING: The defined minimum value, &quot;</span> &lt;&lt; shapeFamilies[i].expMin</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;                              &lt;&lt; <span class="stringliteral">&quot;, for &quot;</span> &lt;&lt; <a class="code" href="insert_shape_8cpp.html#ae4fa66ac2a60ae519ee05168b44c9917">shapeType</a>(shapeFamilies[i])</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;                              &lt;&lt; <span class="stringliteral">&quot; family &quot;</span> &lt;&lt; <a class="code" href="insert_shape_8cpp.html#a9b3f632508ac90991bd6ebee7bcfbc2f">getFamilyNumber</a>(i, shapeFamilies[i].shapeFamily)</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                              &lt;&lt; <span class="stringliteral">&quot; will not be able to be produced by the exponential distribution due to precision issues.\n&quot;</span>;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;The minimum value is too large. The largest value the distribution can &quot;</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                              &lt;&lt; <span class="stringliteral">&quot;produce with current parameters is &quot;</span></div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                              &lt;&lt; <a class="code" href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">expDist</a>-&gt;<a class="code" href="class_exp_dist.html#a1172a8ef0d7ddf6338ae38f4dacb336d">getMaxValue</a>(shapeFamilies[i].expLambda) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;Please adjust the minimum value, or the mean, and try again.\n&quot;</span>;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                    exit(1);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;                }</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;                <span class="keywordflow">else</span> {</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                    shapeFamilies[i].minDistInput = input;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                }</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                <span class="comment">// Check exponential maximum value</span></div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                input = <a class="code" href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">expDist</a>-&gt;<a class="code" href="class_exp_dist.html#a37c73098f6602d6ac114722dfe9f9a72">computeInput</a>(shapeFamilies[i].expMax, shapeFamilies[i].expLambda);</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;                <span class="keywordflow">if</span> (input &gt;= 1) {</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;\n\nWARNING: The defined maximum value, &quot;</span> &lt;&lt; shapeFamilies[i].expMax &lt;&lt; <span class="stringliteral">&quot;, for &quot;</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;                              &lt;&lt; <a class="code" href="insert_shape_8cpp.html#ae4fa66ac2a60ae519ee05168b44c9917">shapeType</a>(shapeFamilies[i]) &lt;&lt; <span class="stringliteral">&quot; family &quot;</span> &lt;&lt; <a class="code" href="insert_shape_8cpp.html#a9b3f632508ac90991bd6ebee7bcfbc2f">getFamilyNumber</a>(i, shapeFamilies[i].shapeFamily)</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;                              &lt;&lt; <span class="stringliteral">&quot; will not be able to be produced by the exponential distribution due to precision issues.\n&quot;</span>;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;The largest value the distribution can produce with current parameters is &quot;</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;                              &lt;&lt; <a class="code" href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">expDist</a>-&gt;<a class="code" href="class_exp_dist.html#a1172a8ef0d7ddf6338ae38f4dacb336d">getMaxValue</a>(shapeFamilies[i].expLambda) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;                    std::cout &lt;&lt; <span class="stringliteral">&quot;Press Enter to automatically adjust this exponential maximum value to &quot;</span></div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;                              &lt;&lt; <a class="code" href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">expDist</a>-&gt;<a class="code" href="class_exp_dist.html#a1172a8ef0d7ddf6338ae38f4dacb336d">getMaxValue</a>(shapeFamilies[i].expLambda) &lt;&lt; <span class="stringliteral">&quot; (q to Quit)\n&quot;</span>;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                    <span class="comment">// Prompt user to press enter to continue or q to quit</span></div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                    <a class="code" href="class_distributions.html#a3c71954eae4b00621c39676c6110dd5b">quitOrContinue</a>();</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                    <span class="keywordtype">double</span> max  = <a class="code" href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">expDist</a>-&gt;<a class="code" href="class_exp_dist.html#a1172a8ef0d7ddf6338ae38f4dacb336d">getMaxValue</a>(shapeFamilies[i].expLambda);</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                    <span class="comment">//check that the max is not less or equal to the min</span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;                    <span class="keywordflow">if</span> (max &lt;= shapeFamilies[i].expMin) {</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;                        std::cout &lt;&lt; <span class="stringliteral">&quot;ERROR: The maximum exponetnial distribution radius possible for &quot;</span> &lt;&lt; <a class="code" href="insert_shape_8cpp.html#ae4fa66ac2a60ae519ee05168b44c9917">shapeType</a>(shapeFamilies[i])</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;                                  &lt;&lt; <span class="stringliteral">&quot; family &quot;</span> &lt;&lt; <a class="code" href="insert_shape_8cpp.html#a9b3f632508ac90991bd6ebee7bcfbc2f">getFamilyNumber</a>(i, shapeFamilies[i].shapeFamily)</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;                                  &lt;&lt; <span class="stringliteral">&quot; is less than or equal to the minimum exponential distribution radius.\n&quot;</span>;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;                        std::cout &lt;&lt; <span class="stringliteral">&quot;Please adjust the exponential distribution parameters in &quot;</span> &lt;&lt; <a class="code" href="insert_shape_8cpp.html#ae4fa66ac2a60ae519ee05168b44c9917">shapeType</a>(shapeFamilies[i])</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;                                  &lt;&lt; <span class="stringliteral">&quot; family &quot;</span> &lt;&lt; <a class="code" href="insert_shape_8cpp.html#a9b3f632508ac90991bd6ebee7bcfbc2f">getFamilyNumber</a>(i, shapeFamilies[i].shapeFamily) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                        exit(1);</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;                    }</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;                }</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;                shapeFamilies[i].maxDistInput = input;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;                <span class="keywordflow">break</span>; <span class="comment">// End case 3</span></div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        }</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    }</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;}</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="comment">/******************************************************/</span></div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="comment">/*************** Quit or Continue *********************/</span></div><div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="class_distributions.html#a3c71954eae4b00621c39676c6110dd5b">  172</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_distributions.html#a3c71954eae4b00621c39676c6110dd5b">Distributions::quitOrContinue</a>() {</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <span class="keywordtype">char</span> str[256];</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <span class="keywordflow">do</span> {</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        <span class="comment">// Get input</span></div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        std::cin.get(str, 256);</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        std::cin.clear();</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        std::cin.ignore();</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;        <span class="keywordflow">if</span> ((str[0] == <span class="charliteral">&#39;q&#39;</span> &amp;&amp; str[1] == <span class="charliteral">&#39;\0&#39;</span>) || (str[0] == <span class="charliteral">&#39;Q&#39;</span> &amp;&amp; str[1] == <span class="charliteral">&#39;\0&#39;</span>)) {</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            exit(1);</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        }</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        <span class="keywordflow">if</span> (str[0] != 0) {</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;            std::cout &lt;&lt; <span class="stringliteral">&quot;Invalid input.\n&quot;</span>;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        }</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    } <span class="keywordflow">while</span> (str[0] != 0);</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;}</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;<span class="comment">/******************************************************/</span></div><div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="class_distributions.html#a3b578f1ba0cb12278029b3590700c394">  194</a></span>&#160;<a class="code" href="class_distributions.html#a3b578f1ba0cb12278029b3590700c394">Distributions::~Distributions</a>() {</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="keyword">delete</span> <a class="code" href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">expDist</a>;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;}</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div><div class="ttc" id="distributions_8h_html"><div class="ttname"><a href="distributions_8h.html">distributions.h</a></div></div>
<div class="ttc" id="class_distributions_html_a7137b9d02061018a04100001d370eba4"><div class="ttname"><a href="class_distributions.html#a7137b9d02061018a04100001d370eba4">Distributions::getMaxDecimalForDouble</a></div><div class="ttdeci">double getMaxDecimalForDouble()</div><div class="ttdef"><b>Definition:</b> <a href="distributions_8cpp_source.html#l00056">distributions.cpp:56</a></div></div>
<div class="ttc" id="class_distributions_html_a3b578f1ba0cb12278029b3590700c394"><div class="ttname"><a href="class_distributions.html#a3b578f1ba0cb12278029b3590700c394">Distributions::~Distributions</a></div><div class="ttdeci">~Distributions()</div><div class="ttdef"><b>Definition:</b> <a href="distributions_8cpp_source.html#l00194">distributions.cpp:194</a></div></div>
<div class="ttc" id="class_distributions_html_af713bd4bcd345464c404e6bd4f4371d9"><div class="ttname"><a href="class_distributions.html#af713bd4bcd345464c404e6bd4f4371d9">Distributions::getMaxDigits</a></div><div class="ttdeci">int getMaxDigits()</div><div class="ttdef"><b>Definition:</b> <a href="distributions_8cpp_source.html#l00046">distributions.cpp:46</a></div></div>
<div class="ttc" id="insert_shape_8cpp_html_ae4fa66ac2a60ae519ee05168b44c9917"><div class="ttname"><a href="insert_shape_8cpp.html#ae4fa66ac2a60ae519ee05168b44c9917">shapeType</a></div><div class="ttdeci">std::string shapeType(struct Shape &amp;shapeFam)</div><div class="ttdef"><b>Definition:</b> <a href="insert_shape_8cpp_source.html#l00700">insertShape.cpp:700</a></div></div>
<div class="ttc" id="class_distributions_html_a8b0b60226ccb10242c0430527bfadd8e"><div class="ttname"><a href="class_distributions.html#a8b0b60226ccb10242c0430527bfadd8e">Distributions::maxInput</a></div><div class="ttdeci">double maxInput</div><div class="ttdef"><b>Definition:</b> <a href="distributions_8h_source.html#l00026">distributions.h:26</a></div></div>
<div class="ttc" id="class_distributions_html_ae843f03925301fb5f0d4d37de36ca49b"><div class="ttname"><a href="class_distributions.html#ae843f03925301fb5f0d4d37de36ca49b">Distributions::checkDistributionUserInput</a></div><div class="ttdeci">void checkDistributionUserInput(std::vector&lt; Shape &gt; &amp;shapeFamilies)</div><div class="ttdef"><b>Definition:</b> <a href="distributions_8cpp_source.html#l00095">distributions.cpp:95</a></div></div>
<div class="ttc" id="insert_shape_8cpp_html_a9b3f632508ac90991bd6ebee7bcfbc2f"><div class="ttname"><a href="insert_shape_8cpp.html#a9b3f632508ac90991bd6ebee7bcfbc2f">getFamilyNumber</a></div><div class="ttdeci">int getFamilyNumber(int familyIndex, int familyShape)</div><div class="ttdef"><b>Definition:</b> <a href="insert_shape_8cpp_source.html#l00688">insertShape.cpp:688</a></div></div>
<div class="ttc" id="insert_shape_8h_html"><div class="ttname"><a href="insert_shape_8h.html">insertShape.h</a></div></div>
<div class="ttc" id="class_exp_dist_html_a1172a8ef0d7ddf6338ae38f4dacb336d"><div class="ttname"><a href="class_exp_dist.html#a1172a8ef0d7ddf6338ae38f4dacb336d">ExpDist::getMaxValue</a></div><div class="ttdeci">double getMaxValue(double lambda)</div><div class="ttdef"><b>Definition:</b> <a href="exp_dist_8cpp_source.html#l00115">expDist.cpp:115</a></div></div>
<div class="ttc" id="class_distributions_html_a4b4bf0c5a106c56524960cdfc1a6c526"><div class="ttname"><a href="class_distributions.html#a4b4bf0c5a106c56524960cdfc1a6c526">Distributions::Distributions</a></div><div class="ttdeci">Distributions(std::mt19937_64 &amp;_generator, std::vector&lt; Shape &gt; &amp;shapeFamilies)</div><div class="ttdef"><b>Definition:</b> <a href="distributions_8cpp_source.html#l00030">distributions.cpp:30</a></div></div>
<div class="ttc" id="class_exp_dist_html_a37c73098f6602d6ac114722dfe9f9a72"><div class="ttname"><a href="class_exp_dist.html#a37c73098f6602d6ac114722dfe9f9a72">ExpDist::computeInput</a></div><div class="ttdeci">double computeInput(double output, double lambda)</div><div class="ttdef"><b>Definition:</b> <a href="exp_dist_8cpp_source.html#l00129">expDist.cpp:129</a></div></div>
<div class="ttc" id="class_distributions_html_aa67e69369161d7b2f6c4c94799f12bf4"><div class="ttname"><a href="class_distributions.html#aa67e69369161d7b2f6c4c94799f12bf4">Distributions::expDist</a></div><div class="ttdeci">ExpDist * expDist</div><div class="ttdef"><b>Definition:</b> <a href="distributions_8h_source.html#l00020">distributions.h:20</a></div></div>
<div class="ttc" id="class_exp_dist_html"><div class="ttname"><a href="class_exp_dist.html">ExpDist</a></div><div class="ttdef"><b>Definition:</b> <a href="exp_dist_8h_source.html#l00012">expDist.h:12</a></div></div>
<div class="ttc" id="class_distributions_html_a3c71954eae4b00621c39676c6110dd5b"><div class="ttname"><a href="class_distributions.html#a3c71954eae4b00621c39676c6110dd5b">Distributions::quitOrContinue</a></div><div class="ttdeci">void quitOrContinue()</div><div class="ttdef"><b>Definition:</b> <a href="distributions_8cpp_source.html#l00172">distributions.cpp:172</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="distributions_8cpp.html">distributions.cpp</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>
