Index: /mixpp.kdevelop.filelist
===================================================================
--- /mixpp.kdevelop.filelist (revision 4)
+++ /mixpp.kdevelop.filelist (revision 5)
@@ -4,4 +4,6 @@
 doc/latex
 doc/latex/Makefile
+itpp_ext.cpp
+itpp_ext.h
 libBM.cpp
 libBM.h
Index: /test0.cpp
===================================================================
--- /test0.cpp (revision 2)
+++ /test0.cpp (revision 5)
@@ -11,10 +11,12 @@
 {
 
-  RV th = RV("1 2","{a b }","1 1","0 0","0 0");
+	RV th = RV ( "1 2","{a b }","1 1","0 0","0 0" );
+	RV r = RV("3 4");
+	int i =0;
 
-  cout << th << th << endl;
+	cout << th << r << th(ivec(&1,1)) << endl;
 
-  //Exit program:
-  return 0;
+	//Exit program:
+	return 0;
 
 }
Index: /doc/html/classfnc.html
===================================================================
--- /doc/html/classfnc.html (revision 4)
+++ /doc/html/classfnc.html (revision 5)
@@ -32,5 +32,5 @@
 Class representing function of variables. <hr>The documentation for this class was generated from the following file:<ul>
 <li>work/mixpp/<a class="el" href="libBM_8h-source.html">libBM.h</a></ul>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 17 18:00:29 2008 for mixpp by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 18 09:57:40 2008 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
Index: /doc/html/annotated.html
===================================================================
--- /doc/html/annotated.html (revision 4)
+++ /doc/html/annotated.html (revision 5)
@@ -26,5 +26,5 @@
   <tr><td class="indexkey"><a class="el" href="classRV.html">RV</a></td><td class="indexvalue">Class representing variables, most often random variables </td></tr>
 </table>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 17 18:00:29 2008 for mixpp by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 18 09:57:40 2008 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
Index: /doc/html/files.html
===================================================================
--- /doc/html/files.html (revision 4)
+++ /doc/html/files.html (revision 5)
@@ -17,5 +17,5 @@
   <tr><td class="indexkey">work/mixpp/<a class="el" href="libDC_8cpp.html">libDC.cpp</a></td><td class="indexvalue">Matrices in decomposed forms (LDL', LU, UDU', etc) </td></tr>
 </table>
-<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 17 18:00:29 2008 for mixpp by&nbsp;
+<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 18 09:57:40 2008 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
Index: /doc/html/libBM_8h-source.html
===================================================================
--- /doc/html/libBM_8h-source.html (revision 4)
+++ /doc/html/libBM_8h-source.html (revision 5)
@@ -22,47 +22,52 @@
 <a name="l00019"></a>00019 <span class="keyword">using namespace </span>itpp;
 <a name="l00020"></a>00020 
