1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
---|
3 | <title>mixpp: itpp::Histogram< Num_T > Class Template Reference</title> |
---|
4 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
---|
5 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
6 | </head><body> |
---|
7 | <!-- Generated by Doxygen 1.5.8 --> |
---|
8 | <script type="text/javascript"> |
---|
9 | <!-- |
---|
10 | function changeDisplayState (e){ |
---|
11 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
12 | var button=this.firstChild; |
---|
13 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
14 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
15 | sectionDiv.style.display='block'; |
---|
16 | button.src='open.gif'; |
---|
17 | }else{ |
---|
18 | sectionDiv.style.display='none'; |
---|
19 | button.src='closed.gif'; |
---|
20 | } |
---|
21 | } |
---|
22 | function initDynSections(){ |
---|
23 | var divs=document.getElementsByTagName('div'); |
---|
24 | var sectionCounter=1; |
---|
25 | for(var i=0;i<divs.length-1;i++){ |
---|
26 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
27 | var header=divs[i]; |
---|
28 | var section=divs[i+1]; |
---|
29 | var button=header.firstChild; |
---|
30 | if (button!='IMG'){ |
---|
31 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
32 | button=document.createElement('img'); |
---|
33 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
34 | } |
---|
35 | header.style.cursor='pointer'; |
---|
36 | header.onclick=changeDisplayState; |
---|
37 | header.id='dynheader'+sectionCounter; |
---|
38 | button.src='closed.gif'; |
---|
39 | section.id='dynsection'+sectionCounter; |
---|
40 | section.style.display='none'; |
---|
41 | section.style.marginLeft='14px'; |
---|
42 | sectionCounter++; |
---|
43 | } |
---|
44 | } |
---|
45 | } |
---|
46 | window.onload = initDynSections; |
---|
47 | --> |
---|
48 | </script> |
---|
49 | <div class="navigation" id="top"> |
---|
50 | <div class="tabs"> |
---|
51 | <ul> |
---|
52 | <li><a href="main.html"><span>Main Page</span></a></li> |
---|
53 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
54 | <li><a href="modules.html"><span>Modules</span></a></li> |
---|
55 | <li class="current"><a href="annotated.html"><span>Classes</span></a></li> |
---|
56 | <li><a href="files.html"><span>Files</span></a></li> |
---|
57 | </ul> |
---|
58 | </div> |
---|
59 | <div class="tabs"> |
---|
60 | <ul> |
---|
61 | <li><a href="annotated.html"><span>Class List</span></a></li> |
---|
62 | <li><a href="classes.html"><span>Class Index</span></a></li> |
---|
63 | <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> |
---|
64 | <li><a href="functions.html"><span>Class Members</span></a></li> |
---|
65 | </ul> |
---|
66 | </div> |
---|
67 | <div class="navpath"><b>itpp</b>::<a class="el" href="classitpp_1_1Histogram.html">Histogram</a> |
---|
68 | </div> |
---|
69 | </div> |
---|
70 | <div class="contents"> |
---|
71 | <h1>itpp::Histogram< Num_T > Class Template Reference<br> |
---|
72 | <small> |
---|
73 | [<a class="el" href="group__histogram.html">Histogram</a>]</small> |
---|
74 | </h1><!-- doxytag: class="itpp::Histogram" --><a class="el" href="classitpp_1_1Histogram.html" title="Histogram computation class.">Histogram</a> computation class. |
---|
75 | <a href="#_details">More...</a> |
---|
76 | <p> |
---|
77 | <code>#include <<a class="el" href="histogram_8h-source.html">histogram.h</a>></code> |
---|
78 | <p> |
---|
79 | |
---|
80 | <p> |
---|
81 | <a href="classitpp_1_1Histogram-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> |
---|
82 | <tr><td></td></tr> |
---|
83 | <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> |
---|
84 | <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__histogram.html#g9af656d3a1059f15371b3389ca9bb943">Histogram</a> (Num_T from=Num_T(0), Num_T to=Num_T(99), int n_bins=100)</td></tr> |
---|
85 | |
---|
86 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="36cf6361095bed1ad8de4878ba17b1c6"></a><!-- doxytag: member="itpp::Histogram::~Histogram" ref="36cf6361095bed1ad8de4878ba17b1c6" args="()" --> |
---|
87 | </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#36cf6361095bed1ad8de4878ba17b1c6">~Histogram</a> ()</td></tr> |
---|
88 | |
---|
89 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Default destructor. <br></td></tr> |
---|
90 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g7e6fb324cfe1ebf5353660f10857c4dc"></a><!-- doxytag: member="itpp::Histogram::setup" ref="g7e6fb324cfe1ebf5353660f10857c4dc" args="(Num_T from, Num_T to, int n_bins)" --> |
---|
91 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__histogram.html#g7e6fb324cfe1ebf5353660f10857c4dc">setup</a> (Num_T from, Num_T to, int n_bins)</td></tr> |
---|
92 | |
---|
93 | <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classitpp_1_1Histogram.html" title="Histogram computation class.">Histogram</a> setup. <br></td></tr> |
---|
94 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gaf127f05ede5a7c147b23374bb90f89e"></a><!-- doxytag: member="itpp::Histogram::update" ref="gaf127f05ede5a7c147b23374bb90f89e" args="(Num_T value)" --> |
---|
95 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__histogram.html#gaf127f05ede5a7c147b23374bb90f89e">update</a> (Num_T value)</td></tr> |
---|
96 | |
---|
97 | <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classitpp_1_1Histogram.html" title="Histogram computation class.">Histogram</a> update. <br></td></tr> |
---|
98 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g137a9b7ba2e9282ed245cbfcc7de2864"></a><!-- doxytag: member="itpp::Histogram::update" ref="g137a9b7ba2e9282ed245cbfcc7de2864" args="(Vec< Num_T > values)" --> |
---|
99 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__histogram.html#g137a9b7ba2e9282ed245cbfcc7de2864">update</a> (<a class="el" href="classitpp_1_1Vec.html">Vec</a>< Num_T > values)</td></tr> |
---|
100 | |
---|
101 | <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classitpp_1_1Histogram.html" title="Histogram computation class.">Histogram</a> update. <br></td></tr> |
---|
102 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ge05bfc019ca085f4654707e9cf972f43"></a><!-- doxytag: member="itpp::Histogram::update" ref="ge05bfc019ca085f4654707e9cf972f43" args="(Mat< Num_T > values)" --> |
---|
103 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__histogram.html#ge05bfc019ca085f4654707e9cf972f43">update</a> (<a class="el" href="classitpp_1_1Mat.html">Mat</a>< Num_T > values)</td></tr> |
---|
104 | |
---|
105 | <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classitpp_1_1Histogram.html" title="Histogram computation class.">Histogram</a> update. <br></td></tr> |
---|
106 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2e595439fdf3877d6c5aaca0f5f33c88"></a><!-- doxytag: member="itpp::Histogram::reset" ref="2e595439fdf3877d6c5aaca0f5f33c88" args="()" --> |
---|
107 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#2e595439fdf3877d6c5aaca0f5f33c88">reset</a> ()</td></tr> |
---|
108 | |
---|
109 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Bins reset, so accumulation can be restarted. <br></td></tr> |
---|
110 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5c46985d8736d5d72f4b6318cee42c6d"></a><!-- doxytag: member="itpp::Histogram::get_bin" ref="5c46985d8736d5d72f4b6318cee42c6d" args="(int ix) const " --> |
---|
111 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#5c46985d8736d5d72f4b6318cee42c6d">get_bin</a> (int ix) const </td></tr> |
---|
112 | |
---|
113 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access to single <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> counter. <br></td></tr> |
---|
114 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b5817b5b3c4b7c7efff6d51abf20f662"></a><!-- doxytag: member="itpp::Histogram::get_bins" ref="b5817b5b3c4b7c7efff6d51abf20f662" args="() const " --> |
---|
115 | ivec </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#b5817b5b3c4b7c7efff6d51abf20f662">get_bins</a> () const </td></tr> |
---|
116 | |
---|
117 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access to histogram as a vector. <br></td></tr> |
---|
118 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8ccc9a79ae8226a576d261aa07828d70"></a><!-- doxytag: member="itpp::Histogram::get_bin_centers" ref="8ccc9a79ae8226a576d261aa07828d70" args="() const " --> |
---|
119 | <a class="el" href="classitpp_1_1Vec.html">Vec</a>< Num_T > </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#8ccc9a79ae8226a576d261aa07828d70">get_bin_centers</a> () const </td></tr> |
---|
120 | |
---|
121 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access to <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> center values (all bins). <br></td></tr> |
---|
122 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="348d3558b0a92cf8add2607cf4803c1c"></a><!-- doxytag: member="itpp::Histogram::get_bin_center" ref="348d3558b0a92cf8add2607cf4803c1c" args="(int ix) const " --> |
---|
123 | Num_T </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#348d3558b0a92cf8add2607cf4803c1c">get_bin_center</a> (int ix) const </td></tr> |
---|
124 | |
---|
125 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access to <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> center (single <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a>). <br></td></tr> |
---|
126 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e44283fce736cc6e8f96fa86823eca06"></a><!-- doxytag: member="itpp::Histogram::get_bin_lefts" ref="e44283fce736cc6e8f96fa86823eca06" args="() const " --> |
---|
127 | <a class="el" href="classitpp_1_1Vec.html">Vec</a>< Num_T > </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#e44283fce736cc6e8f96fa86823eca06">get_bin_lefts</a> () const </td></tr> |
---|
128 | |
---|
129 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access to left boundary of <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> intervals (all bins). <br></td></tr> |
---|
130 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fd5f81bd76ace561d748d9b9bfc2c1e8"></a><!-- doxytag: member="itpp::Histogram::get_bin_left" ref="fd5f81bd76ace561d748d9b9bfc2c1e8" args="(int ix) const " --> |
---|
131 | Num_T </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#fd5f81bd76ace561d748d9b9bfc2c1e8">get_bin_left</a> (int ix) const </td></tr> |
---|
132 | |
---|
133 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access to left boundary of single <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a>. <br></td></tr> |
---|
134 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="81a7925189d30efe6e046452c6c1a5b0"></a><!-- doxytag: member="itpp::Histogram::get_bin_rights" ref="81a7925189d30efe6e046452c6c1a5b0" args="() const " --> |
---|
135 | <a class="el" href="classitpp_1_1Vec.html">Vec</a>< Num_T > </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#81a7925189d30efe6e046452c6c1a5b0">get_bin_rights</a> () const </td></tr> |
---|
136 | |
---|
137 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access to right boundary of <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> intervals (all bins). <br></td></tr> |
---|
138 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d9668c631cfc20d5b51e1f5b115b606b"></a><!-- doxytag: member="itpp::Histogram::get_bin_right" ref="d9668c631cfc20d5b51e1f5b115b606b" args="(int ix) const " --> |
---|
139 | Num_T </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#d9668c631cfc20d5b51e1f5b115b606b">get_bin_right</a> (int ix) const </td></tr> |
---|
140 | |
---|
141 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Access to right boundary of single <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a>. <br></td></tr> |
---|
142 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g0734cd4bae5ea37fd00e18bf21be4cb5"></a><!-- doxytag: member="itpp::Histogram::get_pdf" ref="g0734cd4bae5ea37fd00e18bf21be4cb5" args="() const " --> |
---|
143 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="group__histogram.html#g0734cd4bae5ea37fd00e18bf21be4cb5">get_pdf</a> () const </td></tr> |
---|
144 | |
---|
145 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Experimental Probability Density Function (PDF) computation. <br></td></tr> |
---|
146 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g18cfd3695d2e3b485f495962475438c4"></a><!-- doxytag: member="itpp::Histogram::get_cdf" ref="g18cfd3695d2e3b485f495962475438c4" args="() const " --> |
---|
147 | vec </td><td class="memItemRight" valign="bottom"><a class="el" href="group__histogram.html#g18cfd3695d2e3b485f495962475438c4">get_cdf</a> () const </td></tr> |
---|
148 | |
---|
149 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Experimental Cumulative Density Function (CDF) computation. <br></td></tr> |
---|
150 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0d7969f2faf89dba3d26e5c6bd7e63b0"></a><!-- doxytag: member="itpp::Histogram::bins_num" ref="0d7969f2faf89dba3d26e5c6bd7e63b0" args="() const " --> |
---|
151 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#0d7969f2faf89dba3d26e5c6bd7e63b0">bins_num</a> () const </td></tr> |
---|
152 | |
---|
153 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Current number of bins. <br></td></tr> |
---|
154 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cb38ac4d25f19ddedc70c57afbb6bbe7"></a><!-- doxytag: member="itpp::Histogram::trials_num" ref="cb38ac4d25f19ddedc70c57afbb6bbe7" args="() const " --> |
---|
155 | int </td><td class="memItemRight" valign="bottom"><a class="el" href="classitpp_1_1Histogram.html#cb38ac4d25f19ddedc70c57afbb6bbe7">trials_num</a> () const </td></tr> |
---|
156 | |
---|
157 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Current trials counter. <br></td></tr> |
---|
158 | </table> |
---|
159 | <hr><a name="_details"></a><h2>Detailed Description</h2> |
---|
160 | <h3>template<typename Num_T><br> |
---|
161 | class itpp::Histogram< Num_T ></h3> |
---|
162 | |
---|
163 | <a class="el" href="classitpp_1_1Histogram.html" title="Histogram computation class.">Histogram</a> computation class. |
---|
164 | <p> |
---|
165 | <dl class="author" compact><dt><b>Author:</b></dt><dd>Andy Panov</dd></dl> |
---|
166 | The <a class="el" href="classitpp_1_1Histogram.html" title="Histogram computation class.">Histogram</a> class counts the number of observations of arbitrary numerical types that fall into specified bins. Centers of the leftmost and rightmost <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> along with a total number of bins are passed to a histogram object as constructor parameters. <a class="el" href="classitpp_1_1Histogram.html" title="Histogram computation class.">Histogram</a> counters are updated when calling <a class="el" href="group__histogram.html#gaf127f05ede5a7c147b23374bb90f89e" title="Histogram update.">update()</a> method. It is possible to access <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> counters and <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a> interval parameters for all bins at once or separately for each <a class="el" href="classitpp_1_1bin.html" title="Binary arithmetic (boolean) class.">bin</a>.<p> |
---|
167 | Example: <div class="fragment"><pre class="fragment"> <span class="comment">// Create histogram with 100 bins spanning from 0 to 99 (leftmost bin is</span> |
---|
168 | <span class="comment">// centered at 0, rightmost bin is centerd at 99).</span> |
---|
169 | Histogram<double> hist(0, 99, 100); |
---|
170 | |
---|
171 | <span class="comment">// Compute histogram of 100 random variables taken from normal distribution</span> |
---|
172 | hist.update(<a class="code" href="group__randgen.html#g9ecf5af23567f51abc9af737fdbd872a" title="Generates a random Gaussian (0,1) variable.">randn</a>(100)); |
---|
173 | |
---|
174 | <span class="comment">// Get position of bin number 5</span> |
---|
175 | <span class="keywordtype">double</span> bin5_center = hist.get_bin_center(5); |
---|
176 | <span class="comment">// Get corresponding bin counter</span> |
---|
177 | <span class="keywordtype">int</span> bin5_counter = hist.get_bin(5); |
---|
178 | <span class="comment">// Get bin 5 left boundary:</span> |
---|
179 | <span class="keywordtype">double</span> bin5_left = hist.get_bin_left(5); |
---|
180 | |
---|
181 | <span class="comment">// compute PDF & CDF of experimental data</span> |
---|
182 | vec my_data_pdf = hist.get_pdf(); |
---|
183 | vec my_data_cdf = hist.get_cdf(); |
---|
184 | </pre></div> <hr>The documentation for this class was generated from the following file:<ul> |
---|
185 | <li><a class="el" href="histogram_8h-source.html">histogram.h</a></ul> |
---|
186 | </div> |
---|
187 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:19 2009 for mixpp by |
---|
188 | <a href="http://www.doxygen.org/index.html"> |
---|
189 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
190 | </body> |
---|
191 | </html> |
---|