root/doc/html/mog__generic_8h-source.html @ 353

Revision 353, 35.0 kB (checked in by smidl, 16 years ago)

doc

Line 
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: mog_generic.h Source File</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<!--
10function 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}
22function 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}
46window.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&nbsp;Page</span></a></li>
53      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
54      <li><a href="modules.html"><span>Modules</span></a></li>
55      <li><a href="annotated.html"><span>Classes</span></a></li>
56      <li class="current"><a href="files.html"><span>Files</span></a></li>
57    </ul>
58  </div>
59  <div class="tabs">
60    <ul>
61      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
62      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
63    </ul>
64  </div>
65<h1>mog_generic.h</h1><a href="mog__generic_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
66<a name="l00029"></a>00029 <span class="preprocessor">#ifndef MOG_GENERIC_H</span>
67<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define MOG_GENERIC_H</span>
68<a name="l00031"></a>00031 <span class="preprocessor"></span>
69<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="vec_8h.html" title="Templated Vector Class Definitions.">itpp/base/vec.h</a>&gt;</span>
70<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="mat_8h.html" title="Matrix Class Definitions.">itpp/base/mat.h</a>&gt;</span>
71<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="array_8h.html" title="Definition of Array class (container).">itpp/base/array.h</a>&gt;</span>
72<a name="l00035"></a>00035
73<a name="l00036"></a>00036
74<a name="l00037"></a>00037 <span class="keyword">namespace </span>itpp
75<a name="l00038"></a>00038 {
76<a name="l00039"></a>00039
77<a name="l00056"></a><a class="code" href="classitpp_1_1MOG__generic.html">00056</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1MOG__generic.html" title="Generic Mixture of Gaussians (MOG) class. Used as a base for other MOG classes.">MOG_generic</a>
78<a name="l00057"></a>00057 {
79<a name="l00058"></a>00058
80<a name="l00059"></a>00059 <span class="keyword">public</span>:
81<a name="l00060"></a>00060
82<a name="l00066"></a><a class="code" href="classitpp_1_1MOG__generic.html#e43453749e36c5d049dfdf3693c9aba3">00066</a>   <a class="code" href="classitpp_1_1MOG__generic.html#e43453749e36c5d049dfdf3693c9aba3" title="Default constructor.">MOG_generic</a>() { <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(); }
83<a name="l00067"></a>00067
84<a name="l00071"></a><a class="code" href="classitpp_1_1MOG__generic.html#398c162cd9f5e5ce948ca64ccc78d32c">00071</a>   <a class="code" href="classitpp_1_1MOG__generic.html#398c162cd9f5e5ce948ca64ccc78d32c" title="Construct the MOG_generic object by loading the parameters from a model file.">MOG_generic</a>(<span class="keyword">const</span> std::string &amp;name_in) { <a class="code" href="classitpp_1_1MOG__generic.html#e6601e39373de56c23a52ca7eaabfbed" title="Initialise the model by loading the parameters from a model file.">load</a>(name_in); }
85<a name="l00072"></a>00072
86<a name="l00078"></a><a class="code" href="classitpp_1_1MOG__generic.html#67985c3af6d071384fa3241c20779f29">00078</a>   <a class="code" href="classitpp_1_1MOG__generic.html#67985c3af6d071384fa3241c20779f29" title="construct a default model (all Gaussians have zero mean and unit variance for all...">MOG_generic</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;K_in, <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;D_in, <span class="keywordtype">bool</span> full_in = <span class="keyword">false</span>) { <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(K_in, D_in, full_in); }
87<a name="l00079"></a>00079
88<a name="l00087"></a><a class="code" href="classitpp_1_1MOG__generic.html#444867bddfc7f157ef0161ce122e7b22">00087</a>   <a class="code" href="classitpp_1_1MOG__generic.html#444867bddfc7f157ef0161ce122e7b22" title="Construct a model using user supplied mean vectors.">MOG_generic</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;means_in, <span class="keywordtype">bool</span> full_in = <span class="keyword">false</span>) { <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(means_in, full_in); }
89<a name="l00088"></a>00088
90<a name="l00095"></a><a class="code" href="classitpp_1_1MOG__generic.html#34e712cff720d4521628d3c01bbf1bf7">00095</a>   <a class="code" href="classitpp_1_1MOG__generic.html#34e712cff720d4521628d3c01bbf1bf7" title="Construct a model using user supplied parameters (diagonal covariance version).">MOG_generic</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;means_in, <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;diag_covs_in, vec &amp;weights_in) { <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(means_in, diag_covs_in, weights_in); }
91<a name="l00096"></a>00096
92<a name="l00103"></a><a class="code" href="classitpp_1_1MOG__generic.html#654c32682d638a1cd93300f359468f70">00103</a>   <a class="code" href="classitpp_1_1MOG__generic.html#654c32682d638a1cd93300f359468f70" title="Construct a model using user supplied parameters (full covariance version).">MOG_generic</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;means_in, <a class="code" href="classitpp_1_1Array.html">Array&lt;mat&gt;</a> &amp;full_covs_in, vec &amp;weights_in) { <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(means_in, full_covs_in, weights_in); }
93<a name="l00104"></a>00104
94<a name="l00106"></a><a class="code" href="classitpp_1_1MOG__generic.html#e583048e9d459555079707da471d857c">00106</a>   <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1MOG__generic.html#e583048e9d459555079707da471d857c" title="Default destructor.">~MOG_generic</a>() { <a class="code" href="classitpp_1_1MOG__generic.html#2954f4c30d0f58197d18a886bd17bcee" title="Release memory used by the model. The model will be empty.">cleanup</a>(); }
95<a name="l00107"></a>00107
96<a name="l00112"></a>00112   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>();
97<a name="l00113"></a>00113
98<a name="l00119"></a>00119   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> &amp;K_in, <span class="keyword">const</span> <span class="keywordtype">int</span> &amp;D_in, <span class="keywordtype">bool</span> full_in = <span class="keyword">false</span>);
99<a name="l00120"></a>00120
100<a name="l00128"></a>00128   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;means_in, <span class="keywordtype">bool</span> full_in = <span class="keyword">false</span>);
101<a name="l00129"></a>00129
102<a name="l00136"></a>00136   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;means_in, <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;diag_covs_in, vec &amp;weights_in);
103<a name="l00137"></a>00137
104<a name="l00144"></a>00144   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#331210d0a4ebfbab47d1ba64c8033879" title="Initialise the model to be empty.">init</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;means_in, <a class="code" href="classitpp_1_1Array.html">Array&lt;mat&gt;</a> &amp;full_covs_in, vec &amp;weights_in);
105<a name="l00145"></a>00145
106<a name="l00150"></a>00150   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#2954f4c30d0f58197d18a886bd17bcee" title="Release memory used by the model. The model will be empty.">cleanup</a>();
107<a name="l00151"></a>00151
108<a name="l00153"></a><a class="code" href="classitpp_1_1MOG__generic.html#b39d42cafa3b08a3595d35b12e564198">00153</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#b39d42cafa3b08a3595d35b12e564198" title="Returns true if the model&amp;#39;s parameters are valid.">is_valid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061" title="indicates whether the parameters are valid">valid</a>; }
109<a name="l00154"></a>00154
110<a name="l00156"></a><a class="code" href="classitpp_1_1MOG__generic.html#c27623ea75a58f8335e13c0675183faa">00156</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#c27623ea75a58f8335e13c0675183faa" title="Returns true if the model has full covariance matrices.">is_full</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classitpp_1_1MOG__generic.html#d2285742cd7425f18a97e461a0e6ec82" title="indicates whether we are using full or diagonal covariance matrices">full</a>; }
111<a name="l00157"></a>00157
112<a name="l00159"></a><a class="code" href="classitpp_1_1MOG__generic.html#217c1ba5bf096f693a64fb30e701448f">00159</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1MOG__generic.html#217c1ba5bf096f693a64fb30e701448f" title="Return the number of Gaussians.">get_K</a>()<span class="keyword"> const </span>{ <span class="keywordflow">if</span> (<a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061" title="indicates whether the parameters are valid">valid</a>) <span class="keywordflow">return</span>(<a class="code" href="classitpp_1_1MOG__generic.html#51e3fd88ae69555151a939a7361e1762" title="number of gaussians">K</a>); <span class="keywordflow">else</span> <span class="keywordflow">return</span>(0); }
113<a name="l00160"></a>00160
114<a name="l00162"></a><a class="code" href="classitpp_1_1MOG__generic.html#a8606d3aec30d2a97bbea289adee66aa">00162</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1MOG__generic.html#a8606d3aec30d2a97bbea289adee66aa" title="Return the dimensionality.">get_D</a>()<span class="keyword"> const </span>{ <span class="keywordflow">if</span> (<a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061" title="indicates whether the parameters are valid">valid</a>) <span class="keywordflow">return</span>(<a class="code" href="classitpp_1_1MOG__generic.html#c03e7ca34817d33ecb3ec87f54e07cd7" title="dimensionality">D</a>); <span class="keywordflow">else</span> <span class="keywordflow">return</span>(0); }
115<a name="l00163"></a>00163
116<a name="l00165"></a><a class="code" href="classitpp_1_1MOG__generic.html#49266cd7de7805438cf94e6804620974">00165</a>   vec <a class="code" href="classitpp_1_1MOG__generic.html#49266cd7de7805438cf94e6804620974" title="Obtain a copy of the weight vector.">get_weights</a>()<span class="keyword"> const </span>{ vec tmp;  <span class="keywordflow">if</span> (<a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061" title="indicates whether the parameters are valid">valid</a>) { tmp = <a class="code" href="classitpp_1_1MOG__generic.html#903961e6632638e3d91e1b0b8a5f4817" title="weights">weights</a>; } <span class="keywordflow">return</span> tmp; }
117<a name="l00166"></a>00166
118<a name="l00168"></a><a class="code" href="classitpp_1_1MOG__generic.html#8ba7dde83d6377b05c8604a6e5bc222d">00168</a>   <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> <a class="code" href="classitpp_1_1MOG__generic.html#8ba7dde83d6377b05c8604a6e5bc222d" title="Obtain a copy of the array of mean vectors.">get_means</a>()<span class="keyword"> const </span>{ <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> tmp; <span class="keywordflow">if</span> (<a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061" title="indicates whether the parameters are valid">valid</a>) { tmp = <a class="code" href="classitpp_1_1MOG__generic.html#ce3f0974dc90c7616a76088500e1cbea" title="means">means</a>; } <span class="keywordflow">return</span> tmp; }
119<a name="l00169"></a>00169
120<a name="l00171"></a><a class="code" href="classitpp_1_1MOG__generic.html#0fb44dc53203033b810eb997add5a9ca">00171</a>   <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> <a class="code" href="classitpp_1_1MOG__generic.html#0fb44dc53203033b810eb997add5a9ca" title="Obtain a copy of the array of diagonal covariance vectors.">get_diag_covs</a>()<span class="keyword"> const </span>{ <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> tmp; <span class="keywordflow">if</span> (<a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061" title="indicates whether the parameters are valid">valid</a> &amp;&amp; !<a class="code" href="classitpp_1_1MOG__generic.html#d2285742cd7425f18a97e461a0e6ec82" title="indicates whether we are using full or diagonal covariance matrices">full</a>) { tmp = <a class="code" href="classitpp_1_1MOG__generic.html#b15093a04bd84221c44b794831ebecd0" title="diagonal covariance matrices, stored as vectors">diag_covs</a>; } <span class="keywordflow">return</span> tmp; }
121<a name="l00172"></a>00172
122<a name="l00174"></a><a class="code" href="classitpp_1_1MOG__generic.html#ff62148d59ffa1fb40a07259546f0afd">00174</a>   <a class="code" href="classitpp_1_1Array.html">Array&lt;mat&gt;</a> <a class="code" href="classitpp_1_1MOG__generic.html#ff62148d59ffa1fb40a07259546f0afd" title="Obtain a copy of the array of full covariance matrices.">get_full_covs</a>()<span class="keyword"> const </span>{ <a class="code" href="classitpp_1_1Array.html">Array&lt;mat&gt;</a> tmp; <span class="keywordflow">if</span> (<a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061" title="indicates whether the parameters are valid">valid</a> &amp;&amp; <a class="code" href="classitpp_1_1MOG__generic.html#d2285742cd7425f18a97e461a0e6ec82" title="indicates whether we are using full or diagonal covariance matrices">full</a>) { tmp = <a class="code" href="classitpp_1_1MOG__generic.html#25212d7e9406dd32620cd1f191562d8f" title="full covariance matrices">full_covs</a>; } <span class="keywordflow">return</span> tmp; }
123<a name="l00175"></a>00175
124<a name="l00179"></a>00179   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#7cecfa0184f63f928381103dcff050ff" title="Set the means of the model.">set_means</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;means_in);
125<a name="l00180"></a>00180
126<a name="l00184"></a>00184   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#bb90adbcf6e3963dc63ce7fdc409faff" title="Set the diagonal covariance vectors of the model.">set_diag_covs</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;diag_covs_in);
127<a name="l00185"></a>00185
128<a name="l00189"></a>00189   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#7582399d9bdbfa90eb1fe2381af6b5fb" title="Set the full covariance matrices of the model.">set_full_covs</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;mat&gt;</a> &amp;full_covs_in);
129<a name="l00190"></a>00190
130<a name="l00194"></a>00194   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#f208b278df2f6334099b246c156094e0" title="Set the weight vector of the model.">set_weights</a>(vec &amp;weights_in);
131<a name="l00195"></a>00195
132<a name="l00197"></a>00197   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#648a73469fc824517e35e43d78795296" title="Set the means in the model to be zero.">set_means_zero</a>();
133<a name="l00198"></a>00198
134<a name="l00200"></a>00200   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#0e28ac0f40c8b95a3449e9aba38ed141" title="Set the diagonal covariance vectors to be unity.">set_diag_covs_unity</a>();
135<a name="l00201"></a>00201
136<a name="l00203"></a>00203   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#2d8c1cd740bca3a8ab5538ed634506ba" title="Set the full covariance matrices to be unity.">set_full_covs_unity</a>();
137<a name="l00204"></a>00204
138<a name="l00206"></a>00206   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#1292c3480c3260a7813fa7d30a6de01a" title="Set all the weights to 1/K, where K is the number of Gaussians.">set_weights_uniform</a>();
139<a name="l00207"></a>00207
140<a name="l00213"></a><a class="code" href="classitpp_1_1MOG__generic.html#1fdbb97943bbb5bd634b062750f17f67">00213</a>   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#1fdbb97943bbb5bd634b062750f17f67" title="Enable/disable internal checks for likelihood functions.">set_checks</a>(<span class="keywordtype">bool</span> do_checks_in) { <a class="code" href="classitpp_1_1MOG__generic.html#4b30c5c34e3503df8378b043a8a7776b" title="indicates whether checks on input data are done">do_checks</a> = do_checks_in; }
141<a name="l00214"></a>00214
142<a name="l00218"></a><a class="code" href="classitpp_1_1MOG__generic.html#edd93bdbe6f111a6f49e3b7176fa7c08">00218</a>   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#edd93bdbe6f111a6f49e3b7176fa7c08" title="Enable/disable paranoia about numerical stability.">set_paranoid</a>(<span class="keywordtype">bool</span> paranoid_in) { <a class="code" href="classitpp_1_1MOG__generic.html#f9483049eadafc782080888da20ce9dd" title="indicates whether we are paranoid about numerical stability">paranoid</a> = paranoid_in; }
143<a name="l00219"></a>00219
144<a name="l00223"></a>00223   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#e6601e39373de56c23a52ca7eaabfbed" title="Initialise the model by loading the parameters from a model file.">load</a>(<span class="keyword">const</span> std::string &amp;name_in);
145<a name="l00224"></a>00224
146<a name="l00228"></a>00228   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#c9446a81ab2227128e8a4180a082c809" title="Save the model&amp;#39;s parameters to a model file.">save</a>(<span class="keyword">const</span> std::string &amp;name_in) <span class="keyword">const</span>;
147<a name="l00229"></a>00229
148<a name="l00246"></a>00246   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#bccd9353a67e9bda9f1db8872487ec30" title="Mathematically join the model with a user supplied model.">join</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1MOG__generic.html" title="Generic Mixture of Gaussians (MOG) class. Used as a base for other MOG classes.">MOG_generic</a> &amp;B_in);
149<a name="l00247"></a>00247
150<a name="l00255"></a>00255   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#3bf2b05e3069a3d0082e372dc455bd9d" title="Convert the model to use diagonal covariances.">convert_to_diag</a>();
151<a name="l00256"></a>00256
152<a name="l00262"></a>00262   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#6fefdf2622cdcc10993e815b1f2d7a96" title="Convert the model to have full covariance matrices.">convert_to_full</a>();
153<a name="l00263"></a>00263
154<a name="l00265"></a>00265   <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1MOG__generic.html#8a1924e02e2946294e7ba90ff95c4724" title="calculate the log likelihood of vector x_in using only Gaussian k ">log_lhood_single_gaus</a>(<span class="keyword">const</span> vec &amp;x_in, <span class="keyword">const</span> <span class="keywordtype">int</span> k);
155<a name="l00266"></a>00266
156<a name="l00268"></a>00268   <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1MOG__generic.html#6e88002db7abcec3317c70a4d2db6c50" title="calculate the log likelihood of vector x_in ">log_lhood</a>(<span class="keyword">const</span> vec &amp;x_in);
157<a name="l00269"></a>00269
158<a name="l00271"></a>00271   <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1MOG__generic.html#06845a8f7b0d0342701ef9c96dc12e89" title="calculate the likelihood of vector x_in ">lhood</a>(<span class="keyword">const</span> vec &amp;x_in);
159<a name="l00272"></a>00272
160<a name="l00274"></a>00274   <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1MOG__generic.html#42bd3f8f0a54e2957279c24b40719b08" title="calculate the average log likelihood of an array of vectors X_in ">avg_log_lhood</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;X_in);
161<a name="l00275"></a>00275
162<a name="l00276"></a>00276 <span class="keyword">protected</span>:
163<a name="l00277"></a>00277
164<a name="l00279"></a><a class="code" href="classitpp_1_1MOG__generic.html#4b30c5c34e3503df8378b043a8a7776b">00279</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#4b30c5c34e3503df8378b043a8a7776b" title="indicates whether checks on input data are done">do_checks</a>;
165<a name="l00280"></a>00280
166<a name="l00282"></a><a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061">00282</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#6e0bfdbd0726a10128c5cab0ee121061" title="indicates whether the parameters are valid">valid</a>;
167<a name="l00283"></a>00283
168<a name="l00285"></a><a class="code" href="classitpp_1_1MOG__generic.html#d2285742cd7425f18a97e461a0e6ec82">00285</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#d2285742cd7425f18a97e461a0e6ec82" title="indicates whether we are using full or diagonal covariance matrices">full</a>;
169<a name="l00286"></a>00286
170<a name="l00288"></a><a class="code" href="classitpp_1_1MOG__generic.html#f9483049eadafc782080888da20ce9dd">00288</a>   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#f9483049eadafc782080888da20ce9dd" title="indicates whether we are paranoid about numerical stability">paranoid</a>;
171<a name="l00289"></a>00289
172<a name="l00291"></a><a class="code" href="classitpp_1_1MOG__generic.html#51e3fd88ae69555151a939a7361e1762">00291</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1MOG__generic.html#51e3fd88ae69555151a939a7361e1762" title="number of gaussians">K</a>;
173<a name="l00292"></a>00292
174<a name="l00294"></a><a class="code" href="classitpp_1_1MOG__generic.html#c03e7ca34817d33ecb3ec87f54e07cd7">00294</a>   <span class="keywordtype">int</span> <a class="code" href="classitpp_1_1MOG__generic.html#c03e7ca34817d33ecb3ec87f54e07cd7" title="dimensionality">D</a>;
175<a name="l00295"></a>00295
176<a name="l00297"></a><a class="code" href="classitpp_1_1MOG__generic.html#ce3f0974dc90c7616a76088500e1cbea">00297</a>   <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> <a class="code" href="classitpp_1_1MOG__generic.html#ce3f0974dc90c7616a76088500e1cbea" title="means">means</a>;
177<a name="l00298"></a>00298
178<a name="l00300"></a><a class="code" href="classitpp_1_1MOG__generic.html#b15093a04bd84221c44b794831ebecd0">00300</a>   <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> <a class="code" href="classitpp_1_1MOG__generic.html#b15093a04bd84221c44b794831ebecd0" title="diagonal covariance matrices, stored as vectors">diag_covs</a>;
179<a name="l00301"></a>00301
180<a name="l00303"></a><a class="code" href="classitpp_1_1MOG__generic.html#25212d7e9406dd32620cd1f191562d8f">00303</a>   <a class="code" href="classitpp_1_1Array.html">Array&lt;mat&gt;</a> <a class="code" href="classitpp_1_1MOG__generic.html#25212d7e9406dd32620cd1f191562d8f" title="full covariance matrices">full_covs</a>;
181<a name="l00304"></a>00304
182<a name="l00306"></a><a class="code" href="classitpp_1_1MOG__generic.html#903961e6632638e3d91e1b0b8a5f4817">00306</a>   vec <a class="code" href="classitpp_1_1MOG__generic.html#903961e6632638e3d91e1b0b8a5f4817" title="weights">weights</a>;
183<a name="l00307"></a>00307
184<a name="l00309"></a><a class="code" href="classitpp_1_1MOG__generic.html#e63c0eb25aa38f9ee948e2566e239a2e">00309</a>   <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1MOG__generic.html#e63c0eb25aa38f9ee948e2566e239a2e" title="Pre-calcualted std::log(std::numeric_limits&amp;lt;double&amp;gt;::max() / K), where K is...">log_max_K</a>;
185<a name="l00310"></a>00310
186<a name="l00316"></a><a class="code" href="classitpp_1_1MOG__generic.html#c950e3b9cb8f9b1d71b93131455de32b">00316</a>   vec <a class="code" href="classitpp_1_1MOG__generic.html#c950e3b9cb8f9b1d71b93131455de32b" title="Gaussian specific pre-calcualted constants.">log_det_etc</a>;
187<a name="l00317"></a>00317
188<a name="l00319"></a><a class="code" href="classitpp_1_1MOG__generic.html#c8e7908f52565160667da80c03fcc0be">00319</a>   vec <a class="code" href="classitpp_1_1MOG__generic.html#c8e7908f52565160667da80c03fcc0be" title="Pre-calculated log versions of the weights.">log_weights</a>;
189<a name="l00320"></a>00320
190<a name="l00322"></a><a class="code" href="classitpp_1_1MOG__generic.html#1324a33e5a5b5f9a75168415acc8a561">00322</a>   <a class="code" href="classitpp_1_1Array.html">Array&lt;mat&gt;</a> <a class="code" href="classitpp_1_1MOG__generic.html#1324a33e5a5b5f9a75168415acc8a561" title="Pre-calcuated inverted version of each full covariance matrix.">full_covs_inv</a>;
191<a name="l00323"></a>00323
192<a name="l00325"></a><a class="code" href="classitpp_1_1MOG__generic.html#c74ddce5d7899b0fa8c28b4f6aeb731b">00325</a>   <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> <a class="code" href="classitpp_1_1MOG__generic.html#c74ddce5d7899b0fa8c28b4f6aeb731b" title="Pre-calcuated inverted version of each diagonal covariance vector, where the covariance...">diag_covs_inv_etc</a>;
193<a name="l00326"></a>00326
194<a name="l00328"></a>00328   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#3c236fd20912f9cfc8930594a0a2d0a0" title="Check if vector x_in has the same dimensionality as the model.">check_size</a>(<span class="keyword">const</span> vec &amp;x_in) <span class="keyword">const</span>;
195<a name="l00329"></a>00329
196<a name="l00331"></a>00331   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#3c236fd20912f9cfc8930594a0a2d0a0" title="Check if vector x_in has the same dimensionality as the model.">check_size</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;X_in) <span class="keyword">const</span>;
197<a name="l00332"></a>00332
198<a name="l00334"></a>00334   <span class="keywordtype">bool</span> <a class="code" href="classitpp_1_1MOG__generic.html#68b0f071e9a73256b5170c5d92430922" title="Check if all vectors in Array X_in have the same dimensionality.">check_array_uniformity</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp; A) <span class="keyword">const</span>;
199<a name="l00335"></a>00335
200<a name="l00337"></a>00337   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#9ad3115741081ee1137e1d9cb0a86728" title="ADD DOCUMENTATION HERE.">set_means_internal</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;means_in);
201<a name="l00339"></a>00339   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#20f6a520b2fae8e792086ab1187dcdc1" title="ADD DOCUMENTATION HERE.">set_diag_covs_internal</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;vec&gt;</a> &amp;diag_covs_in);
202<a name="l00341"></a>00341   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#495c868950c9c1d6a1c14f4ee8f46d64" title="ADD DOCUMENTATION HERE.">set_full_covs_internal</a>(<a class="code" href="classitpp_1_1Array.html">Array&lt;mat&gt;</a> &amp;full_covs_in);
203<a name="l00343"></a>00343   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#40ef85a6ef1e2d0bb551f8244517053b" title="ADD DOCUMENTATION HERE.">set_weights_internal</a>(vec &amp;_weigths);
204<a name="l00344"></a>00344
205<a name="l00346"></a>00346   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#d17a84c168993aebb36de7643d77e99d" title="ADD DOCUMENTATION HERE.">set_means_zero_internal</a>();
206<a name="l00348"></a>00348   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#c9600f1d0f410b2e950f89b567436d36" title="ADD DOCUMENTATION HERE.">set_diag_covs_unity_internal</a>();
207<a name="l00350"></a>00350   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#b83aa9cd884301793f9d73b4f4520031" title="ADD DOCUMENTATION HERE.">set_full_covs_unity_internal</a>();
208<a name="l00352"></a>00352   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#25fae21ec832ab27fa5a1adb95162156" title="ADD DOCUMENTATION HERE.">set_weights_uniform_internal</a>();
209<a name="l00353"></a>00353
210<a name="l00355"></a>00355   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#0e4d8f80dc4ebac8ac5775431d756fe5" title="ADD DOCUMENTATION HERE.">convert_to_diag_internal</a>();
211<a name="l00357"></a>00357   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#5cfaccadb8f737d94478d407803cb801" title="ADD DOCUMENTATION HERE.">convert_to_full_internal</a>();
212<a name="l00358"></a>00358
213<a name="l00360"></a>00360   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#6381088cfc720cc5a7c4783527afa638" title="additional processing of mean vectors, done as the last step of mean initialisation...">setup_means</a>();
214<a name="l00361"></a>00361
215<a name="l00363"></a>00363   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#517640c3cad22b92885402ee60138d50" title="additional processing of covariance vectors/matrices, done as the last step of covariance...">setup_covs</a>();
216<a name="l00364"></a>00364
217<a name="l00366"></a>00366   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#1e98299192361b9a3fecff5269bb2d27" title="additional processing of the weight vector, done as the last step of weight initialisation...">setup_weights</a>();
218<a name="l00367"></a>00367
219<a name="l00369"></a>00369   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1MOG__generic.html#64afcabf4ff9c3728acd4354610e4726" title="additional processing of miscellaneous parameters, done as the last step of overall...">setup_misc</a>();
220<a name="l00370"></a>00370
221<a name="l00372"></a>00372   <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1MOG__generic.html#be79ca91efff04dc1162ee889acc3475" title="ADD DOCUMENTATION HERE.">log_lhood_single_gaus_internal</a>(<span class="keyword">const</span> vec &amp;x_in, <span class="keyword">const</span> <span class="keywordtype">int</span> k);
222<a name="l00374"></a>00374   <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1MOG__generic.html#9bd190b0f586c48b623bb42428b4b89a" title="ADD DOCUMENTATION HERE.">log_lhood_internal</a>(<span class="keyword">const</span> vec &amp;x_in);
223<a name="l00376"></a>00376   <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classitpp_1_1MOG__generic.html#bcd4fa95cbc9a97e5ebaa1f2facbc260" title="ADD DOCUMENTATION HERE.">lhood_internal</a>(<span class="keyword">const</span> vec &amp;x_in);
224<a name="l00377"></a>00377
225<a name="l00378"></a>00378 <span class="keyword">private</span>:
226<a name="l00379"></a>00379   vec tmpvecD;
227<a name="l00380"></a>00380   vec tmpvecK;
228<a name="l00381"></a>00381
229<a name="l00382"></a>00382 };
230<a name="l00383"></a>00383
231<a name="l00384"></a>00384 } <span class="comment">// namespace itpp</span>
232<a name="l00385"></a>00385
233<a name="l00386"></a>00386 <span class="preprocessor">#endif // #ifndef MOG_GENERIC_H</span>
234</pre></div></div>
235<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:12 2009 for mixpp by&nbsp;
236<a href="http://www.doxygen.org/index.html">
237<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
238</body>
239</html>
Note: See TracBrowser for help on using the browser.