-<a name="l00022"></a><a class="code" href="classRV.html">00022</a> <span class="keyword">class </span><a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> {
-<a name="l00023"></a>00023 <span class="keywordtype">int</span> len;
-<a name="l00024"></a>00024 ivec ids;
-<a name="l00025"></a>00025 ivec sizes;
-<a name="l00026"></a>00026 ivec times;
-<a name="l00027"></a>00027 ivec obs;
-<a name="l00028"></a>00028 Array&lt;std::string&gt; names;
-<a name="l00029"></a>00029 
-<a name="l00030"></a>00030 <span class="keyword">public</span>:
-<a name="l00032"></a>00032  <a class="code" href="classRV.html#e46882dec2c30b12be282d34b03417b2" title="Full constructor which is called by the others.">RV</a>(ivec in_ids, Array&lt;std::string&gt; in_names, ivec in_sizes, ivec in_times, ivec in_obs);
-<a name="l00034"></a>00034  <a class="code" href="classRV.html#e46882dec2c30b12be282d34b03417b2" title="Full constructor which is called by the others.">RV</a>(ivec ids);
-<a name="l00035"></a>00035  <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt;(std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rv);
-<a name="l00036"></a>00036 };
-<a name="l00037"></a>00037 
-<a name="l00038"></a>00038 
-<a name="l00039"></a>00039 
-<a name="l00040"></a>00040 
-<a name="l00042"></a><a class="code" href="classfnc.html">00042</a> <span class="keyword">class </span><a class="code" href="classfnc.html" title="Class representing function of variables.">fnc</a> {
-<a name="l00043"></a>00043 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rv;
-<a name="l00044"></a>00044 };
+<a name="l00026"></a><a class="code" href="classRV.html">00026</a> <span class="keyword">class </span><a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a>
+<a name="l00027"></a>00027 {
+<a name="l00028"></a>00028                 <span class="keywordtype">int</span> len;
+<a name="l00029"></a>00029                 ivec ids;
+<a name="l00030"></a>00030                 ivec sizes;
+<a name="l00031"></a>00031                 ivec times;
+<a name="l00032"></a>00032                 ivec obs;
+<a name="l00033"></a>00033                 Array&lt;std::string&gt; names;
+<a name="l00034"></a>00034 
+<a name="l00035"></a>00035         <span class="keyword">public</span>:
+<a name="l00037"></a>00037                 <a class="code" href="classRV.html#e46882dec2c30b12be282d34b03417b2" title="Full constructor which is called by the others.">RV</a> ( ivec in_ids, Array&lt;std::string&gt; in_names, ivec in_sizes, ivec in_times, ivec in_obs );
+<a name="l00039"></a>00039                 <a class="code" href="classRV.html#e46882dec2c30b12be282d34b03417b2" title="Full constructor which is called by the others.">RV</a> ( ivec ids );
+<a name="l00040"></a>00040                 <span class="keyword">friend</span> std::ostream &amp;operator&lt;&lt; ( std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> &amp;rv );
+<a name="l00041"></a>00041 };
+<a name="l00042"></a>00042 
+<a name="l00043"></a>00043 
+<a name="l00044"></a>00044 
 <a name="l00045"></a>00045 
