Index: /library/bdm/estim/particles.h
===================================================================
--- /library/bdm/estim/particles.h (revision 686)
+++ /library/bdm/estim/particles.h (revision 693)
@@ -36,7 +36,7 @@
 	Array<vec> &_samples;
 	//! Parameter evolution model
-	shared_ptr<mpdf> par;
+	shared_ptr<pdf> par;
 	//! Observation model
-	shared_ptr<mpdf> obs;
+	shared_ptr<pdf> obs;
 	//! internal structure storing loglikelihood of predictions
 	vec lls;
@@ -63,5 +63,5 @@
 		resmethod = rm;
 	};
-	void set_model ( shared_ptr<mpdf> par0, shared_ptr<mpdf> obs0) {
+	void set_model ( shared_ptr<pdf> par0, shared_ptr<pdf> obs0) {
 		par = par0;
 		obs = obs0;
@@ -105,6 +105,6 @@
 	/*! configuration structure for basic PF
 	\code
-	parameter_pdf   = mpdf_class;         // parameter evolution pdf
-	observation_pdf = mpdf_class;         // observation pdf
+	parameter_pdf   = pdf_class;         // parameter evolution pdf
+	observation_pdf = pdf_class;         // observation pdf
 	prior           = epdf_class;         // prior probability density
 	--- optional ---
@@ -117,6 +117,6 @@
 	void from_setting(const Setting &set){
 		BM::from_setting(set);
-		par = UI::build<mpdf>(set,"parameter_pdf",UI::compulsory);
-		obs = UI::build<mpdf>(set,"observation_pdf",UI::compulsory);
+		par = UI::build<pdf>(set,"parameter_pdf",UI::compulsory);
+		obs = UI::build<pdf>(set,"observation_pdf",UI::compulsory);
 		
 		prior_from_set(set);
@@ -196,5 +196,5 @@
 
 A composition of particle filter with exact (or almost exact) bayesian models (BMs).
-The Bayesian models provide marginalized predictive density. Internaly this is achieved by virtual class MPFmpdf.
+The Bayesian models provide marginalized predictive density. Internaly this is achieved by virtual class MPFpdf.
 */
 
@@ -206,5 +206,5 @@
 	Array<BM*> BMs;
 
-	//! internal class for MPDF providing composition of eEmp with external components
+	//! internal class for pdf providing composition of eEmp with external components
 
 	class mpfepdf : public epdf  {
@@ -306,5 +306,5 @@
 	MPF () :  jest (pf,BMs) {};
 	//! set all parameters at once
-	void set_parameters ( shared_ptr<mpdf> par0, shared_ptr<mpdf> obs0, int n0, RESAMPLING_METHOD rm = SYSTEMATIC ) {
+	void set_parameters ( shared_ptr<pdf> par0, shared_ptr<pdf> obs0, int n0, RESAMPLING_METHOD rm = SYSTEMATIC ) {
 		pf->set_model ( par0, obs0); 
 		pf->set_parameters(n0, rm );
@@ -341,5 +341,5 @@
 	\code
 	BM              = BM_class;           // Bayesian filtr for analytical part of the model
-	parameter_pdf   = mpdf_class;         // transitional pdf for non-parametric part of the model
+	parameter_pdf   = pdf_class;         // transitional pdf for non-parametric part of the model
 	prior           = epdf_class;         // prior probability density
 	--- optional ---
@@ -350,6 +350,6 @@
 	*/	
 	void from_setting(const Setting &set){
-		shared_ptr<mpdf> par = UI::build<mpdf>(set,"parameter_pdf",UI::compulsory);
-		shared_ptr<mpdf> obs= new mpdf(); // not used!!
+		shared_ptr<pdf> par = UI::build<pdf>(set,"parameter_pdf",UI::compulsory);
+		shared_ptr<pdf> obs= new pdf(); // not used!!
 
 		pf = new PF;
Index: /library/bdm/base/bdmbase.h
===================================================================
--- /library/bdm/base/bdmbase.h (revision 690)
+++ /library/bdm/base/bdmbase.h (revision 693)
@@ -386,5 +386,5 @@
 
 //! Conditional probability density, e.g. modeling \f$ f( x | y) \f$, where \f$ x \f$ is random variable, \c rv, and \f$ y \f$ is conditioning variable, \c rvc.
-class mpdf : public root {
+class pdf : public root {
 protected:
 	//!dimension of the condition
@@ -403,10 +403,10 @@
 	//! @{
 
-	mpdf() : dimc ( 0 ), rvc(), dim(0), rv() { }
-
-	mpdf ( const mpdf &m ) : dimc ( m.dimc ), rvc ( m.rvc ), dim( m.dim), rv( m.rv ) { }
+	pdf() : dimc ( 0 ), rvc(), dim(0), rv() { }
+
+	pdf ( const pdf &m ) : dimc ( m.dimc ), rvc ( m.rvc ), dim( m.dim), rv( m.rv ) { }
 	
 	//! copy of the current object - make sure to implement
-	virtual mpdf* _copy_() const {return new mpdf(*this);}
+	virtual pdf* _copy_() const {return new pdf(*this);}
 	//!@}
 
@@ -467,5 +467,5 @@
 	//! Load from structure with elements:
 	//!  \code
-	//! { class = "mpdf_offspring",
+	//! { class = "pdf_offspring",
 	//!   rv = {class="RV", names=(...),}; // RV describing meaning of random variable
 	//!   rvc= {class="RV", names=(...),}; // RV describing meaning of random variable in condition
@@ -491,8 +491,8 @@
 	//!@}
 };
-SHAREDPTR ( mpdf );
+SHAREDPTR ( pdf );
 
 //! Probability density function with numerical statistics, e.g. posterior density.
-class epdf : public mpdf {
+class epdf : public pdf {
 
 public:
@@ -509,5 +509,5 @@
 	@{*/
 	epdf() {};
-	epdf ( const epdf &e ) : mpdf(e) {};
+	epdf ( const epdf &e ) : pdf(e) {};
 	void set_parameters ( int dim0 ) {
 		dim = dim0;
@@ -542,5 +542,5 @@
 
 	//! Return conditional density on the given RV, the remaining rvs will be in conditioning
-	virtual shared_ptr<mpdf> condition ( const RV &rv ) const;
+	virtual shared_ptr<pdf> condition ( const RV &rv ) const;
 
 	//! Return marginal density on the given RV, the remainig rvs are intergrated out
@@ -633,7 +633,7 @@
 SHAREDPTR ( epdf );
 
-//! Mpdf with internal epdf that is modified by function \c condition
+//! pdf with internal epdf that is modified by function \c condition
 template <class EPDF>
-class mpdf_internal: public mpdf {
+class pdf_internal: public pdf {
 protected :
 	//! Internal epdf used for sampling
@@ -641,9 +641,9 @@
 public:
 	//! constructor
-	mpdf_internal() : mpdf(), iepdf() {
+	pdf_internal() : pdf(), iepdf() {
 //		set_ep ( iepdf ); TODO!
 	}
 
-	//! Update \c iepdf so that it represents this mpdf conditioned on \c rvc = cond
+	//! Update \c iepdf so that it represents this pdf conditioned on \c rvc = cond
 	//! This function provides convenient reimplementation in offsprings
 	virtual void condition ( const vec &cond ) {
@@ -896,5 +896,5 @@
 };
 
-//!DataLink is a connection between mpdf and its superordinate (Up)
+//!DataLink is a connection between pdf and its superordinate (Up)
 //! This class links
 class datalink_m2m: public datalink_m2e {
@@ -928,6 +928,6 @@
 
 
-//! \brief Combines RVs from a list of mpdfs to a single one.
-RV get_composite_rv ( const Array<shared_ptr<mpdf> > &mpdfs, bool checkoverlap = false );
+//! \brief Combines RVs from a list of pdfs to a single one.
+RV get_composite_rv ( const Array<shared_ptr<pdf> > &pdfs, bool checkoverlap = false );
 
 /*! \brief Abstract class for discrete-time sources of data.
@@ -1118,5 +1118,5 @@
 	};
 	//!Constructs conditional density of 1-step ahead predictor \f$ f(d_{t+1} |d_{t+h-1}, \ldots d_{t}) \f$
-	virtual mpdf* predictor() const {
+	virtual pdf* predictor() const {
 		bdm_error ( "Not implemented" );
 		return NULL;
@@ -1229,9 +1229,9 @@
 //! array of pointers to epdf
 typedef Array<shared_ptr<epdf> > epdf_array;
-//! array of pointers to mpdf
-typedef Array<shared_ptr<mpdf> > mpdf_array;
+//! array of pointers to pdf
+typedef Array<shared_ptr<pdf> > pdf_array;
 
 template<class EPDF>
-vec mpdf_internal<EPDF>::samplecond ( const vec &cond ) {
+vec pdf_internal<EPDF>::samplecond ( const vec &cond ) {
 	condition ( cond );
 	vec temp = iepdf.sample();
@@ -1240,5 +1240,5 @@
 
 template<class EPDF>
-mat mpdf_internal<EPDF>::samplecond_m ( const vec &cond, int N ) {
+mat pdf_internal<EPDF>::samplecond_m ( const vec &cond, int N ) {
 	condition ( cond );
 	mat temp ( dimension(), N );
@@ -1253,5 +1253,5 @@
 
 template<class EPDF>
-double mpdf_internal<EPDF>::evallogcond ( const vec &yt, const vec &cond ) {
+double pdf_internal<EPDF>::evallogcond ( const vec &yt, const vec &cond ) {
 	double tmp;
 	condition ( cond );
@@ -1261,5 +1261,5 @@
 
 template<class EPDF>
-vec mpdf_internal<EPDF>::evallogcond_m ( const mat &Yt, const vec &cond ) {
+vec pdf_internal<EPDF>::evallogcond_m ( const mat &Yt, const vec &cond ) {
 	condition ( cond );
 	return iepdf.evallog_m ( Yt );
@@ -1267,5 +1267,5 @@
 
 template<class EPDF>
-vec mpdf_internal<EPDF>::evallogcond_m ( const Array<vec> &Yt, const vec &cond ) {
+vec pdf_internal<EPDF>::evallogcond_m ( const Array<vec> &Yt, const vec &cond ) {
 	condition ( cond );
 	return iepdf.evallog_m ( Yt );
Index: /library/bdm/base/datasources.h
===================================================================
--- /library/bdm/base/datasources.h (revision 676)
+++ /library/bdm/base/datasources.h (revision 693)
@@ -145,8 +145,8 @@
 Still having only one density but allowing conditioning on either input or delayed values.
 */
-class MpdfDS :public DS {
+class PdfDS :public DS {
 	protected:
 		//! internal pointer to epdf from which we samplecond
-		shared_ptr<mpdf> impdf;
+		shared_ptr<pdf> ipdf;
 		//! internal storage of data sample
 		vec yt;
@@ -165,5 +165,5 @@
 			ut2rgr.filldown ( ut,rgr );
 			yt2rgr.filldown ( yt,rgr );
-			yt=impdf->samplecond ( rgr );
+			yt=ipdf->samplecond ( rgr );
 			ut2rgr.step(ut); //u is now history
 		}
@@ -177,6 +177,6 @@
 		/*!
 		\code
-		class = "MpdfDS";
-		mpdf = {class="mpdf_offspring", ...};  // mpdf to simulate
+		class = "PdfDS";
+		pdf = {class="pdf_offspring", ...};  // pdf to simulate
 		--- optional ---
 		init_rv = {class="RV",names=...};      // define what rv to initialize - typically delayed values!
@@ -187,15 +187,15 @@
 		*/
 		void from_setting ( const Setting &set ) {
-			impdf=UI::build<mpdf> ( set,"mpdf",UI::compulsory );
+			ipdf=UI::build<pdf> ( set,"pdf",UI::compulsory );
 			
-			Yrv = impdf->_rv();
+			Yrv = ipdf->_rv();
 			// get unique rvs form rvc
-			RV rgrv0=impdf->_rvc().remove_time();
+			RV rgrv0=ipdf->_rvc().remove_time();
 			// input is what in not in Yrv
 			Urv=rgrv0.subt(Yrv); 
 			set_drv(Yrv, Urv);
 			// connect input and output to rvc
-			ut2rgr.set_connection(impdf->_rvc(), Urv); 
-			yt2rgr.set_connection(impdf->_rvc(), Yrv); 
+			ut2rgr.set_connection(ipdf->_rvc(), Urv); 
+			yt2rgr.set_connection(ipdf->_rvc(), Yrv); 
 			
 			//set history - if given
@@ -212,6 +212,6 @@
 			}
 
-			yt = zeros ( impdf->dimension() );
-			rgr = zeros ( impdf->dimensionc() );
+			yt = zeros ( ipdf->dimension() );
+			rgr = zeros ( ipdf->dimensionc() );
 			ut = zeros(Urv._dsize());
 
@@ -225,8 +225,8 @@
 			ut2rgr.filldown ( ut,rgr );
 			yt2rgr.filldown ( yt,rgr );
-			yt=impdf->samplecond ( rgr );
-		}
-};
-UIREGISTER ( MpdfDS );
+			yt=ipdf->samplecond ( rgr );
+		}
+};
+UIREGISTER ( PdfDS );
 
 /*! Pseudovirtual class for reading data from files
@@ -307,8 +307,8 @@
 	private:
 		//!conditional pdf of the state evolution \f$ f(x_t|x_{t-1}) \f$
-		shared_ptr<mpdf> IM;
+		shared_ptr<pdf> IM;
 
 		//!conditional pdf of the observations \f$ f(d_t|x_t) \f$
-		shared_ptr<mpdf> OM;
+		shared_ptr<pdf> OM;
 
 	protected:
@@ -331,5 +331,5 @@
 		}
 		//! convenience constructor
-		stateDS ( const shared_ptr<mpdf> &IM0, const shared_ptr<mpdf> &OM0, int usize ) : IM ( IM0 ), OM ( OM0 ),
+		stateDS ( const shared_ptr<pdf> &IM0, const shared_ptr<pdf> &OM0, int usize ) : IM ( IM0 ), OM ( OM0 ),
 				dt ( OM0->dimension() ), xt ( IM0->dimension() ),
 				ut ( usize ), L_xt ( 0 ) { }
@@ -360,5 +360,5 @@
 			type = "stateDS";
 			//Internal model
-			IM = { type = "mpdf"; //<-- valid offspring! e.g. "mlnorm"
+			IM = { type = "pdf"; //<-- valid offspring! e.g. "mlnorm"
 				rv = { //description of x_t
 					names=["name1",...];
@@ -373,5 +373,5 @@
 				};
 			//Observation model
-			OM = { type = "mpdf-offspring";
+			OM = { type = "pdf-offspring";
 				rv = {}; //description of d_t
 				rvu = {type="internal", path="system.IM.rvu"}; //description of u_t
Index: /library/bdm/base/bdmbase.cpp
===================================================================
--- /library/bdm/base/bdmbase.cpp (revision 690)
+++ /library/bdm/base/bdmbase.cpp (revision 693)
@@ -146,7 +146,7 @@
 }
 
-shared_ptr<mpdf> epdf::condition ( const RV &rv ) const {
+shared_ptr<pdf> epdf::condition ( const RV &rv ) const {
 	bdm_warning ( "Not implemented" );
-	return shared_ptr<mpdf>();
+	return shared_ptr<pdf>();
 }
 
@@ -180,5 +180,5 @@
 }
 
-mat mpdf::samplecond_m ( const vec &cond, int N ) {
+mat pdf::samplecond_m ( const vec &cond, int N ) {
 	mat M ( dimension(), N );
 	for ( int i = 0; i < N; i++ ) {
@@ -189,5 +189,5 @@
 }
 
-void mpdf::from_setting ( const Setting &set ) {
+void pdf::from_setting ( const Setting &set ) {
 	shared_ptr<RV> r = UI::build<RV> ( set, "rv", UI::optional );
 	if ( r ) {
@@ -373,12 +373,12 @@
 }
 
-RV get_composite_rv ( const Array<shared_ptr<mpdf> > &mpdfs,
+RV get_composite_rv ( const Array<shared_ptr<pdf> > &pdfs,
                       bool checkoverlap ) {
 	RV rv; //empty rv
 	bool rvaddok;
-	for ( int i = 0; i < mpdfs.length(); i++ ) {
-		rvaddok = rv.add ( mpdfs ( i )->_rv() ); //add rv to common rvs.
-		// If rvaddok==false, mpdfs overlap => assert error.
-		bdm_assert_debug ( rvaddok || !checkoverlap, "mprod::mprod() input mpdfs overlap in rv!" );
+	for ( int i = 0; i < pdfs.length(); i++ ) {
+		rvaddok = rv.add ( pdfs ( i )->_rv() ); //add rv to common rvs.
+		// If rvaddok==false, pdfs overlap => assert error.
+		bdm_assert_debug ( rvaddok || !checkoverlap, "mprod::mprod() input pdfs overlap in rv!" );
 	}
 
Index: /library/bdm/base/datasources.cpp
===================================================================
--- /library/bdm/base/datasources.cpp (revision 676)
+++ /library/bdm/base/datasources.cpp (revision 693)
@@ -123,6 +123,6 @@
 
 void stateDS::from_setting ( const Setting &set ) {
-	IM = UI::build<mpdf> ( set, "IM", UI::compulsory );
-	OM = UI::build<mpdf> ( set, "OM", UI::compulsory );
+	IM = UI::build<pdf> ( set, "IM", UI::compulsory );
+	OM = UI::build<pdf> ( set, "OM", UI::compulsory );
 
 	dt.set_length ( OM->dimension() );
Index: /library/bdm/stat/merger.cpp
===================================================================
--- /library/bdm/stat/merger.cpp (revision 682)
+++ /library/bdm/stat/merger.cpp (revision 693)
@@ -5,5 +5,5 @@
 namespace bdm {
 
-merger_base::merger_base ( const Array<shared_ptr<mpdf> > &S ):
+merger_base::merger_base ( const Array<shared_ptr<pdf> > &S ):
 	Npoints(0), DBG(false), dbg_file(0) {
 	set_sources ( S );
@@ -134,5 +134,5 @@
 
 
-			sprintf ( dbg_str, "Mpdf%d", niter );
+			sprintf ( dbg_str, "pdf%d", niter );
 			for ( int i = 0; i < Npoints; i++ ) {
 				Mix_pdf ( i ) = Mix.logpred ( Smp_ex.get_col ( i ) );
@@ -145,19 +145,19 @@
 		}
 		//Importace weighting
-		for ( int i = 0; i < mpdfs.length(); i++ ) {
+		for ( int i = 0; i < pdfs.length(); i++ ) {
 			lw_src = 0.0;
 			//======== Same RVs ===========
 			//Split according to dependency in rvs
-			if ( mpdfs ( i )->dimension() == dim ) {
+			if ( pdfs ( i )->dimension() == dim ) {
 				// no need for conditioning or marginalization
-				lw_src = mpdfs ( i )->evallogcond_m ( Smp , vec(0));
+				lw_src = pdfs ( i )->evallogcond_m ( Smp , vec(0));
 			} else {
 				// compute likelihood of marginal on the conditional variable
-				if ( mpdfs ( i )->dimensionc() > 0 ) {
+				if ( pdfs ( i )->dimensionc() > 0 ) {
 					// Make marginal on rvc_i
-					shared_ptr<epdf> tmp_marg = Mpred->marginal ( mpdfs ( i )->_rvc() );
+					shared_ptr<epdf> tmp_marg = Mpred->marginal ( pdfs ( i )->_rvc() );
 					//compute vector of lw_src
 					for ( int k = 0; k < Npoints; k++ ) {
-						// Here val of tmp_marg = cond of mpdfs(i) ==> calling dls->get_cond
+						// Here val of tmp_marg = cond of pdfs(i) ==> calling dls->get_cond
 						lw_src ( k ) += tmp_marg->evallog ( dls ( i )->get_cond ( Smp ( k ) ) );
 					}
@@ -168,8 +168,8 @@
 				}
 				// Compute likelihood of the missing variable
-				if ( dim > ( mpdfs ( i )->dimension() + mpdfs ( i )->dimensionc() ) ) {
+				if ( dim > ( pdfs ( i )->dimension() + pdfs ( i )->dimensionc() ) ) {
 					///////////////
-					// There are variales unknown to mpdfs(i) : rvzs
-					shared_ptr<mpdf> tmp_cond = Mpred->condition ( rvzs ( i ) );
+					// There are variales unknown to pdfs(i) : rvzs
+					shared_ptr<pdf> tmp_cond = Mpred->condition ( rvzs ( i ) );
 					// Compute likelihood
 					vec lw_dbg = lw_src;
@@ -187,5 +187,5 @@
 				// Compute likelihood of the partial source
 				for ( int k = 0; k < Npoints; k++ ) {
-					lw_src ( k ) += mpdfs ( i )->evallogcond ( dls ( i )->pushdown ( Smp ( k ) ),  
+					lw_src ( k ) += pdfs ( i )->evallogcond ( dls ( i )->pushdown ( Smp ( k ) ),  
 							 dls ( i )->get_cond ( Smp ( k ) ));
 				}
Index: /library/bdm/stat/emix.cpp
===================================================================
--- /library/bdm/stat/emix.cpp (revision 675)
+++ /library/bdm/stat/emix.cpp (revision 693)
@@ -54,8 +54,8 @@
 }
 
-shared_ptr<mpdf> emix::condition ( const RV &rv ) const {
+shared_ptr<pdf> emix::condition ( const RV &rv ) const {
 	bdm_assert ( isnamed(), "rvs are not assigned" );
 	mratio *tmp = new mratio ( this, rv );
-	return shared_ptr<mpdf>(tmp);
+	return shared_ptr<pdf>(tmp);
 }
 
@@ -203,21 +203,21 @@
 };
 
-void mprod::set_elements (const Array<shared_ptr<mpdf> > &mFacs ) {
-	mpdfs = mFacs;
+void mprod::set_elements (const Array<shared_ptr<pdf> > &mFacs ) {
+	pdfs = mFacs;
 	dls.set_size ( mFacs.length() );
 
-	rv = get_composite_rv ( mpdfs, true );
+	rv = get_composite_rv ( pdfs, true );
 	dim = rv._dsize();
 
-	for ( int i = 0; i < mpdfs.length(); i++ ) {
-		RV rvx = mpdfs ( i )->_rvc().subt ( rv );
+	for ( int i = 0; i < pdfs.length(); i++ ) {
+		RV rvx = pdfs ( i )->_rvc().subt ( rv );
 		rvc.add ( rvx ); // add rv to common rvc
 	}
 	dimc=rvc._dsize();
 
-	// rv and rvc established = > we can link them with mpdfs
-	for ( int i = 0; i < mpdfs.length(); i++ ) {
+	// rv and rvc established = > we can link them with pdfs
+	for ( int i = 0; i < pdfs.length(); i++ ) {
 		dls ( i ) = new datalink_m2m;
-		dls ( i )->set_connection ( mpdfs ( i )->_rv(), mpdfs ( i )->_rvc(), _rv(), _rvc() );
+		dls ( i )->set_connection ( pdfs ( i )->_rv(), pdfs ( i )->_rvc(), _rv(), _rvc() );
 	}
 }
@@ -239,27 +239,27 @@
 
 }
-// mprod::mprod ( Array<mpdf*> mFacs, bool overlap) : mpdf ( RV(), RV() ), n ( mFacs.length() ), epdfs ( n ), mpdfs ( mFacs ), rvinds ( n ), rvcinrv ( n ), irvcs_rvc ( n ) {
+// mprod::mprod ( Array<pdf*> mFacs, bool overlap) : pdf ( RV(), RV() ), n ( mFacs.length() ), epdfs ( n ), pdfs ( mFacs ), rvinds ( n ), rvcinrv ( n ), irvcs_rvc ( n ) {
 // 		int i;
 // 		bool rvaddok;
 // 		// Create rv
 // 		for ( i = 0;i < n;i++ ) {
-// 			rvaddok=rv.add ( mpdfs ( i )->_rv() ); //add rv to common rvs.
-// 			// If rvaddok==false, mpdfs overlap => assert error.
-// 			epdfs ( i ) = & ( mpdfs ( i )->posterior() ); // add pointer to epdf
+// 			rvaddok=rv.add ( pdfs ( i )->_rv() ); //add rv to common rvs.
+// 			// If rvaddok==false, pdfs overlap => assert error.
+// 			epdfs ( i ) = & ( pdfs ( i )->posterior() ); // add pointer to epdf
 // 		};
 // 		// Create rvc
 // 		for ( i = 0;i < n;i++ ) {
-// 			rvc.add ( mpdfs ( i )->_rvc().subt ( rv ) ); //add rv to common rvs.
+// 			rvc.add ( pdfs ( i )->_rvc().subt ( rv ) ); //add rv to common rvs.
 // 		};
 //
 // //		independent = true;
-// 		//test rvc of mpdfs and fill rvinds
+// 		//test rvc of pdfs and fill rvinds
 // 		for ( i = 0;i < n;i++ ) {
 // 			// find ith rv in common rv
-// 			rvsinrv ( i ) = mpdfs ( i )->_rv().dataind ( rv );
+// 			rvsinrv ( i ) = pdfs ( i )->_rv().dataind ( rv );
 // 			// find ith rvc in common rv
-// 			rvcinrv ( i ) = mpdfs ( i )->_rvc().dataind ( rv );
+// 			rvcinrv ( i ) = pdfs ( i )->_rvc().dataind ( rv );
 // 			// find ith rvc in common rv
-// 			irvcs_rvc ( i ) = mpdfs ( i )->_rvc().dataind ( rvc );
+// 			irvcs_rvc ( i ) = pdfs ( i )->_rvc().dataind ( rvc );
 // 			//
 // /*			if ( rvcinrv ( i ).length() >0 ) {independent = false;}
Index: /library/bdm/stat/exp_family.h
===================================================================
--- /library/bdm/stat/exp_family.h (revision 679)
+++ /library/bdm/stat/exp_family.h (revision 693)
@@ -163,5 +163,5 @@
 		vec variance() const {return diag (R.to_mat());}
 //	mlnorm<sq_T>* condition ( const RV &rvn ) const ; <=========== fails to cmpile. Why?
-		shared_ptr<mpdf> condition ( const RV &rvn ) const;
+		shared_ptr<pdf> condition ( const RV &rvn ) const;
 
 		// target not typed to mlnorm<sq_T, enorm<sq_T> > &
@@ -169,5 +169,5 @@
 		// haven't finished defining enorm yet), but the type
 		// is required
-		void condition ( const RV &rvn, mpdf &target ) const;
+		void condition ( const RV &rvn, pdf &target ) const;
 
 		shared_ptr<epdf> marginal (const RV &rvn ) const;
@@ -367,5 +367,5 @@
 */
 
-class mDirich: public mpdf_internal<eDirich> {
+class mDirich: public pdf_internal<eDirich> {
 	protected:
 		//! constant \f$ k \f$ of the random walk
@@ -376,5 +376,5 @@
 		vec betac;
 	public:
-		mDirich(): mpdf_internal<eDirich>(), _beta(iepdf._beta()){};
+		mDirich(): pdf_internal<eDirich>(), _beta(iepdf._beta()){};
 		void condition (const vec &val) {_beta =  val/k+betac; };
 		/*! Create Dirichlet random walk 
@@ -391,5 +391,5 @@
 		*/
 		void from_setting (const Setting &set) {
-			mpdf::from_setting (set); // reads rv and rvc
+			pdf::from_setting (set); // reads rv and rvc
 			if (_rv()._dsize()>0){
 				rvc = _rv().copy_t(-1);
@@ -408,5 +408,5 @@
 		}
 		void validate() { 
-			mpdf_internal<eDirich>::validate();
+			pdf_internal<eDirich>::validate();
 			bdm_assert(_beta.length()==betac.length(),"beta0 and betac are not compatible");
 			if (_rv()._dsize()>0){
@@ -644,5 +644,5 @@
 
 //! Uniform density with conditional mean value
-class mguni : public mpdf_internal<euni>{
+class mguni : public pdf_internal<euni>{
 	//! function of the mean value
 	shared_ptr<fnc> mean;
@@ -656,5 +656,5 @@
 		//! load from
 		void from_setting(const Setting &set){
-			mpdf::from_setting(set); //reads rv and rvc
+			pdf::from_setting(set); //reads rv and rvc
 			UI::get(delta,set,"delta",UI::compulsory);
 			mean = UI::build<fnc>(set,"mean",UI::compulsory);
@@ -672,5 +672,5 @@
 */
 template < class sq_T, template <typename> class TEpdf = enorm >
-class mlnorm : public mpdf_internal< TEpdf<sq_T> >
+class mlnorm : public pdf_internal< TEpdf<sq_T> >
 {
 	protected:
@@ -683,6 +683,6 @@
 		//! \name Constructors
 		//!@{
-		mlnorm() : mpdf_internal< TEpdf<sq_T> >() {};
-		mlnorm (const mat &A, const vec &mu0, const sq_T &R) : mpdf_internal< TEpdf<sq_T> >() {
+		mlnorm() : pdf_internal< TEpdf<sq_T> >() {};
+		mlnorm (const mat &A, const vec &mu0, const sq_T &R) : pdf_internal< TEpdf<sq_T> >() {
 			set_parameters (A, mu0, R);
 		}
@@ -724,5 +724,5 @@
 		*/
 		void from_setting (const Setting &set) {
-			mpdf::from_setting (set);
+			pdf::from_setting (set);
 
 			UI::get (A, set, "A", UI::compulsory);
@@ -734,5 +734,5 @@
 		};
 		void validate() {
-			mpdf_internal<TEpdf<sq_T> >::validate();
+			pdf_internal<TEpdf<sq_T> >::validate();
 			bdm_assert (A.rows() == mu_const.length(), "mlnorm: A vs. mu mismatch");
 			bdm_assert (A.rows() == _R().rows(), "mlnorm: A vs. R mismatch");
@@ -747,7 +747,7 @@
 SHAREDPTR2 ( mlnorm, chmat );
 
-//! Mpdf with general function for mean value
+//! pdf with general function for mean value
 template<class sq_T>
-class mgnorm : public mpdf_internal< enorm< sq_T > >
+class mgnorm : public pdf_internal< enorm< sq_T > >
 {
 	private:
@@ -757,5 +757,5 @@
 	public:
 		//!default constructor
-		mgnorm() : mpdf_internal<enorm<sq_T> >() { }
+		mgnorm() : pdf_internal<enorm<sq_T> >() { }
 		//!set mean function
 		inline void set_parameters (const shared_ptr<fnc> &g0, const sq_T &R0);
@@ -782,5 +782,5 @@
 
 		void from_setting (const Setting &set) {
-			mpdf::from_setting(set);
+			pdf::from_setting(set);
 			shared_ptr<fnc> g = UI::build<fnc> (set, "g", UI::compulsory);
 
@@ -863,5 +863,5 @@
 The standard deviation of the walk is then: \f$\mu/\sqrt(k)\f$.
 */
-class mgamma : public mpdf_internal<egamma>
+class mgamma : public pdf_internal<egamma>
 {
 	protected:
@@ -875,5 +875,5 @@
 	public:
 		//! Constructor
-		mgamma() : mpdf_internal<egamma>(), k (0),
+		mgamma() : pdf_internal<egamma>(), k (0),
 				_beta (iepdf._beta()) {
 		}
@@ -895,5 +895,5 @@
 		*/
 		void from_setting (const Setting &set) {
-			mpdf::from_setting (set); // reads rv and rvc
+			pdf::from_setting (set); // reads rv and rvc
 			vec betatmp; // ugly but necessary
 			UI::get (betatmp, set, "beta", UI::compulsory);
@@ -903,5 +903,5 @@
 		}
 		void validate() {
-			mpdf_internal<egamma>::validate();
+			pdf_internal<egamma>::validate();
 			
 			dim = _beta.length();
@@ -921,5 +921,5 @@
 The standard deviation of the walk is then: \f$ \mu/\sqrt(k)\f$.
  */
-class migamma : public mpdf_internal<eigamma>
+class migamma : public pdf_internal<eigamma>
 {
 	protected:
@@ -936,5 +936,5 @@
 		//! \name Constructors
 		//!@{
-		migamma() : mpdf_internal<eigamma>(),
+		migamma() : pdf_internal<eigamma>(),
 				k (0),
 				_alpha (iepdf._alpha()),
@@ -942,5 +942,5 @@
 		}
 
-		migamma (const migamma &m) : mpdf_internal<eigamma>(),
+		migamma (const migamma &m) : pdf_internal<eigamma>(),
 				k (0),
 				_alpha (iepdf._alpha()),
@@ -1074,5 +1074,5 @@
 
  */
-class mlognorm : public mpdf_internal<elognorm>
+class mlognorm : public pdf_internal<elognorm>
 {
 	protected:
@@ -1084,5 +1084,5 @@
 	public:
 		//! Constructor
-		mlognorm() : mpdf_internal<elognorm>(),
+		mlognorm() : pdf_internal<elognorm>(),
 				sig2 (0),
 				mu (iepdf._mu()) {
@@ -1221,5 +1221,5 @@
 
 //! Random Walk on inverse Wishart
-class rwiWishartCh : public mpdf_internal<eiWishartCh>
+class rwiWishartCh : public pdf_internal<eiWishartCh>
 {
 	protected:
@@ -1474,8 +1474,8 @@
 
 template<class sq_T>
-shared_ptr<mpdf> enorm<sq_T>::condition ( const RV &rvn ) const
+shared_ptr<pdf> enorm<sq_T>::condition ( const RV &rvn ) const
 {
 	mlnorm<sq_T> *tmp = new mlnorm<sq_T> ();
-	shared_ptr<mpdf> narrow(tmp);
+	shared_ptr<pdf> narrow(tmp);
 	condition ( rvn, *tmp );
 	return narrow;
@@ -1483,5 +1483,5 @@
 
 template<class sq_T>
-void enorm<sq_T>::condition ( const RV &rvn, mpdf &target ) const
+void enorm<sq_T>::condition ( const RV &rvn, pdf &target ) const
 {
 	typedef mlnorm<sq_T> TMlnorm;
Index: /library/bdm/stat/merger.h
===================================================================
--- /library/bdm/stat/merger.h (revision 679)
+++ /library/bdm/stat/merger.h (revision 693)
@@ -46,10 +46,10 @@
 protected:
 	//! Elements of composition
-	Array<shared_ptr<mpdf> > mpdfs;
-
-	//! Data link for each mpdf in mpdfs
+	Array<shared_ptr<pdf> > pdfs;
+
+	//! Data link for each pdf in pdfs
 	Array<datalink_m2e*> dls;
 
-	//! Array of rvs that are not modelled by mpdfs at all, \f$ z_i \f$
+	//! Array of rvs that are not modelled by pdfs at all, \f$ z_i \f$
 	Array<RV> rvzs;
 
@@ -90,10 +90,10 @@
 
 	//!Constructor from sources
-	merger_base ( const Array<shared_ptr<mpdf> > &S );
+	merger_base ( const Array<shared_ptr<pdf> > &S );
 
 	//! Function setting the main internal structures
-	void set_sources ( const Array<shared_ptr<mpdf> > &Sources ) {
-		mpdfs = Sources;
-		Nsources = mpdfs.length();
+	void set_sources ( const Array<shared_ptr<pdf> > &Sources ) {
+		pdfs = Sources;
+		Nsources = pdfs.length();
 		//set sizes
 		dls.set_size ( Sources.length() );
@@ -101,10 +101,10 @@
 		zdls.set_size ( Sources.length() );
 
-		rv = get_composite_rv ( mpdfs, /* checkoverlap = */ false );
+		rv = get_composite_rv ( pdfs, /* checkoverlap = */ false );
 
 		RV rvc;
 		// Extend rv by rvc!
-		for ( int i = 0; i < mpdfs.length(); i++ ) {
-			RV rvx = mpdfs ( i )->_rvc().subt ( rv );
+		for ( int i = 0; i < pdfs.length(); i++ ) {
+			RV rvx = pdfs ( i )->_rvc().subt ( rv );
 			rvc.add ( rvx ); // add rv to common rvc
 		}
@@ -117,12 +117,12 @@
 		// create links between sources and common rv
 		RV xytmp;
-		for ( int i = 0; i < mpdfs.length(); i++ ) {
-			//Establich connection between mpdfs and merger
+		for ( int i = 0; i < pdfs.length(); i++ ) {
+			//Establich connection between pdfs and merger
 			dls ( i ) = new datalink_m2e;
-			dls ( i )->set_connection ( mpdfs ( i )->_rv(), mpdfs ( i )->_rvc(), rv );
-
-			// find out what is missing in each mpdf
-			xytmp = mpdfs ( i )->_rv();
-			xytmp.add ( mpdfs ( i )->_rvc() );
+			dls ( i )->set_connection ( pdfs ( i )->_rv(), pdfs ( i )->_rvc(), rv );
+
+			// find out what is missing in each pdf
+			xytmp = pdfs ( i )->_rv();
+			xytmp.add ( pdfs ( i )->_rvc() );
 			// z_i = common_rv-xy
 			rvzs ( i ) = rv.subt ( xytmp );
@@ -185,16 +185,16 @@
 		//check if sources overlap:
 		bool OK = true;
-		for ( int i = 0; i < mpdfs.length(); i++ ) {
+		for ( int i = 0; i < pdfs.length(); i++ ) {
 			OK &= ( rvzs ( i )._dsize() == 0 ); // z_i is empty
-			OK &= ( mpdfs ( i )->_rvc()._dsize() == 0 ); // y_i is empty
+			OK &= ( pdfs ( i )->_rvc()._dsize() == 0 ); // y_i is empty
 		}
 
 		if ( OK ) {
-			mat lW = zeros ( mpdfs.length(), eSmp._w().length() );
+			mat lW = zeros ( pdfs.length(), eSmp._w().length() );
 
 			vec emptyvec ( 0 );
-			for ( int i = 0; i < mpdfs.length(); i++ ) {
+			for ( int i = 0; i < pdfs.length(); i++ ) {
 				for ( int j = 0; j < eSmp._w().length(); j++ ) {
-					lW ( i, j ) = mpdfs ( i )->evallogcond ( eSmp._samples() ( j ), emptyvec );
+					lW ( i, j ) = pdfs ( i )->evallogcond ( eSmp._samples() ( j ), emptyvec );
 				}
 			}
@@ -313,5 +313,5 @@
 	merger_mix ():Ncoms(0), effss_coef(0), stop_niter(0) { }
 
-	merger_mix ( const Array<shared_ptr<mpdf> > &S ):
+	merger_mix ( const Array<shared_ptr<pdf> > &S ):
 		Ncoms(0), effss_coef(0), stop_niter(0) {
 		set_sources ( S );
@@ -319,5 +319,5 @@
 
 	//! Set sources and prepare all internal structures
-	void set_sources ( const Array<shared_ptr<mpdf> > &S ) {
+	void set_sources ( const Array<shared_ptr<pdf> > &S ) {
 		merger_base::set_sources ( S );
 		Nsources = S.length();
Index: /library/bdm/stat/emix.h
===================================================================
--- /library/bdm/stat/emix.h (revision 675)
+++ /library/bdm/stat/emix.h (revision 693)
@@ -35,7 +35,7 @@
 At present the only supported operation is evallogcond().
  */
-class mratio: public mpdf {
+class mratio: public pdf {
 protected:
-	//! Nominator in the form of mpdf
+	//! Nominator in the form of pdf
 	const epdf* nom;
 
@@ -50,5 +50,5 @@
 	//!Default constructor. By default, the given epdf is not copied!
 	//! It is assumed that this function will be used only temporarily.
-	mratio ( const epdf* nom0, const RV &rv, bool copy = false ) : mpdf ( ), dl ( ) {
+	mratio ( const epdf* nom0, const RV &rv, bool copy = false ) : pdf ( ), dl ( ) {
 		// adjust rv and rvc
 
@@ -178,5 +178,5 @@
 	//! Update already existing marginal density  \c target
 	void marginal ( const RV &rv, emix &target ) const;
-	shared_ptr<mpdf> condition ( const RV &rv ) const;
+	shared_ptr<pdf> condition ( const RV &rv ) const;
 
 //Access methods
@@ -283,9 +283,9 @@
 Note that
 */
-class mprod: public mpdf {
+class mprod: public pdf {
 private:
-	Array<shared_ptr<mpdf> > mpdfs;
-
-	//! Data link for each mpdfs
+	Array<shared_ptr<pdf> > pdfs;
+
+	//! Data link for each pdfs
 	Array<shared_ptr<datalink_m2m> > dls;
 
@@ -300,20 +300,20 @@
 	/*!\brief Constructor from list of mFacs
 	*/
-	mprod ( const Array<shared_ptr<mpdf> > &mFacs ) {
+	mprod ( const Array<shared_ptr<pdf> > &mFacs ) {
 		set_elements ( mFacs );
 	}
-	//! Set internal \c mpdfs from given values
-	void set_elements (const Array<shared_ptr<mpdf> > &mFacs );
+	//! Set internal \c pdfs from given values
+	void set_elements (const Array<shared_ptr<pdf> > &mFacs );
 
 	double evallogcond ( const vec &val, const vec &cond ) {
 		int i;
 		double res = 0.0;
-		for ( i = mpdfs.length() - 1; i >= 0; i-- ) {
-			/*			if ( mpdfs(i)->_rvc().count() >0) {
-							mpdfs ( i )->condition ( dls ( i )->get_cond ( val,cond ) );
+		for ( i = pdfs.length() - 1; i >= 0; i-- ) {
+			/*			if ( pdfs(i)->_rvc().count() >0) {
+							pdfs ( i )->condition ( dls ( i )->get_cond ( val,cond ) );
 						}
 						// add logarithms
 						res += epdfs ( i )->evallog ( dls ( i )->pushdown ( val ) );*/
-			res += mpdfs ( i )->evallogcond (
+			res += pdfs ( i )->evallogcond (
 			           dls ( i )->pushdown ( val ),
 			           dls ( i )->get_cond ( val, cond )
@@ -344,7 +344,7 @@
 		vec smpi;
 		// Hard assumption here!!! We are going backwards, to assure that samples that are needed from smp are already generated!
-		for ( int i = ( mpdfs.length() - 1 ); i >= 0; i-- ) {
-			// generate contribution of this mpdf
-			smpi = mpdfs(i)->samplecond(dls ( i )->get_cond ( smp , cond ));			
+		for ( int i = ( pdfs.length() - 1 ); i >= 0; i-- ) {
+			// generate contribution of this pdf
+			smpi = pdfs(i)->samplecond(dls ( i )->get_cond ( smp , cond ));			
 			// copy contribution of this pdf into smp
 			dls ( i )->pushup ( smp, smpi );
@@ -356,11 +356,11 @@
 	//!  \code
 	//! { class='mprod';
-	//!   mpdfs = (..., ...);     // list of mpdfs in the order of chain rule
+	//!   pdfs = (..., ...);     // list of pdfs in the order of chain rule
 	//! }
 	//! \endcode
 	//!@}
 	void from_setting ( const Setting &set ) {
-		Array<shared_ptr<mpdf> > atmp; //temporary Array
-		UI::get ( atmp, set, "mpdfs", UI::compulsory );
+		Array<shared_ptr<pdf> > atmp; //temporary Array
+		UI::get ( atmp, set, "pdfs", UI::compulsory );
 		set_elements ( atmp );
 	}
@@ -460,11 +460,11 @@
 
 
-/*! \brief Mixture of mpdfs with constant weights, all mpdfs are of equal RV and RVC
+/*! \brief Mixture of pdfs with constant weights, all pdfs are of equal RV and RVC
 
 */
-class mmix : public mpdf {
+class mmix : public pdf {
 protected:
-	//! Component (mpdfs)
-	Array<shared_ptr<mpdf> > Coms;
+	//! Component (pdfs)
+	Array<shared_ptr<pdf> > Coms;
 	//!weights of the components
 	vec w;
@@ -474,5 +474,5 @@
 
 	//! Set weights \c w and components \c R
-	void set_parameters ( const vec &w0, const Array<shared_ptr<mpdf> > &Coms0 ) {
+	void set_parameters ( const vec &w0, const Array<shared_ptr<pdf> > &Coms0 ) {
 		//!\todo check if all components are OK
 		Coms = Coms0;
Index: /library/bdm/CMakeLists.txt
===================================================================
--- /library/bdm/CMakeLists.txt (revision 692)
+++ /library/bdm/CMakeLists.txt (revision 693)
@@ -18,5 +18,4 @@
 IF(WIN32)
    SET(bdm_support ${bdm_support} dirent.c dirent.h)
-   ADD_DEFINITIONS(-DLIBCONFIG_STATIC -DLIBCONFIGXX_STATIC)
 ENDIF()
 
Index: /library/tests/emix_test.cpp
===================================================================
--- /library/tests/emix_test.cpp (revision 689)
+++ /library/tests/emix_test.cpp (revision 693)
@@ -37,6 +37,6 @@
 	epdf_ptr Mm = M1.marginal ( y );
 	epdf_ptr Am = E1->marginal ( y );
-	mpdf_ptr Mc = M1.condition ( y );
-	mpdf_ptr Ac = E1->condition ( y );
+	pdf_ptr Mc = M1.condition ( y );
+	pdf_ptr Ac = E1->condition ( y );
 
 	mlnorm<ldmat> *wacnd = dynamic_cast<mlnorm<ldmat> *>( Ac.get() );
@@ -81,5 +81,5 @@
 	epdf_ptr Mg = M2.marginal ( y );
 	CHECK ( Mg.get() );
-	mpdf_ptr Cn = M2.condition ( x );
+	pdf_ptr Cn = M2.condition ( x );
 	CHECK ( Cn.get() );
 
Index: /library/tests/merger_2d_test.cpp
===================================================================
--- /library/tests/merger_2d_test.cpp (revision 675)
+++ /library/tests/merger_2d_test.cpp (revision 693)
@@ -31,5 +31,5 @@
 	f2->set_parameters ( "1 1", mat ( "0.5 0; 0 0.1" ) );
 
-	mpdf_array A ( 2 );
+	pdf_array A ( 2 );
 	A ( 0 ) = f1;
 	A ( 1 ) = f2;
Index: /library/tests/mepdf.cfg
===================================================================
--- /library/tests/mepdf.cfg (revision 675)
+++ /library/tests/mepdf.cfg (revision 693)
@@ -1,6 +1,6 @@
 data = (
 {
-  class = "mpdf_harness";
-  mpdf = {
+  class = "pdf_harness";
+  pdf = {
       class = "enorm<ldmat>";
       mu = [ 1.1, -1.0 ];
Index: /library/tests/mlnorm.cfg
===================================================================
--- /library/tests/mlnorm.cfg (revision 489)
+++ /library/tests/mlnorm.cfg (revision 693)
@@ -1,6 +1,6 @@
 data = (
 {
-  class = "mpdf_harness";
-  mpdf = {
+  class = "pdf_harness";
+  pdf = {
     class = "mlnorm<ldmat>";
     A = ( "matrix", 2, 2, [ 1.0, 0.0, 0.0, 1.0 ] );
@@ -15,6 +15,6 @@
 },
 {
-  class = "mpdf_harness";
-  mpdf = {
+  class = "pdf_harness";
+  pdf = {
     class = "mlnorm<chmat>";
     A = ( "matrix", 2, 2, [ 1.0, 0.0, 0.0, 1.0 ] );
Index: /library/tests/datasource_test.cpp
===================================================================
--- /library/tests/datasource_test.cpp (revision 689)
+++ /library/tests/datasource_test.cpp (revision 693)
@@ -20,8 +20,8 @@
 }
 
-TEST ( MpdfDS_test ) {
-	UIFile uif("mpdfds.cfg");
+TEST ( PdfDS_test ) {
+	UIFile uif("pdfds.cfg");
 
-	shared_ptr<MpdfDS> ds=UI::build<MpdfDS>(uif, "ds", UI::compulsory);
+	shared_ptr<PdfDS> ds=UI::build<PdfDS>(uif, "ds", UI::compulsory);
 	
 	vec dt = zeros(2);
Index: /library/tests/pdf_harness.cpp
===================================================================
--- /library/tests/pdf_harness.cpp (revision 693)
+++ /library/tests/pdf_harness.cpp (revision 693)
@@ -0,0 +1,91 @@
+#include "pdf_harness.h"
+#include "base/bdmbase.h"
+#include "base/user_info.h"
+#include "stat/exp_family.h"
+#include "mat_checks.h"
+#include "test_util.h"
+#include "UnitTest++.h"
+
+namespace bdm {
+
+void pdf_harness::test_config ( const char *config_file_name ) {
+	RV::clear_all();
+
+	UIFile in ( config_file_name );
+	Array<shared_ptr<pdf_harness> > input;
+	UI::get ( input, in, "data", UI::compulsory );
+	int sz = input.size();
+	CHECK ( sz > 0 );
+	for ( int i = 0; i < sz; ++i ) {
+		input ( i )->test ( config_file_name, i );
+	}
+}
+
+void pdf_harness::from_setting ( const Setting &set ) {
+	hpdf = UI::build<pdf> ( set, "pdf", UI::compulsory );
+	UI::get ( mean, set, "mean", UI::compulsory );
+	UI::get ( variance, set, "variance", UI::compulsory );
+
+	if ( !UI::get ( cond, set, "cond", UI::optional ) ) {
+		cond = zeros ( hpdf->dimensionc() );
+	}
+
+	UI::get ( nsamples, set, "nsamples", UI::optional );
+	UI::get ( R, set, "R", UI::optional );
+	UI::get ( tolerance, set, "tolerance", UI::optional );
+}
+
+void pdf_harness::test ( const char *config_name, int idx ) {
+	CurrentContext cc ( config_name, idx );
+	check_mean();
+	if ( R.rows() > 0 ) {
+		check_covariance();
+	}
+}
+
+void pdf_harness::check_mean() {
+	vec delta = make_close_tolerance ( variance, nsamples );
+
+	int tc = 0;
+	Array<vec> actual(CurrentContext::max_trial_count);
+	do {
+		mat smp = hpdf->samplecond_m ( cond, nsamples );
+		vec emu = smp * ones ( nsamples ) / nsamples;
+		actual( tc ) = emu;
+		++tc;
+	} while ( ( tc < CurrentContext::max_trial_count ) &&
+		  !UnitTest::AreClose ( mean, actual( tc - 1 ), delta ) );
+	if ( ( tc == CurrentContext::max_trial_count ) &&
+	     ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), delta ) ) ) {
+		UnitTest::MemoryOutStream stream;
+		stream << CurrentContext::format_context(__LINE__) << "expected " << mean << " +/- " << delta << " but was " << actual;
+
+		UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false);
+
+		UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
+       }
+}
+
+void pdf_harness::check_covariance() {
+	int tc = 0;
+	Array<mat> actual(CurrentContext::max_trial_count);
+	do {
+		mat smp = hpdf->samplecond_m ( cond, nsamples );
+		vec emu = smp * ones ( nsamples ) / nsamples;
+		mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu );
+		actual( tc ) = er;
+		++tc;
+	} while ( ( tc < CurrentContext::max_trial_count ) &&
+		  !UnitTest::AreClose ( R, actual( tc - 1 ), tolerance ) );
+	if ( ( tc == CurrentContext::max_trial_count ) &&
+	     ( !UnitTest::AreClose ( R, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) {
+		UnitTest::MemoryOutStream stream;
+		stream << CurrentContext::format_context(__LINE__) << "expected " << R << " +/- " << tolerance << " but was " << actual;
+
+		UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false);
+
+		UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
+       }
+}
+
+}
Index: /library/tests/mprod.cfg
===================================================================
--- /library/tests/mprod.cfg (revision 675)
+++ /library/tests/mprod.cfg (revision 693)
@@ -1,8 +1,8 @@
 data = (
 {
-  class = "mpdf_harness";
-  mpdf = {
+  class = "pdf_harness";
+  pdf = {
     class = "mprod";
-    mpdfs = ( 
+    pdfs = ( 
     {
       class = "mgamma";
@@ -37,8 +37,8 @@
 },
 {
-  class = "mpdf_harness";
-  mpdf = {
+  class = "pdf_harness";
+  pdf = {
     class = "mprod";
-    mpdfs = ( 
+    pdfs = ( 
     {
 	class = "enorm<ldmat>";
Index: /library/tests/pdf_test.cpp
===================================================================
--- /library/tests/pdf_test.cpp (revision 693)
+++ /library/tests/pdf_test.cpp (revision 693)
@@ -0,0 +1,130 @@
+#include "base/bdmbase.h"
+#include "base/user_info.h"
+#include "stat/emix.h"
+#include "itpp_ext.h"
+#include "pdf_harness.h"
+#include "mat_checks.h"
+#include "UnitTest++.h"
+
+using namespace bdm;
+
+static void check_mean(pdf &distrib_obj, const vec &mu0, int nsamples, const vec &mean, double tolerance);
+
+static void check_covariance(mmix &distrib_obj, const vec &mu0, int nsamples, const mat &R, double tolerance);
+
+TEST ( mepdf_test ) {
+	pdf_harness::test_config ( "mepdf.cfg" );
+}
+
+TEST ( mgamma_test ) {
+	pdf_harness::test_config ( "mgamma.cfg" );
+}
+
+TEST ( mlnorm_test ) {
+	pdf_harness::test_config ( "mlnorm.cfg" );
+}
+
+TEST ( mprod_test ) {
+	pdf_harness::test_config ( "mprod.cfg" );
+}
+
+// not using pdf_harness because mmix isn't configurable (yet?)
+TEST ( mmix_test ) {
+	RV x ( "{mmixx }", "2" );
+	RV y ( "{mmixy }", "2" );
+	int N = 10000; //number of samples
+	vec mu0 ( "1.5 1.7" );
+	mat V0 ( "1.2 0.3; 0.3 5" );
+	ldmat R = ldmat ( V0 );
+
+	enorm_ldmat_ptr eN;
+	eN->set_parameters ( mu0, R );
+
+	mgamma_ptr mG;
+	double k = 10.0;
+	mG->set_parameters ( k, mu0 );
+
+	mmix mMix;
+	pdf_array mComs ( 2 );
+
+	// mmix::set_parameters requires the first pdf to be named
+	mG->set_rv(x);
+	mG->set_rvc(y);
+	mComs ( 0 ) = mG;
+
+	eN->set_mu ( vec_2 ( 0.0, 0.0 ) );
+	mComs ( 1 ) = eN;
+
+	mMix.set_parameters ( vec_2 ( 0.5, 0.5 ), mComs );
+
+	vec tmu = 0.5 * eN->mean() + 0.5 * mu0;
+	check_mean ( mMix, mu0, N, tmu, 0.1 );
+
+	mat observedR ( "1.27572 0.778247; 0.778247 3.33129" );
+	check_covariance( mMix, mu0, N, observedR, 0.2 );
+}
+
+// not using pdf_harness because emix isn't configurable (yet?)
+TEST ( mepdf_emix_test ) {
+	int N = 10000; //number of samples
+	vec mu0 ( "1.5 1.7" );
+	mat V0 ( "1.2 0.3; 0.3 5" );
+	ldmat R = ldmat ( V0 );
+
+	enorm_ldmat_ptr eN;
+	eN->set_parameters ( mu0, R );
+
+	vec a = "100000,10000";
+	vec b = a / 10.0;
+	egamma_ptr eG;
+	eG->set_parameters ( a, b );
+
+	emix_ptr eMix;
+	epdf_array Coms ( 2 );
+	Coms ( 0 ) = eG;
+	Coms ( 1 ) = eN;
+
+	eMix->set_parameters ( vec_2 ( 0.5, 0.5 ), Coms );
+	check_mean ( *eMix, mu0, N, eMix->mean(), 0.1 );
+}
+
+static void check_mean(pdf &distrib_obj, const vec &mu0, int nsamples, const vec &mean, double tolerance) {
+	int tc = 0;
+	Array<vec> actual(CurrentContext::max_trial_count);
+	do {
+		mat smp = distrib_obj.samplecond_m ( mu0, nsamples );
+		vec emu = smp * ones ( nsamples ) / nsamples ;
+		actual( tc ) = emu;
+		++tc;
+	} while ( ( tc < CurrentContext::max_trial_count ) &&
+		  !UnitTest::AreClose ( mean, actual( tc - 1 ), tolerance ) );
+	if ( ( tc == CurrentContext::max_trial_count ) &&
+	     ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) {
+		UnitTest::MemoryOutStream stream;
+		UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), __LINE__);
+		stream << "Expected " << mean << " +/- " << tolerance << " but was " << actual;
+
+		UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
+	}
+}
+
+static void check_covariance(mmix &distrib_obj, const vec &mu0, int nsamples, const mat &R, double tolerance) {
+	int tc = 0;
+	Array<mat> actual(CurrentContext::max_trial_count);
+	do {
+		mat smp = distrib_obj.samplecond_m ( mu0, nsamples );
+		vec emu = smp * ones ( nsamples ) / nsamples ;
+		mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu );
+		actual( tc ) = er;
+		++tc;
+	} while ( ( tc < CurrentContext::max_trial_count ) &&
+		  !UnitTest::AreClose ( R, actual( tc - 1 ), tolerance ) );
+	if ( ( tc == CurrentContext::max_trial_count ) &&
+	     ( !UnitTest::AreClose ( R, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) {
+		UnitTest::MemoryOutStream stream;
+		UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), __LINE__);
+		stream << "Expected " << R << " +/- " << tolerance << " but was " << actual;
+
+		UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
+       }
+}
Index: /library/tests/pdfds.cfg
===================================================================
--- /library/tests/pdfds.cfg (revision 693)
+++ /library/tests/pdfds.cfg (revision 693)
@@ -0,0 +1,18 @@
+ds={
+class = "PdfDS";
+pdf = {
+  class = "mlnorm<ldmat>";
+  A = ( "matrix", 1, 2, [ 0.5, -0.1 ] );
+  R = ( "matrix", 1, 1, [ 1e-10 ] );
+  const =  ( "matrix", 1, 1, [ 0.0 ] );
+  rv = {
+    class = "RV";
+    names = ( "a" );
+  };
+  rvc = {
+    class = "RV";
+    names = ( "a", "b" );
+	 times = [-1 , 0];
+  };
+};
+};
Index: /library/tests/merger_test.cpp
===================================================================
--- /library/tests/merger_test.cpp (revision 689)
+++ /library/tests/merger_test.cpp (revision 693)
@@ -21,5 +21,5 @@
 	f2->set_parameters ( "5", mat ( "10" ) );
 
-	mpdf_array A ( 2 );
+	pdf_array A ( 2 );
 	A ( 0 ) = f1;
 	A ( 1 ) = f2;
@@ -144,5 +144,5 @@
 		UI::build<merger_base> ( in, "Merger", UI::compulsory );
 
-	mpdf_array sources;
+	pdf_array sources;
 	UI::get ( sources, in, "Sources", UI::compulsory );
 	mb->set_sources ( sources );
@@ -160,5 +160,5 @@
 	UIFile in ( "merger_error.cfg" );
 
-	mpdf_array sources;
+	pdf_array sources;
 	try {
 		UI::get ( sources, in, "Sources", UI::compulsory );
Index: /library/tests/pdf_harness.h
===================================================================
--- /library/tests/pdf_harness.h (revision 693)
+++ /library/tests/pdf_harness.h (revision 693)
@@ -0,0 +1,58 @@
+/*!
+  \file
+  \brief Support for testing descendants of pdf.
+  \author Vaclav Barta.
+
+  -----------------------------------
+  BDM++ - C++ library for Bayesian Decision Making under Uncertainty
+
+  Using IT++ for numerical operations
+  -----------------------------------
+*/
+
+#ifndef pdf_HARNESS_H
+#define pdf_HARNESS_H
+
+#include "bdmroot.h"
+#include "itpp_ext.h"
+#include "shared_ptr.h"
+#include "base/bdmbase.h"
+#include "base/user_info.h"
+
+namespace bdm {
+
+class pdf_harness : public root {
+private:
+	shared_ptr<pdf> hpdf;
+	vec cond;
+	vec mean;
+	vec variance;
+	int nsamples;
+	mat R;
+	double tolerance;
+
+public:
+	static void test_config ( const char *config_file_name );
+
+	pdf_harness() : nsamples ( 1000 ), tolerance ( 0.1 ) { }
+
+	virtual void test ( const char *config_name, int idx );
+
+	void from_setting ( const Setting &set );
+
+protected:
+	pdf *get_pdf() {
+		return hpdf.get();
+	}
+
+private:
+	void check_mean();
+
+	// assumes R is valid
+	void check_covariance();
+};
+UIREGISTER(pdf_harness);
+
+}
+
+#endif
Index: /library/tests/CMakeLists.txt
===================================================================
--- /library/tests/CMakeLists.txt (revision 691)
+++ /library/tests/CMakeLists.txt (revision 693)
@@ -8,5 +8,5 @@
 
 SET(testutil_src epdf_harness.cpp epdf_harness.h mat_checks.cpp mat_checks.h 
-	mpdf_harness.cpp mpdf_harness.h square_mat_point.cpp square_mat_point.h test_util.cpp test_util.h)
+	pdf_harness.cpp pdf_harness.h square_mat_point.cpp square_mat_point.h test_util.cpp test_util.h)
 
 add_library(testutil ${testutil_src})
@@ -41,8 +41,8 @@
 # using UnitTest++
 
-SET(unit_test_configurations  mepdf.cfg egiw.cfg mlnorm.cfg edirich.cfg mprod.cfg generator.cfg epdfds.cfg mpdfds.cfg test_user_info_input.cfg merger.cfg erroneous.cfg egamma.cfg test_user_info_external.cfg merger_error.cfg mgamma.cfg enorm.cfg)
+SET(unit_test_configurations  mepdf.cfg egiw.cfg mlnorm.cfg edirich.cfg mprod.cfg generator.cfg epdfds.cfg pdfds.cfg test_user_info_input.cfg merger.cfg erroneous.cfg egamma.cfg test_user_info_external.cfg merger_error.cfg mgamma.cfg enorm.cfg)
 
 add_executable(testsuite arx_straux_test.cpp datalink_test.cpp  datasource_test.cpp egiw_test.cpp emix_test.cpp epdf_test.cpp logger_test.cpp LQG_test.cpp merger_test.cpp 
-	mpdf_test.cpp randun_test.cpp rectangular_support_test.cpp rv_test.cpp shared_ptr_test.cpp square_mat_test.cpp testsuite.cpp user_info_test.cpp  ${unit_test_configurations} )
+	pdf_test.cpp randun_test.cpp rectangular_support_test.cpp rv_test.cpp shared_ptr_test.cpp square_mat_test.cpp testsuite.cpp user_info_test.cpp  ${unit_test_configurations} )
 
 set_source_files_properties(${unit_test_configurations} PROPERTIES HEADER_FILE_ONLY TRUE)
Index: /library/tests/epdf_harness.cpp
===================================================================
--- /library/tests/epdf_harness.cpp (revision 675)
+++ /library/tests/epdf_harness.cpp (revision 693)
@@ -67,7 +67,7 @@
 		RV crv = hepdf->_rv().subt ( *mrv );
 		epdf_ptr m = hepdf->marginal ( *mrv );
-		mpdf_ptr c = hepdf->condition ( crv );
-
-		mpdf_array aa ( 2 );
+		pdf_ptr c = hepdf->condition ( crv );
+
+		pdf_array aa ( 2 );
 		aa ( 0 ) = c;
 		aa ( 1 ) = m;
Index: /library/tests/merger_iter_test.cpp
===================================================================
--- /library/tests/merger_iter_test.cpp (revision 675)
+++ /library/tests/merger_iter_test.cpp (revision 693)
@@ -32,5 +32,5 @@
 	f3->set_parameters ( "2", mat ( "0.4" ) );
 
-	mpdf_array A ( 3 );
+	pdf_array A ( 3 );
 	A ( 0 ) = f1;
 	A ( 1 ) = f2;
Index: /library/tests/mgamma.cfg
===================================================================
--- /library/tests/mgamma.cfg (revision 521)
+++ /library/tests/mgamma.cfg (revision 693)
@@ -1,6 +1,6 @@
 data = (
 {
-  class = "mpdf_harness";
-  mpdf = {
+  class = "pdf_harness";
+  pdf = {
     class = "mgamma";
     beta = [ 1.5, 1.7 ];
@@ -24,6 +24,6 @@
 },
 {
-  class = "mpdf_harness";
-  mpdf = {
+  class = "pdf_harness";
+  pdf = {
     class = "mgamma";
     beta = [ 1.5, 1.7 ];
Index: /brary/tests/mpdf_test.cpp
===================================================================
--- /library/tests/mpdf_test.cpp (revision 689)
+++  (revision )
@@ -1,130 +1,0 @@
-#include "base/bdmbase.h"
-#include "base/user_info.h"
-#include "stat/emix.h"
-#include "itpp_ext.h"
-#include "mpdf_harness.h"
-#include "mat_checks.h"
-#include "UnitTest++.h"
-
-using namespace bdm;
-
-static void check_mean(mpdf &distrib_obj, const vec &mu0, int nsamples, const vec &mean, double tolerance);
-
-static void check_covariance(mmix &distrib_obj, const vec &mu0, int nsamples, const mat &R, double tolerance);
-
-TEST ( mepdf_test ) {
-	mpdf_harness::test_config ( "mepdf.cfg" );
-}
-
-TEST ( mgamma_test ) {
-	mpdf_harness::test_config ( "mgamma.cfg" );
-}
-
-TEST ( mlnorm_test ) {
-	mpdf_harness::test_config ( "mlnorm.cfg" );
-}
-
-TEST ( mprod_test ) {
-	mpdf_harness::test_config ( "mprod.cfg" );
-}
-
-// not using mpdf_harness because mmix isn't configurable (yet?)
-TEST ( mmix_test ) {
-	RV x ( "{mmixx }", "2" );
-	RV y ( "{mmixy }", "2" );
-	int N = 10000; //number of samples
-	vec mu0 ( "1.5 1.7" );
-	mat V0 ( "1.2 0.3; 0.3 5" );
-	ldmat R = ldmat ( V0 );
-
-	enorm_ldmat_ptr eN;
-	eN->set_parameters ( mu0, R );
-
-	mgamma_ptr mG;
-	double k = 10.0;
-	mG->set_parameters ( k, mu0 );
-
-	mmix mMix;
-	mpdf_array mComs ( 2 );
-
-	// mmix::set_parameters requires the first mpdf to be named
-	mG->set_rv(x);
-	mG->set_rvc(y);
-	mComs ( 0 ) = mG;
-
-	eN->set_mu ( vec_2 ( 0.0, 0.0 ) );
-	mComs ( 1 ) = eN;
-
-	mMix.set_parameters ( vec_2 ( 0.5, 0.5 ), mComs );
-
-	vec tmu = 0.5 * eN->mean() + 0.5 * mu0;
-	check_mean ( mMix, mu0, N, tmu, 0.1 );
-
-	mat observedR ( "1.27572 0.778247; 0.778247 3.33129" );
-	check_covariance( mMix, mu0, N, observedR, 0.2 );
-}
-
-// not using mpdf_harness because emix isn't configurable (yet?)
-TEST ( mepdf_emix_test ) {
-	int N = 10000; //number of samples
-	vec mu0 ( "1.5 1.7" );
-	mat V0 ( "1.2 0.3; 0.3 5" );
-	ldmat R = ldmat ( V0 );
-
-	enorm_ldmat_ptr eN;
-	eN->set_parameters ( mu0, R );
-
-	vec a = "100000,10000";
-	vec b = a / 10.0;
-	egamma_ptr eG;
-	eG->set_parameters ( a, b );
-
-	emix_ptr eMix;
-	epdf_array Coms ( 2 );
-	Coms ( 0 ) = eG;
-	Coms ( 1 ) = eN;
-
-	eMix->set_parameters ( vec_2 ( 0.5, 0.5 ), Coms );
-	check_mean ( *eMix, mu0, N, eMix->mean(), 0.1 );
-}
-
-static void check_mean(mpdf &distrib_obj, const vec &mu0, int nsamples, const vec &mean, double tolerance) {
-	int tc = 0;
-	Array<vec> actual(CurrentContext::max_trial_count);
-	do {
-		mat smp = distrib_obj.samplecond_m ( mu0, nsamples );
-		vec emu = smp * ones ( nsamples ) / nsamples ;
-		actual( tc ) = emu;
-		++tc;
-	} while ( ( tc < CurrentContext::max_trial_count ) &&
-		  !UnitTest::AreClose ( mean, actual( tc - 1 ), tolerance ) );
-	if ( ( tc == CurrentContext::max_trial_count ) &&
-	     ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) {
-		UnitTest::MemoryOutStream stream;
-		UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), __LINE__);
-		stream << "Expected " << mean << " +/- " << tolerance << " but was " << actual;
-
-		UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
-	}
-}
-
-static void check_covariance(mmix &distrib_obj, const vec &mu0, int nsamples, const mat &R, double tolerance) {
-	int tc = 0;
-	Array<mat> actual(CurrentContext::max_trial_count);
-	do {
-		mat smp = distrib_obj.samplecond_m ( mu0, nsamples );
-		vec emu = smp * ones ( nsamples ) / nsamples ;
-		mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu );
-		actual( tc ) = er;
-		++tc;
-	} while ( ( tc < CurrentContext::max_trial_count ) &&
-		  !UnitTest::AreClose ( R, actual( tc - 1 ), tolerance ) );
-	if ( ( tc == CurrentContext::max_trial_count ) &&
-	     ( !UnitTest::AreClose ( R, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) {
-		UnitTest::MemoryOutStream stream;
-		UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), __LINE__);
-		stream << "Expected " << R << " +/- " << tolerance << " but was " << actual;
-
-		UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
-       }
-}
Index: /brary/tests/mpdfds.cfg
===================================================================
--- /library/tests/mpdfds.cfg (revision 598)
+++  (revision )
@@ -1,18 +1,0 @@
-ds={
-class = "MpdfDS";
-mpdf = {
-  class = "mlnorm<ldmat>";
-  A = ( "matrix", 1, 2, [ 0.5, -0.1 ] );
-  R = ( "matrix", 1, 1, [ 1e-10 ] );
-  const =  ( "matrix", 1, 1, [ 0.0 ] );
-  rv = {
-    class = "RV";
-    names = ( "a" );
-  };
-  rvc = {
-    class = "RV";
-    names = ( "a", "b" );
-	 times = [-1 , 0];
-  };
-};
-};
Index: /brary/tests/mpdf_harness.h
===================================================================
--- /library/tests/mpdf_harness.h (revision 493)
+++  (revision )
@@ -1,58 +1,0 @@
-/*!
-  \file
-  \brief Support for testing descendants of mpdf.
-  \author Vaclav Barta.
-
-  -----------------------------------
-  BDM++ - C++ library for Bayesian Decision Making under Uncertainty
-
-  Using IT++ for numerical operations
-  -----------------------------------
-*/
-
-#ifndef MPDF_HARNESS_H
-#define MPDF_HARNESS_H
-
-#include "bdmroot.h"
-#include "itpp_ext.h"
-#include "shared_ptr.h"
-#include "base/bdmbase.h"
-#include "base/user_info.h"
-
-namespace bdm {
-
-class mpdf_harness : public root {
-private:
-	shared_ptr<mpdf> hmpdf;
-	vec cond;
-	vec mean;
-	vec variance;
-	int nsamples;
-	mat R;
-	double tolerance;
-
-public:
-	static void test_config ( const char *config_file_name );
-
-	mpdf_harness() : nsamples ( 1000 ), tolerance ( 0.1 ) { }
-
-	virtual void test ( const char *config_name, int idx );
-
-	void from_setting ( const Setting &set );
-
-protected:
-	mpdf *get_mpdf() {
-		return hmpdf.get();
-	}
-
-private:
-	void check_mean();
-
-	// assumes R is valid
-	void check_covariance();
-};
-UIREGISTER(mpdf_harness);
-
-}
-
-#endif
Index: /brary/tests/mpdf_harness.cpp
===================================================================
--- /library/tests/mpdf_harness.cpp (revision 527)
+++  (revision )
@@ -1,91 +1,0 @@
-#include "mpdf_harness.h"
-#include "base/bdmbase.h"
-#include "base/user_info.h"
-#include "stat/exp_family.h"
-#include "mat_checks.h"
-#include "test_util.h"
-#include "UnitTest++.h"
-
-namespace bdm {
-
-void mpdf_harness::test_config ( const char *config_file_name ) {
-	RV::clear_all();
-
-	UIFile in ( config_file_name );
-	Array<shared_ptr<mpdf_harness> > input;
-	UI::get ( input, in, "data", UI::compulsory );
-	int sz = input.size();
-	CHECK ( sz > 0 );
-	for ( int i = 0; i < sz; ++i ) {
-		input ( i )->test ( config_file_name, i );
-	}
-}
-
-void mpdf_harness::from_setting ( const Setting &set ) {
-	hmpdf = UI::build<mpdf> ( set, "mpdf", UI::compulsory );
-	UI::get ( mean, set, "mean", UI::compulsory );
-	UI::get ( variance, set, "variance", UI::compulsory );
-
-	if ( !UI::get ( cond, set, "cond", UI::optional ) ) {
-		cond = zeros ( hmpdf->dimensionc() );
-	}
-
-	UI::get ( nsamples, set, "nsamples", UI::optional );
-	UI::get ( R, set, "R", UI::optional );
-	UI::get ( tolerance, set, "tolerance", UI::optional );
-}
-
-void mpdf_harness::test ( const char *config_name, int idx ) {
-	CurrentContext cc ( config_name, idx );
-	check_mean();
-	if ( R.rows() > 0 ) {
-		check_covariance();
-	}
-}
-
-void mpdf_harness::check_mean() {
-	vec delta = make_close_tolerance ( variance, nsamples );
-
-	int tc = 0;
-	Array<vec> actual(CurrentContext::max_trial_count);
-	do {
-		mat smp = hmpdf->samplecond_m ( cond, nsamples );
-		vec emu = smp * ones ( nsamples ) / nsamples;
-		actual( tc ) = emu;
-		++tc;
-	} while ( ( tc < CurrentContext::max_trial_count ) &&
-		  !UnitTest::AreClose ( mean, actual( tc - 1 ), delta ) );
-	if ( ( tc == CurrentContext::max_trial_count ) &&
-	     ( !UnitTest::AreClose ( mean, actual( CurrentContext::max_trial_count - 1 ), delta ) ) ) {
-		UnitTest::MemoryOutStream stream;
-		stream << CurrentContext::format_context(__LINE__) << "expected " << mean << " +/- " << delta << " but was " << actual;
-
-		UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false);
-
-		UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
-       }
-}
-
-void mpdf_harness::check_covariance() {
-	int tc = 0;
-	Array<mat> actual(CurrentContext::max_trial_count);
-	do {
-		mat smp = hmpdf->samplecond_m ( cond, nsamples );
-		vec emu = smp * ones ( nsamples ) / nsamples;
-		mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu );
-		actual( tc ) = er;
-		++tc;
-	} while ( ( tc < CurrentContext::max_trial_count ) &&
-		  !UnitTest::AreClose ( R, actual( tc - 1 ), tolerance ) );
-	if ( ( tc == CurrentContext::max_trial_count ) &&
-	     ( !UnitTest::AreClose ( R, actual( CurrentContext::max_trial_count - 1 ), tolerance ) ) ) {
-		UnitTest::MemoryOutStream stream;
-		stream << CurrentContext::format_context(__LINE__) << "expected " << R << " +/- " << tolerance << " but was " << actual;
-
-		UnitTest::TestDetails details(*UnitTest::CurrentTest::Details(), 0, false);
-
-		UnitTest::CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
-       }
-}
-
-}
Index: /library/system/SetBdmEnv.cmake
===================================================================
--- /library/system/SetBdmEnv.cmake (revision 662)
+++ /library/system/SetBdmEnv.cmake (revision 693)
@@ -27,4 +27,5 @@
 	ADD_DEFINITIONS(/wd4290)
 	ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
+	ADD_DEFINITIONS(-DLIBCONFIG_STATIC -DLIBCONFIGXX_STATIC)
 ENDIF(WIN32)
 IF(APPLE)
Index: /library/doc/tutorial/01userguide.dox
===================================================================
--- /library/doc/tutorial/01userguide.dox (revision 664)
+++ /library/doc/tutorial/01userguide.dox (revision 693)
@@ -162,5 +162,5 @@
      - bdm::CsvFileDS
      - bdm::ITppFileDS
- - bdm::MpdfDS
+ - bdm::PdfDS
  - bdm::stateDS
 
@@ -243,7 +243,7 @@
 fu.R     = 0.2;
 
-DS.class = 'MpdfDS';
-DS.mpdf.class  = 'mprod';
-DS.mpdf.mpdfs  = {fy, epdf2mpdf(fu)};
+DS.class = 'pdfDS';
+DS.pdf.class  = 'mprod';
+DS.pdf.pdfs  = {fy, epdf2mpdf(fu)};
 \endcode
 
@@ -252,6 +252,6 @@
  - naming convention 'mlnorm\<ldmat\>' relates to the concept of templates in C++. For those unfamiliar with this concept, it is basicaly a way how to share code for different flavours of the same object. Note that mlnorm exist in three versions: mlnorm\<ldmat\>, mlnorm<chmat>, mlnorm<fsqmat>. Those classes act identically the only difference is that the internal data are stored either in LD decomposition, choleski decomposition or full matrices, respectively. 
  - the same concept is used for enorm, where enorm<chmat> and enorm<fsqmat> are also possible. In this particular use, these objects are equivalent. In specific situation, e.g. Kalman filter implemented on Choleski decomposition (bdm::KalmanCh), only enorm<chmat> is approprate.
- - class 'mprod' represents the chain rule of probability. Attribute \c mpdfs of its configuration structure is a list of conditional densities. Conditional density \f$ f(a|b)\f$ is represented by class \c mpdf and its offsprings. Class \c RV is used to describe both variables before conditioning (field \c rv ) and after conditioning sign (field \c rvc).
- - due to simplicity of implementation, mprod accept only conditional densities in the field \c mpdfs. Hence, the pdf \f$ f(u_t)\f$ must be converted to conditional density with empty conditioning, \f$ f(u_t| \{\})\f$. This is achieved by calling function epdf2mpdf which is only a trivial wrapper creating class bdm::mepdf.
+ - class 'mprod' represents the chain rule of probability. Attribute \c pdfs of its configuration structure is a list of conditional densities. Conditional density \f$ f(a|b)\f$ is represented by class \c pdf and its offsprings. Class \c RV is used to describe both variables before conditioning (field \c rv ) and after conditioning sign (field \c rvc).
+ - due to simplicity of implementation, mprod accept only conditional densities in the field \c pdfs. Hence, the pdf \f$ f(u_t)\f$ must be converted to conditional density with empty conditioning, \f$ f(u_t| \{\})\f$. This is achieved by calling function epdf2mpdf which is only a trivial wrapper creating class bdm::mepdf.
  
  
@@ -260,5 +260,5 @@
 \subsection ug_ini Initializing simulation
 
-When zeros are not appropriate initial conditions, the correct conditions can be set using additional commands (see bdm::MpdfDS.from_setting() ):
+When zeros are not appropriate initial conditions, the correct conditions can be set using additional commands (see bdm::pdfDS.from_setting() ):
 \code
 DS.init_rv = RV({'y','y','y'}, [1,1,1], [-1,-2,-3]);
@@ -281,5 +281,5 @@
 Data=[M.y; M.u];
 drv = RVjoin({y,u});
-save mpdfds_results Data drv
+save pdfds_results Data drv
 \endcode
 Such data can be later provided e.g. by MemDS
Index: /library/doc/tutorial/unit_testing.dox
===================================================================
--- /library/doc/tutorial/unit_testing.dox (revision 613)
+++ /library/doc/tutorial/unit_testing.dox (revision 693)
@@ -118,6 +118,6 @@
 
 Testsuite has explicit support for testing classes derived from
-bdm::epdf and bdm::mpdf: bdm::epdf_harness and
-bdm::mpdf_harness. These classes run a list of tests on objects
+bdm::epdf and bdm::pdf: bdm::epdf_harness and
+bdm::pdf_harness. These classes run a list of tests on objects
 created from the specified configuration file (normally called
 &lt;classname&gt;.cfg) and check them against expected values also
Index: /library/doc/tutorial/02userguide2.dox
===================================================================
--- /library/doc/tutorial/02userguide2.dox (revision 659)
+++ /library/doc/tutorial/02userguide2.dox (revision 693)
@@ -106,5 +106,5 @@
 \section ug2_bm_composition Composition of estimators
 
-Similarly to mpdfs which could be composed via \c mprod, the Bayesian models can be composed. However, justification of this step is less clear than in the case of epdfs.
+Similarly to pdfs which could be composed via \c mprod, the Bayesian models can be composed. However, justification of this step is less clear than in the case of epdfs.
 
 One possible theoretical base of composition is the Marginalized particle filter, which splits the prior and the posterior in two parts:
