-
Notifications
You must be signed in to change notification settings - Fork 0
/
aggregate_8hpp_source.html
161 lines (159 loc) · 57.7 KB
/
aggregate_8hpp_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!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.11"/>
<title>tlx: tlx/math/aggregate.hpp 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);
$(window).load(resizeHeight);
</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>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.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">tlx
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</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('aggregate_8hpp_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">aggregate.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="aggregate_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*******************************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * tlx/math/aggregate.hpp</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Part of tlx - http://panthema.net/tlx</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * Copyright (C) 2015-2018 Timo Bingmann <[email protected]></span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * All rights reserved. Published under the Boost Software License, Version 1.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> ******************************************************************************/</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> </div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#ifndef TLX_MATH_AGGREGATE_HEADER</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#define TLX_MATH_AGGREGATE_HEADER</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include <<a class="code" href="likely_8hpp.html">tlx/define/likely.hpp</a>></span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> </div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include <algorithm></span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include <cmath></span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include <limits></span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">namespace </span><a class="code" href="namespacetlx.html">tlx</a> {</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">//! \addtogroup tlx_math</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">//! \{</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"></span><span class="comment"></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">/*!</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"> * Calculate running aggregate statistics: feed it with values, and it will keep</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> * the minimum, the maximum, the average, the value number, and the standard</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> * deviation is values.</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> */</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">template</span> <<span class="keyword">typename</span> Type_></div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html"> 31</a></span> <span class="keyword">class </span><a class="code" href="classtlx_1_1Aggregate.html">Aggregate</a></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c"> 34</a></span>  <span class="keyword">using</span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a> = Type_;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment"></span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"> //! default constructor</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"></span> <a class="code" href="classtlx_1_1Aggregate.html#abc966fa249ac5d77d4fbef4473bf09b3">Aggregate</a>() = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"></span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> //! initializing constructor</span></div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a79f117b33bcdd9dde07546c4aa3fc543"> 40</a></span> <span class="comment"></span> <a class="code" href="classtlx_1_1Aggregate.html#a79f117b33bcdd9dde07546c4aa3fc543">Aggregate</a>(<span class="keywordtype">size_t</span> <a class="code" href="classtlx_1_1Aggregate.html#ad6077e456dd6abb62d82087b55dc2331">count</a>, <span class="keyword">const</span> <span class="keywordtype">double</span>& <a class="code" href="classtlx_1_1Aggregate.html#ae0bc15eb9f6d257904efd85328226b33">mean</a>, <span class="keyword">const</span> <span class="keywordtype">double</span>& nvar,</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a>& <a class="code" href="classtlx_1_1Aggregate.html#a0071e11be9448367a55dcffcfba4fbd9">min</a>, <span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a>& <a class="code" href="classtlx_1_1Aggregate.html#a267616cde1f6ebe717b975f090d0257e">max</a>) noexcept</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  : <a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a>(<a class="code" href="classtlx_1_1Aggregate.html#ad6077e456dd6abb62d82087b55dc2331">count</a>), <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a>(<a class="code" href="classtlx_1_1Aggregate.html#ae0bc15eb9f6d257904efd85328226b33">mean</a>), <a class="code" href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705">nvar_</a>(nvar),</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a>(<a class="code" href="classtlx_1_1Aggregate.html#a0071e11be9448367a55dcffcfba4fbd9">min</a>), <a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a>(<a class="code" href="classtlx_1_1Aggregate.html#a267616cde1f6ebe717b975f090d0257e">max</a>) { }</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment"></span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment"> //! add a value to the running aggregation</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a0e84bfaf6ee5b102a7b74b9c03302b07"> 46</a></span> <span class="comment"></span> <a class="code" href="classtlx_1_1Aggregate.html">Aggregate</a>& <a class="code" href="classtlx_1_1Aggregate.html#a0e84bfaf6ee5b102a7b74b9c03302b07">add</a>(<span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a>& value) noexcept {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a>++;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a> = <a class="code" href="namespacetlx_1_1digest__detail.html#ac3302bda529d9a02c073a8fc4fe57030">std::min</a>(<a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a>, value);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a> = std::max(<a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a>, value);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="comment">// Single-pass numerically stable mean and standard deviation</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="comment">// calculation as described in Donald Knuth: The Art of Computer</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">// Programming, Volume 2, Chapter 4.2.2, Equations 15 & 16</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordtype">double</span> delta = value - <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  mean_ += delta / <a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a>;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <a class="code" href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705">nvar_</a> += delta * (value - <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a>);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  }</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment"></span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="comment"> //! return number of values aggregated</span></div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#ad6077e456dd6abb62d82087b55dc2331"> 60</a></span> <span class="comment"></span> <span class="keywordtype">size_t</span> <a class="code" href="classtlx_1_1Aggregate.html#ad6077e456dd6abb62d82087b55dc2331">count</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a>; }</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="comment"></span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="comment"> //! return sum over all values aggregated</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="comment"></span> <span class="comment">// can't make noexcept since Type_'s conversion is allowed to throw</span></div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a12b57ad1352a157d6ee94b701ee0fcf1"> 64</a></span>  <span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a> <a class="code" href="classtlx_1_1Aggregate.html#a12b57ad1352a157d6ee94b701ee0fcf1">sum</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a><span class="keyword">></span>(<a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> * <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a>); }</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"></span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment"> //! return sum over all values aggregated</span></div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#ae1e08c7a6fd34eca886af646b3498768"> 67</a></span> <span class="comment"></span> <span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a> <a class="code" href="classtlx_1_1Aggregate.html#ae1e08c7a6fd34eca886af646b3498768">total</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#a12b57ad1352a157d6ee94b701ee0fcf1">sum</a>(); }</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="comment"></span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment"> //! return the average over all values aggregated</span></div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#ab9571cb318ed4b0103846b12317d68a0"> 70</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#ab9571cb318ed4b0103846b12317d68a0">average</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a>; }</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment"></span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment"> //! return the average over all values aggregated</span></div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a7762f7f2effcb6c4853c8237ac26ea22"> 73</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#a7762f7f2effcb6c4853c8237ac26ea22">avg</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#ab9571cb318ed4b0103846b12317d68a0">average</a>(); }</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="comment"></span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="comment"> //! return the average over all values aggregated</span></div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#ae0bc15eb9f6d257904efd85328226b33"> 76</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#ae0bc15eb9f6d257904efd85328226b33">mean</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#ab9571cb318ed4b0103846b12317d68a0">average</a>(); }</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="comment"></span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment"> //! return minimum over all values aggregated</span></div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a0071e11be9448367a55dcffcfba4fbd9"> 79</a></span> <span class="comment"></span> <span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a>& <a class="code" href="classtlx_1_1Aggregate.html#a0071e11be9448367a55dcffcfba4fbd9">min</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a>; }</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"></span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment"> //! return maximum over all values aggregated</span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a267616cde1f6ebe717b975f090d0257e"> 82</a></span> <span class="comment"></span> <span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a>& <a class="code" href="classtlx_1_1Aggregate.html#a267616cde1f6ebe717b975f090d0257e">max</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a>; }</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment"></span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="comment"> //! return maximum - minimum over all values aggregated</span></div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a551b2f42da5c0e97d1446d92656e413b"> 85</a></span> <span class="comment"></span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a> <a class="code" href="classtlx_1_1Aggregate.html#a551b2f42da5c0e97d1446d92656e413b">span</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a> - <a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a>; }</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="comment"></span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="comment"> //! return the variance of all values aggregated.</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="comment"> //! ddof = delta degrees of freedom</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="comment"> //! Set to 0 if you have the entire distribution</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="comment"> //! Set to 1 if you have a sample (to correct for bias)</span></div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#aa0f5b9d28d5875a60664dd890fe29570"> 91</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#aa0f5b9d28d5875a60664dd890fe29570">variance</a>(<span class="keywordtype">size_t</span> ddof = 1)<span class="keyword"> const </span>{</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordflow">if</span> (<a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> <= 1) <span class="keywordflow">return</span> 0.0;</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705">nvar_</a> / <span class="keyword">static_cast<</span><span class="keywordtype">double</span><span class="keyword">></span>(<a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> - ddof);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  }</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="comment"></span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment"> //! return the variance of all values aggregated.</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment"> //! ddof = delta degrees of freedom</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"> //! Set to 0 if you have the entire distribution</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"> //! Set to 1 if you have a sample (to correct for bias)</span></div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a024e7930dbabad01c6f7a067906a6ec5"> 100</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#a024e7930dbabad01c6f7a067906a6ec5">var</a>(<span class="keywordtype">size_t</span> ddof = 1)<span class="keyword"> const </span>{</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#aa0f5b9d28d5875a60664dd890fe29570">variance</a>(ddof);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  }</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="comment"></span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="comment"> //! return the standard deviation of all values aggregated.</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="comment"> //! ddof = delta degrees of freedom</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="comment"> //! Set to 0 if you have the entire distribution</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment"> //! Set to 1 if you have a sample (to correct for bias)</span></div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#aef63242acc053c992cb02d0206c9a9f2"> 108</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#aef63242acc053c992cb02d0206c9a9f2">standard_deviation</a>(<span class="keywordtype">size_t</span> ddof = 1)<span class="keyword"> const </span>{</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">return</span> std::sqrt(<a class="code" href="classtlx_1_1Aggregate.html#aa0f5b9d28d5875a60664dd890fe29570">variance</a>(ddof));</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment"></span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"> //! return the standard deviation of all values aggregated.</span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment"> //! ddof = delta degrees of freedom</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment"> //! Set to 0 if you have the entire distribution</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="comment"> //! Set to 1 if you have a sample (to correct for bias)</span></div><div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a2bf0b4bbbc941d70269dbf5d7f7ff52f"> 116</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#a2bf0b4bbbc941d70269dbf5d7f7ff52f">stdev</a>(<span class="keywordtype">size_t</span> ddof = 1)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#aef63242acc053c992cb02d0206c9a9f2">standard_deviation</a>(ddof); }</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"></span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"> //! operator + to combine two Aggregate<></span></div><div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#ab1e48aa0991d569ae9f119d843c5b074"> 119</a></span> <span class="comment"></span> <a class="code" href="classtlx_1_1Aggregate.html">Aggregate</a> <a class="code" href="classtlx_1_1Aggregate.html#ab1e48aa0991d569ae9f119d843c5b074">operator + </a>(<span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html">Aggregate</a>& a) <span class="keyword">const</span> noexcept {</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#abc966fa249ac5d77d4fbef4473bf09b3">Aggregate</a>(</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="comment">// count</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> + a.count_,</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="comment">// mean</span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <a class="code" href="classtlx_1_1Aggregate.html#aa0b1d9fe7eac3259c90932fb1bfb4ceb">combine_means</a>(a),</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="comment">// merging variance is a bit complicated</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <a class="code" href="classtlx_1_1Aggregate.html#ab6db8c6d149ef6e83745bb58e1002fdf">combine_variance</a>(a),</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="comment">// min, max</span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <a class="code" href="namespacetlx_1_1digest__detail.html#ac3302bda529d9a02c073a8fc4fe57030">std::min</a>(<a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a>, a.min_), std::max(<a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a>, a.max_));</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  }</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment"></span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment"> //! operator += to combine two Aggregate<></span></div><div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a37ee7134e4d76ba9f8eaef7b300fd2ce"> 132</a></span> <span class="comment"></span> <a class="code" href="classtlx_1_1Aggregate.html">Aggregate</a>& <a class="code" href="classtlx_1_1Aggregate.html#a37ee7134e4d76ba9f8eaef7b300fd2ce">operator += </a>(<span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html">Aggregate</a>& a) noexcept {</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a> = <a class="code" href="classtlx_1_1Aggregate.html#aa0b1d9fe7eac3259c90932fb1bfb4ceb">combine_means</a>(a);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a> = <a class="code" href="namespacetlx_1_1digest__detail.html#ac3302bda529d9a02c073a8fc4fe57030">std::min</a>(<a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a>, a.min_);</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a> = std::max(<a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a>, a.max_);</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <a class="code" href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705">nvar_</a> = <a class="code" href="classtlx_1_1Aggregate.html#ab6db8c6d149ef6e83745bb58e1002fdf">combine_variance</a>(a);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> += a.count_;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  }</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="comment"></span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="comment"> //! serialization method for cereal.</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="comment"></span> <span class="keyword">template</span> <<span class="keyword">typename</span> Archive></div><div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a471354d71ba97866fe5dabb75f1a016b"> 143</a></span>  <span class="keywordtype">void</span> <a class="code" href="classtlx_1_1Aggregate.html#a471354d71ba97866fe5dabb75f1a016b">serialize</a>(Archive& archive) {</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  archive(<a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a>, <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a>, <a class="code" href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705">nvar_</a>, <a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a>, <a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a>);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  }</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> </div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="keyword">private</span>:<span class="comment"></span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="comment"> //! combine means, check if either count is zero. fix problems with NaN</span></div><div class="line"><a name="l00149"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#aa0b1d9fe7eac3259c90932fb1bfb4ceb"> 149</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#aa0b1d9fe7eac3259c90932fb1bfb4ceb">combine_means</a>(<span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html">Aggregate</a>& a) <span class="keyword">const</span> noexcept {</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordflow">if</span> (<a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> == 0)</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordflow">return</span> a.mean_;</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordflow">if</span> (a.count_ == 0)</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a>;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="keywordflow">return</span> (<a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a> * <a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> + a.mean_ * a.count_) / (<a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> + a.count_);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  }</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="comment"></span></div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <span class="comment"> //! T. Chan et al 1979, "Updating Formulae and a Pairwise Algorithm for</span></div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> <span class="comment"> //! Computing Sample Variances"</span></div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#ab6db8c6d149ef6e83745bb58e1002fdf"> 159</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#ab6db8c6d149ef6e83745bb58e1002fdf">combine_variance</a>(<span class="keyword">const</span> <a class="code" href="classtlx_1_1Aggregate.html">Aggregate</a>& other) <span class="keyword">const</span> noexcept {</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keywordtype">double</span> delta = <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a> - other.mean_;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordflow">return</span> <a class="code" href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705">nvar_</a> + other.nvar_ + (delta * delta) *</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  (<a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> * other.count_) / (<a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> + other.count_);</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  }</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span> <span class="comment"></span></div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="comment"> //! number of values aggregated</span></div><div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51"> 166</a></span> <span class="comment"></span> <span class="keywordtype">size_t</span> <a class="code" href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">count_</a> = 0;</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span> <span class="comment"></span></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="comment"> //! mean of values</span></div><div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783"> 169</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">mean_</a> = 0.0;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span> <span class="comment"></span></div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="comment"> //! approximate count * variance; stddev = sqrt(nvar / (count-1))</span></div><div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705"> 172</a></span> <span class="comment"></span> <span class="keywordtype">double</span> <a class="code" href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705">nvar_</a> = 0.0;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> <span class="comment"></span></div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> <span class="comment"> //! minimum value</span></div><div class="line"><a name="l00175"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca"> 175</a></span> <span class="comment"></span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a> <a class="code" href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">min_</a> = std::numeric_limits<Type>::max();</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> <span class="comment"></span></div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> <span class="comment"> //! maximum value</span></div><div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b"> 178</a></span> <span class="comment"></span> <a class="code" href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">Type</a> <a class="code" href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">max_</a> = std::numeric_limits<Type>::lowest();</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> };</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> <span class="comment"></span></div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> <span class="comment">//! \}</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span> <span class="comment"></span></div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span> } <span class="comment">// namespace tlx</span></div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span> </div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> <span class="preprocessor">#endif // !TLX_MATH_AGGREGATE_HEADER</span></div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span> </div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> <span class="comment">/******************************************************************************/</span></div><div class="ttc" id="classtlx_1_1Aggregate_html_ab6db8c6d149ef6e83745bb58e1002fdf"><div class="ttname"><a href="classtlx_1_1Aggregate.html#ab6db8c6d149ef6e83745bb58e1002fdf">tlx::Aggregate::combine_variance</a></div><div class="ttdeci">double combine_variance(const Aggregate &other) const noexcept</div><div class="ttdoc">T. </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00159">aggregate.hpp:159</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a0e84bfaf6ee5b102a7b74b9c03302b07"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a0e84bfaf6ee5b102a7b74b9c03302b07">tlx::Aggregate::add</a></div><div class="ttdeci">Aggregate & add(const Type &value) noexcept</div><div class="ttdoc">add a value to the running aggregation </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00046">aggregate.hpp:46</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a12b57ad1352a157d6ee94b701ee0fcf1"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a12b57ad1352a157d6ee94b701ee0fcf1">tlx::Aggregate::sum</a></div><div class="ttdeci">const Type sum() const </div><div class="ttdoc">return sum over all values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00064">aggregate.hpp:64</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a551b2f42da5c0e97d1446d92656e413b"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a551b2f42da5c0e97d1446d92656e413b">tlx::Aggregate::span</a></div><div class="ttdeci">Type span() const noexcept</div><div class="ttdoc">return maximum - minimum over all values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00085">aggregate.hpp:85</a></div></div>
<div class="ttc" id="namespacetlx_html"><div class="ttname"><a href="namespacetlx.html">tlx</a></div><div class="ttdef"><b>Definition:</b> <a href="exclusive__scan_8hpp_source.html#l00017">exclusive_scan.hpp:17</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a19fffb7a6788d346a4ab677ce5d61f4c"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a19fffb7a6788d346a4ab677ce5d61f4c">tlx::Aggregate::Type</a></div><div class="ttdeci">Type_ Type</div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00034">aggregate.hpp:34</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a37ee7134e4d76ba9f8eaef7b300fd2ce"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a37ee7134e4d76ba9f8eaef7b300fd2ce">tlx::Aggregate::operator+=</a></div><div class="ttdeci">Aggregate & operator+=(const Aggregate &a) noexcept</div><div class="ttdoc">operator += to combine two Aggregate<> </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00132">aggregate.hpp:132</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_ae0bc15eb9f6d257904efd85328226b33"><div class="ttname"><a href="classtlx_1_1Aggregate.html#ae0bc15eb9f6d257904efd85328226b33">tlx::Aggregate::mean</a></div><div class="ttdeci">double mean() const noexcept</div><div class="ttdoc">return the average over all values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00076">aggregate.hpp:76</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_abc966fa249ac5d77d4fbef4473bf09b3"><div class="ttname"><a href="classtlx_1_1Aggregate.html#abc966fa249ac5d77d4fbef4473bf09b3">tlx::Aggregate::Aggregate</a></div><div class="ttdeci">Aggregate()=default</div><div class="ttdoc">default constructor </div></div>
<div class="ttc" id="namespacetlx_1_1digest__detail_html_ac3302bda529d9a02c073a8fc4fe57030"><div class="ttname"><a href="namespacetlx_1_1digest__detail.html#ac3302bda529d9a02c073a8fc4fe57030">tlx::digest_detail::min</a></div><div class="ttdeci">static uint32_t min(uint32_t x, uint32_t y)</div><div class="ttdef"><b>Definition:</b> <a href="md5_8cpp_source.html#l00032">md5.cpp:32</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a471354d71ba97866fe5dabb75f1a016b"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a471354d71ba97866fe5dabb75f1a016b">tlx::Aggregate::serialize</a></div><div class="ttdeci">void serialize(Archive &archive)</div><div class="ttdoc">serialization method for cereal. </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00143">aggregate.hpp:143</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a830b1880f9dc271a7b6415047d893783"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a830b1880f9dc271a7b6415047d893783">tlx::Aggregate::mean_</a></div><div class="ttdeci">double mean_</div><div class="ttdoc">mean of values </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00169">aggregate.hpp:169</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a79f117b33bcdd9dde07546c4aa3fc543"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a79f117b33bcdd9dde07546c4aa3fc543">tlx::Aggregate::Aggregate</a></div><div class="ttdeci">Aggregate(size_t count, const double &mean, const double &nvar, const Type &min, const Type &max) noexcept</div><div class="ttdoc">initializing constructor </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00040">aggregate.hpp:40</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a9b6c971971d60d5363382c1246d3d7ca"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a9b6c971971d60d5363382c1246d3d7ca">tlx::Aggregate::min_</a></div><div class="ttdeci">Type min_</div><div class="ttdoc">minimum value </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00175">aggregate.hpp:175</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a0071e11be9448367a55dcffcfba4fbd9"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a0071e11be9448367a55dcffcfba4fbd9">tlx::Aggregate::min</a></div><div class="ttdeci">const Type & min() const noexcept</div><div class="ttdoc">return minimum over all values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00079">aggregate.hpp:79</a></div></div>
<div class="ttc" id="likely_8hpp_html"><div class="ttname"><a href="likely_8hpp.html">likely.hpp</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_aaf9bdab94087c129e5821251a47c4f2b"><div class="ttname"><a href="classtlx_1_1Aggregate.html#aaf9bdab94087c129e5821251a47c4f2b">tlx::Aggregate::max_</a></div><div class="ttdeci">Type max_</div><div class="ttdoc">maximum value </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00178">aggregate.hpp:178</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a7762f7f2effcb6c4853c8237ac26ea22"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a7762f7f2effcb6c4853c8237ac26ea22">tlx::Aggregate::avg</a></div><div class="ttdeci">double avg() const noexcept</div><div class="ttdoc">return the average over all values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00073">aggregate.hpp:73</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a024e7930dbabad01c6f7a067906a6ec5"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a024e7930dbabad01c6f7a067906a6ec5">tlx::Aggregate::var</a></div><div class="ttdeci">double var(size_t ddof=1) const </div><div class="ttdoc">return the variance of all values aggregated. </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00100">aggregate.hpp:100</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a6b06728795e8f208c0755874665b3a51"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a6b06728795e8f208c0755874665b3a51">tlx::Aggregate::count_</a></div><div class="ttdeci">size_t count_</div><div class="ttdoc">number of values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00166">aggregate.hpp:166</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_ab9571cb318ed4b0103846b12317d68a0"><div class="ttname"><a href="classtlx_1_1Aggregate.html#ab9571cb318ed4b0103846b12317d68a0">tlx::Aggregate::average</a></div><div class="ttdeci">double average() const noexcept</div><div class="ttdoc">return the average over all values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00070">aggregate.hpp:70</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a267616cde1f6ebe717b975f090d0257e"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a267616cde1f6ebe717b975f090d0257e">tlx::Aggregate::max</a></div><div class="ttdeci">const Type & max() const noexcept</div><div class="ttdoc">return maximum over all values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00082">aggregate.hpp:82</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_a2bf0b4bbbc941d70269dbf5d7f7ff52f"><div class="ttname"><a href="classtlx_1_1Aggregate.html#a2bf0b4bbbc941d70269dbf5d7f7ff52f">tlx::Aggregate::stdev</a></div><div class="ttdeci">double stdev(size_t ddof=1) const </div><div class="ttdoc">return the standard deviation of all values aggregated. </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00116">aggregate.hpp:116</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_ad6077e456dd6abb62d82087b55dc2331"><div class="ttname"><a href="classtlx_1_1Aggregate.html#ad6077e456dd6abb62d82087b55dc2331">tlx::Aggregate::count</a></div><div class="ttdeci">size_t count() const noexcept</div><div class="ttdoc">return number of values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00060">aggregate.hpp:60</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_aa0b1d9fe7eac3259c90932fb1bfb4ceb"><div class="ttname"><a href="classtlx_1_1Aggregate.html#aa0b1d9fe7eac3259c90932fb1bfb4ceb">tlx::Aggregate::combine_means</a></div><div class="ttdeci">double combine_means(const Aggregate &a) const noexcept</div><div class="ttdoc">combine means, check if either count is zero. fix problems with NaN </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00149">aggregate.hpp:149</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_ab1e48aa0991d569ae9f119d843c5b074"><div class="ttname"><a href="classtlx_1_1Aggregate.html#ab1e48aa0991d569ae9f119d843c5b074">tlx::Aggregate::operator+</a></div><div class="ttdeci">Aggregate operator+(const Aggregate &a) const noexcept</div><div class="ttdoc">operator + to combine two Aggregate<> </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00119">aggregate.hpp:119</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_ae1e08c7a6fd34eca886af646b3498768"><div class="ttname"><a href="classtlx_1_1Aggregate.html#ae1e08c7a6fd34eca886af646b3498768">tlx::Aggregate::total</a></div><div class="ttdeci">const Type total() const </div><div class="ttdoc">return sum over all values aggregated </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00067">aggregate.hpp:67</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_ad0a5355aca9c3db644144f06d6598705"><div class="ttname"><a href="classtlx_1_1Aggregate.html#ad0a5355aca9c3db644144f06d6598705">tlx::Aggregate::nvar_</a></div><div class="ttdeci">double nvar_</div><div class="ttdoc">approximate count * variance; stddev = sqrt(nvar / (count-1)) </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00172">aggregate.hpp:172</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_aef63242acc053c992cb02d0206c9a9f2"><div class="ttname"><a href="classtlx_1_1Aggregate.html#aef63242acc053c992cb02d0206c9a9f2">tlx::Aggregate::standard_deviation</a></div><div class="ttdeci">double standard_deviation(size_t ddof=1) const </div><div class="ttdoc">return the standard deviation of all values aggregated. </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00108">aggregate.hpp:108</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html"><div class="ttname"><a href="classtlx_1_1Aggregate.html">tlx::Aggregate</a></div><div class="ttdoc">Calculate running aggregate statistics: feed it with values, and it will keep the minimum...</div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00031">aggregate.hpp:31</a></div></div>
<div class="ttc" id="classtlx_1_1Aggregate_html_aa0f5b9d28d5875a60664dd890fe29570"><div class="ttname"><a href="classtlx_1_1Aggregate.html#aa0f5b9d28d5875a60664dd890fe29570">tlx::Aggregate::variance</a></div><div class="ttdeci">double variance(size_t ddof=1) const </div><div class="ttdoc">return the variance of all values aggregated. </div><div class="ttdef"><b>Definition:</b> <a href="aggregate_8hpp_source.html#l00091">aggregate.hpp:91</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="dir_8b4d4685f7eaf29e53aad23645930303.html">tlx</a></li><li class="navelem"><a class="el" href="dir_e09772e06e87bbb5d2c69a5ed712ca42.html">math</a></li><li class="navelem"><a class="el" href="aggregate_8hpp.html">aggregate.hpp</a></li>
<li class="footer">Generated on Sat Oct 2 2021 20:29:00 for tlx by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>