-<a name="l00047"></a><a class="code" href="classBM.html">00047</a> <span class="keyword">class </span><a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a> {
-<a name="l00048"></a>00048 <span class="keyword">public</span>:
-<a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="classBM.html#c1b46da4abb4302ed57858558c90d641" title="Incremental Bayes rule.">bayes</a>(vec dt);
-<a name="l00052"></a>00052 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBM.html#c1b46da4abb4302ed57858558c90d641" title="Incremental Bayes rule.">bayes</a>(mat Dt);
-<a name="l00053"></a>00053 };
-<a name="l00054"></a>00054 
-<a name="l00056"></a><a class="code" href="classepdf.html">00056</a> <span class="keyword">class </span><a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a> {
-<a name="l00057"></a>00057 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rv;
-<a name="l00058"></a>00058 <span class="keyword">public</span>:
-<a name="l00060"></a>00060 <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#545555f9d561555603911f7d3989611f" title="Returns the required moment of the epdf.">moment</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> order = 1);
-<a name="l00061"></a>00061 };
-<a name="l00062"></a>00062 
-<a name="l00064"></a><a class="code" href="classmpdf.html">00064</a> <span class="keyword">class </span><a class="code" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a> {
-<a name="l00066"></a>00066 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rv;
-<a name="l00068"></a>00068 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvc;
-<a name="l00069"></a>00069 <span class="keyword">public</span>:
+<a name="l00047"></a><a class="code" href="classfnc.html">00047</a> <span class="keyword">class </span><a class="code" href="classfnc.html" title="Class representing function of variables.">fnc</a>
+<a name="l00048"></a>00048 {
+<a name="l00049"></a>00049                 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rv;
+<a name="l00050"></a>00050 };
+<a name="l00051"></a>00051 
+<a name="l00053"></a><a class="code" href="classBM.html">00053</a> <span class="keyword">class </span><a class="code" href="classBM.html" title="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</a>
+<a name="l00054"></a>00054 {
+<a name="l00055"></a>00055         <span class="keyword">public</span>:
+<a name="l00057"></a>00057                 <span class="keywordtype">void</span> <a class="code" href="classBM.html#c1b46da4abb4302ed57858558c90d641" title="Incremental Bayes rule.">bayes</a> ( vec dt );
+<a name="l00059"></a>00059                 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBM.html#c1b46da4abb4302ed57858558c90d641" title="Incremental Bayes rule.">bayes</a> ( mat Dt );
+<a name="l00060"></a>00060 };
+<a name="l00061"></a>00061 
+<a name="l00063"></a><a class="code" href="classepdf.html">00063</a> <span class="keyword">class </span><a class="code" href="classepdf.html" title="Probability density function with numerical statistics, e.g. posterior density.">epdf</a>
+<a name="l00064"></a>00064 {
+<a name="l00065"></a>00065                 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rv;
+<a name="l00066"></a>00066         <span class="keyword">public</span>:
+<a name="l00068"></a>00068                 <span class="keyword">virtual</span> vec <a class="code" href="classepdf.html#545555f9d561555603911f7d3989611f" title="Returns the required moment of the epdf.">moment</a> ( <span class="keyword">const</span> <span class="keywordtype">int</span> order = 1 );
+<a name="l00069"></a>00069 };
 <a name="l00070"></a>00070 
-<a name="l00072"></a>00072 <span class="keyword">virtual</span> <a class="code" href="classfnc.html" title="Class representing function of variables.">fnc</a> <a class="code" href="classmpdf.html#0863640c439869e8fbbbeb2bd8ea1fc0" title="Returns the required moment of the epdf.">moment</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> order = 1);
-<a name="l00073"></a>00073 };
-<a name="l00074"></a>00074 
-<a name="l00075"></a>00075 <span class="preprocessor">#endif // BM_H</span>
-</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 17 18:00:29 2008 for mixpp by&nbsp;
+<a name="l00072"></a><a class="code" href="classmpdf.html">00072</a> <span class="keyword">class </span><a class="code" href="classmpdf.html" title="Conditional probability density, e.g. modeling some dependencies.">mpdf</a>
+<a name="l00073"></a>00073 {
+<a name="l00075"></a>00075                 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rv;
+<a name="l00077"></a>00077                 <a class="code" href="classRV.html" title="Class representing variables, most often random variables.">RV</a> rvc;
+<a name="l00078"></a>00078         <span class="keyword">public</span>:
+<a name="l00079"></a>00079 
+<a name="l00081"></a>00081                 <span class="keyword">virtual</span> <a class="code" href="classfnc.html" title="Class representing function of variables.">fnc</a> <a class="code" href="classmpdf.html#0863640c439869e8fbbbeb2bd8ea1fc0" title="Returns the required moment of the epdf.">moment</a> ( <span class="keyword">const</span> <span class="keywordtype">int</span> order = 1 );
+<a name="l00082"></a>00082 };
+<a name="l00083"></a>00083 
+<a name="l00084"></a>00084 <span class="preprocessor">#endif // BM_H</span>
+</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 18 09:57:40 2008 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
Index: /doc/html/classfnc-members.html
===================================================================
--- /doc/html/classfnc-members.html (revision 4)
+++ /doc/html/classfnc-members.html (revision 5)
@@ -20,5 +20,5 @@
 </div>
 <h1>fnc Member List</h1>This is the complete list of members for <a class="el" href="classfnc.html">fnc</a>, including all inherited members.<p><table>
-</table><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 17 18:00:29 2008 for mixpp by&nbsp;
+</table><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 18 09:57:40 2008 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
Index: /doc/html/libBM_8h.html
===================================================================
--- /doc/html/libBM_8h.html (revision 4)
+++ /doc/html/libBM_8h.html (revision 5)
@@ -42,5 +42,5 @@
 <dl class="author" compact><dt><b>Author:</b></dt><dd>Vaclav Smidl.</dd></dl>
 ----------------------------------- BDM++ - C++ library for Bayesian Decision Making under Uncertainty<p>
-Using IT++ for numerical operations ----------------------------------- <hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 17 18:00:29 2008 for mixpp by&nbsp;
+Using IT++ for numerical operations ----------------------------------- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 18 09:57:40 2008 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
Index: /doc/html/index.html
===================================================================
--- /doc/html/index.html (revision 4)
+++ /doc/html/index.html (revision 5)
@@ -15,5 +15,5 @@
 <h1>mixpp Documentation</h1>
 <p>
-<h3 align="center">1 </h3><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 17 18:00:29 2008 for mixpp by&nbsp;
+<h3 align="center">1 </h3><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 18 09:57:40 2008 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
Index: /doc/html/libDC_8cpp.html
===================================================================
--- /doc/html/libDC_8cpp.html (revision 4)
+++ /doc/html/libDC_8cpp.html (revision 5)
@@ -27,5 +27,5 @@
 <dl class="author" compact><dt><b>Author:</b></dt><dd>Vaclav Smidl.</dd></dl>
 ----------------------------------- BDM++ - C++ library for Bayesian Decision Making under Uncertainty<p>
-Using IT++ for numerical operations ----------------------------------- <hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 17 18:00:29 2008 for mixpp by&nbsp;
+Using IT++ for numerical operations ----------------------------------- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Jan 18 09:57:40 2008 for mixpp by&nbsp;
 <a href="http://www.doxygen.org/index.html">
 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
Index: /doc/latex/refman.tex
===================================================================
--- /doc/latex/refman.tex (revision 4)
+++ /doc/latex/refman.tex (revision 5)
@@ -21,5 +21,5 @@
 {\large Generated by Doxygen 1.5.3}\\
 \vspace*{0.5cm}
-{\small Thu Jan 17 18:00:29 2008}\\
+{\small Fri Jan 18 09:57:40 2008}\\
 \end{center}
 \end{titlepage}
Index: /doc/latex/doxygen.sty
===================================================================
--- /doc/latex/doxygen.sty (revision 4)
+++ /doc/latex/doxygen.sty (revision 5)
@@ -11,6 +11,6 @@
 \rhead[\fancyplain{}{\bfseries\leftmark}]
         {\fancyplain{}{\bfseries\thepage}}
-\rfoot[\fancyplain{}{\bfseries\scriptsize Generated on Thu Jan 17 18:00:29 2008 for mixpp by Doxygen }]{}
-\lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated on Thu Jan 17 18:00:29 2008 for mixpp by Doxygen }}
+\rfoot[\fancyplain{}{\bfseries\scriptsize Generated on Fri Jan 18 09:57:40 2008 for mixpp by Doxygen }]{}
+\lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Jan 18 09:57:40 2008 for mixpp by Doxygen }}
 \cfoot{}
 \newenvironment{Code}
Index: /mixpp.kdevelop
===================================================================
--- /mixpp.kdevelop (revision 3)
+++ /mixpp.kdevelop (revision 5)
@@ -195,4 +195,5 @@
       <orientation>Vertical</orientation>
     </splitheadersource>
+    <references/>
   </kdevcppsupport>
   <cppsupportpart>
@@ -204,8 +205,18 @@
   <kdevdocumentation>
     <projectdoc>
-      <docsystem></docsystem>
-      <docurl></docurl>
-      <usermanualurl></usermanualurl>
+      <docsystem/>
+      <docurl/>
+      <usermanualurl/>
     </projectdoc>
   </kdevdocumentation>
+  <kdevfileview>
+    <groups>
+      <hidenonprojectfiles>false</hidenonprojectfiles>
+      <hidenonlocation>false</hidenonlocation>
+    </groups>
+    <tree>
+      <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+      <hidenonprojectfiles>false</hidenonprojectfiles>
+    </tree>
+  </kdevfileview>
 </kdevelop>
Index: /libBM.cpp
===================================================================
--- /libBM.cpp (revision 2)
+++ /libBM.cpp (revision 5)
@@ -1,22 +1,62 @@
 #include <itpp/itbase.h>
 #include "libBM.h"
+#include "itpp_ext.h"
 
 using namespace itpp;
 
+using std::cout;
 
-RV::RV(ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times, ivec in_obs) {
-//TODO: check consistency!
-// All vetors should be of same length
-ids = in_ids;
-names = in_names;
-sizes = in_sizes;
-times = in_times;
-obs = in_obs;
+void RV::init( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times, ivec in_obs ) {
+	//
+	len = in_ids.length();
+	//PRUDENT_MODE
+	// All vetors should be of same length
+	if ( 	 ( len != in_ids.length() ) || \
+	        ( len != in_names.length() ) || \
+	        ( len != in_sizes.length() ) || \
+	        ( len != in_times.length() ) || \
+	        ( len != in_obs.length() ) ) {
+		it_error( "RV::RV inconsistent length of input vectors." );
+	}
+
+	ids = in_ids;
+	names = in_names;
+	sizes = in_sizes;
+	times = in_times;
+	obs = in_obs;
 };
 
-std::ostream &operator<<(std::ostream &os, const RV &rv) {
+RV::RV ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times, ivec in_obs ) {
+	init ( in_ids, in_names, in_sizes, in_times, in_obs );
+}
 
-os << rv.names(0) << rv.names(1) << "(" << rv.ids(0) << ")";
+RV::RV ( ivec in_ids ) {
+	
+	len = in_ids.length();
+	Array<std::string> A( len );
+	std::string rvstr = "rv";
 
-return os;
+	for ( int i = 0; i < len;i++ ) {
+		A( i ) = rvstr + to_str(i);
+	}
+
+	init ( in_ids, A, ones_i( len ), zeros_i( len ), zeros_i( len ) );
 }
+
+RV RV::rvsubselect(ivec ind){
+	return RV(ids(ind), names(to_Arr(ind)), sizes(ind), times(ind), obs(ind));
+}
+
+RV RV::operator()(ivec ind){
+	return RV(ids(ind), names(to_Arr(ind)), sizes(ind), times(ind), obs(ind));
+}
+
+std::ostream &operator<<( std::ostream &os, const RV &rv ) {
+
+	for ( int i = 0; i < rv.len ;i++ ) {
+		os << rv.ids( i ) << "(" << rv.sizes( i ) << ")" <<  // id(size)=
+		"=" << rv.names( i )  << "_{"  << rv.times( i ) << "}; "; //name_{time}
+	}
+	return os;
+}
+
Index: /libBM.h
===================================================================
--- /libBM.h (revision 4)
+++ /libBM.h (revision 5)
@@ -1,13 +1,13 @@
 /*!
- * \file
- * \brief Bayesian Models (bm) that use Bayes rule to learn from observations
- * \author Vaclav Smidl.
- *
- * -----------------------------------
- * BDM++ - C++ library for Bayesian Decision Making under Uncertainty
- *
- * Using IT++ for numerical operations
- * -----------------------------------
- */
+  \file
+  \brief Bayesian Models (bm) that use Bayes rule to learn from observations
+  \author Vaclav Smidl.
+
+  -----------------------------------
+  BDM++ - C++ library for Bayesian Decision Making under Uncertainty
+
+  Using IT++ for numerical operations
+  -----------------------------------
+*/
 
 #ifndef BM_H
@@ -19,19 +19,37 @@
 using namespace itpp;
 
-//! Class representing variables, most often random variables
+/*!
+* \brief Class representing variables, most often random variables
+
+* More?...
+*/
 class RV {
-int len;
-ivec ids;
-ivec sizes;
-ivec times;
-ivec obs;
-Array<std::string> names;
+	int len;
+	ivec ids;
+	ivec sizes;
+	ivec times;
+	ivec obs;
+	Array<std::string> names;
 
+private:
+	void init ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times, ivec in_obs );
 public:
- //! Full constructor which is called by the others
- RV(ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times, ivec in_obs);
- //! default constructor 
- RV(ivec ids);
- friend std::ostream &operator<<(std::ostream &os, const RV &rv);
+	//! Full constructor which is called by the others
+	RV ( ivec in_ids, Array<std::string> in_names, ivec in_sizes, ivec in_times, ivec in_obs );
+	//! default constructor
+	RV ( ivec ids );
+	//! Printing output e.g. for debugging.
+	friend std::ostream &operator<< ( std::ostream &os, const RV &rv );
+
+	//! Find indexes of another rv in self
+	ivec rvfind(RV rv2);
+	//! Add (concat) another variable to the current one
+	RV rvadd(RV rv2);
+	//! Subtract  another variable from the current one
+	RV rvsubt(RV rv2);
+	//! Select only variables at indeces ind
+	RV rvsubselect(ivec ind);
+	//! Select only variables at indeces ind
+	RV operator()(ivec ind);
 };
 
@@ -41,5 +59,5 @@
 //! Class representing function of variables
 class fnc {
-RV rv;
+	RV rv;
 };
 
@@ -47,28 +65,28 @@
 class BM {
 public:
-//! Incremental Bayes rule
-void bayes(vec dt);
-//! Batch Bayes rule (columns of Dt are observations)
-virtual void bayes(mat Dt);
+	//! Incremental Bayes rule
+	void bayes ( vec dt );
+	//! Batch Bayes rule (columns of Dt are observations)
+	virtual void bayes ( mat Dt );
 };
 
 //! Probability density function with numerical statistics, e.g. posterior density.
 class epdf {
-RV rv;
+	RV rv;
 public:
-//! Returns the required moment of the epdf
-virtual vec moment(const int order = 1);
+	//! Returns the required moment of the epdf
+	virtual vec moment ( const int order = 1 );
 };
 
-//! Conditional probability density, e.g. modeling some dependencies. 
+//! Conditional probability density, e.g. modeling some dependencies.
 class mpdf {
-//! modeled random variable
-RV rv;
-//! random variable in condition
-RV rvc;
+	//! modeled random variable
+	RV rv;
+	//! random variable in condition
+	RV rvc;
 public:
 
-//! Returns the required moment of the epdf
-virtual fnc moment(const int order = 1);
+	//! Returns the required moment of the epdf
+	virtual fnc moment ( const int order = 1 );
 };
 
Index: /Makefile
===================================================================
--- /Makefile (revision 3)
+++ /Makefile (revision 5)
@@ -10,4 +10,4 @@
 	rm *.o test0
 
-test0: test0.cpp libBM.o libDC.o
+test0: test0.cpp libBM.o libDC.o itpp_ext.o
 
Index: /libDC.cpp
===================================================================
--- /libDC.cpp (revision 2)
+++ /libDC.cpp (revision 5)
@@ -17,34 +17,37 @@
 class LD
 {
-public:
+	public:
 
-  /**
-   * Perfroms a dyadic update $V = V + w v v'$
-   * @param  v Vector forming the dyad to be added
-   * @param  w weight of the updating dysad
-   */
-  void ldupdt (vec v, double w = 1.0 );
+		/**
+		 * Perfroms a dyadic update $V = V + w v v'$
+		 * @param  v Vector forming the dyad to be added
+		 * @param  w weight of the updating dysad
+		 */
+		void ldupdt ( vec v, double w = 1.0 );
 
-   //! Construct by copy of L and D.
-   LD(mat L, vec D);
-   //! Construct by decomposition of full matrix V.
-   LD(mat V);
+		//! Construct by copy of L and D.
+		LD ( mat L, vec D );
+		//! Construct by decomposition of full matrix V.
+		LD ( mat V );
 
-protected:
-  vec D;
-  mat L;
+	protected:
+		vec D;
+		mat L;
 
 };
 
-LD::LD(const mat exL, const vec exD) {
- D = exD;
- L = exL;
+LD::LD ( const mat exL, const vec exD )
+{
+	D = exD;
+	L = exL;
 }
 
-LD::LD(const mat V) {
- ; //not implemneted yet
+LD::LD ( const mat V )
+{
+	; //not implemneted yet
 }
 
-void LD::ldupdt(vec v, double w ) {
-printf("not implemented"); //TODO: VS
+void LD::ldupdt ( vec v, double w )
+{
+	printf ( "not implemented" ); //TODO: VS
 }
