Index: library/bdm/estim/arx.h
===================================================================
--- library/bdm/estim/arx.h (revision 746)
+++ library/bdm/estim/arx.h (revision 766)
@@ -56,5 +56,7 @@
 	ARX ( const double frg0 = 1.0 ) : BMEF ( frg0 ),  have_constant ( true ), dyad(), est(), alter_est() {};
 	ARX ( const ARX &A0 ) : BMEF ( A0 ),  have_constant ( A0.have_constant ), dyad ( A0.dyad ), est ( A0.est ), alter_est ( A0.alter_est ) { };
-	ARX* _copy_() const;
+
+	ARX* _copy() const;
+
 	void set_parameters ( double frg0 ) {
 		frg = frg0;
@@ -174,5 +176,5 @@
 	//! copy constructor
 	ARXfrg ( const ARXfrg &A0 ) : ARX ( A0 ) {};
-	ARXfrg* _copy_() const {
+	virtual ARXfrg* _copy() const {
 		ARXfrg *A = new ARXfrg ( *this );
 		return A;
Index: library/bdm/estim/mixtures.cpp
===================================================================
--- library/bdm/estim/mixtures.cpp (revision 750)
+++ library/bdm/estim/mixtures.cpp (revision 766)
@@ -15,5 +15,5 @@
 	int ndat = Data.cols();
 	//Estimate  Com0 from all data
-	Coms ( 0 ) = Com0->_copy_();
+	Coms ( 0 ) = (BMEF*) Com0->_copy();
 //	Coms(0)->set_evalll(false);
 	Coms ( 0 )->bayes_batch ( Data );
@@ -24,10 +24,10 @@
 	for ( i = 1; i < n; i++ ) {
 		//copy Com0 and create new rvs for them
-		Coms ( i ) =  Coms ( 0 )->_copy_ ( );
+		Coms ( i ) =  (BMEF*) Coms ( 0 )->_copy ( );
 	}
 	//Pick some data for each component and update it
 	for ( i = 0; i < n; i++ ) {
 		//pick one datum
-		int ind = floor ( ndat * UniRNG.sample() );
+		int ind = (int) floor ( ndat * UniRNG.sample() );
 		Coms ( i )->bayes ( Data.get_col ( ind ), empty_vec );
 		//flatten back to oringinal
@@ -49,5 +49,5 @@
 	Array<BMEF*> Coms0 ( n );
 	for ( i = 0; i < n; i++ ) {
-		Coms0 ( i ) = ( BMEF* ) Coms ( i )->_copy_();
+		Coms0 ( i ) = ( BMEF* ) Coms ( i )->_copy();
 	}
 
@@ -147,5 +147,6 @@
 	emix* tmp;
 	tmp = new emix( );
-	tmp->set_parameters ( weights.posterior().mean(), pC );
+	tmp->_w() = weights.posterior().mean();
+	tmp->_Coms() = pC;
 	tmp->validate();
 	return tmp;
Index: library/bdm/estim/ekf_template.h
===================================================================
--- library/bdm/estim/ekf_template.h (revision 744)
+++ library/bdm/estim/ekf_template.h (revision 766)
@@ -30,5 +30,8 @@
 class EKFCh_dQ : public EKFCh {
 public:
-	BM* _copy_() const {return new EKFCh_dQ(*this);}
+	root* _copy_() const {
+		return new EKFCh_dQ(*this);
+	}
+
 	//! new bayes, expects cond = [ut, Qt]
 	void bayes( const vec &yt , const vec &cond) {
Index: library/bdm/estim/mixtures.h
===================================================================
--- library/bdm/estim/mixtures.h (revision 746)
+++ library/bdm/estim/mixtures.h (revision 766)
@@ -75,5 +75,5 @@
 			weights (), method ( QB ) {
 		for ( int i = 0; i < n; i++ ) {
-			Coms ( i ) = ( BMEF* ) Coms0 ( i )->_copy_();
+			Coms ( i ) = ( BMEF* ) Coms0 ( i )->_copy();
 		}
 		weights.set_parameters(alpha0);
@@ -92,5 +92,5 @@
 			weights ( M2.weights ), method ( M2.method ) {
 		for ( int i = 0; i < n; i++ ) {
-			Coms ( i ) = M2.Coms ( i )->_copy_();
+			Coms ( i ) = (BMEF*) M2.Coms ( i )->_copy();
 		}
 		build_est();
@@ -144,4 +144,2 @@
 }
 #endif // MIXTURES_H
-
-
Index: library/bdm/estim/particles.cpp
===================================================================
--- library/bdm/estim/particles.cpp (revision 739)
+++ library/bdm/estim/particles.cpp (revision 766)
@@ -168,5 +168,5 @@
 			if ( ind ( i ) != i ) {//replace the current Bm by a new one
 				delete BMs ( i );
-				BMs ( i ) = BMs ( ind ( i ) )->_copy_(); //copy constructor
+				BMs ( i ) = (BM*) BMs ( ind ( i ) )->_copy(); //copy constructor
 			}
 		};
Index: library/bdm/estim/kalman.h
===================================================================
--- library/bdm/estim/kalman.h (revision 744)
+++ library/bdm/estim/kalman.h (revision 766)
@@ -154,4 +154,10 @@
 		bdm_assert ( est.dimension(), "Statistics and model parameters mismatch" );
 	}
+
+	virtual double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0);
+
+	virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL);
+	
+	virtual pdf* predictor() const NOT_IMPLEMENTED(NULL);
 };
 /*!
@@ -165,5 +171,6 @@
 	//! Here dt = [yt;ut] of appropriate dimensions
 	void bayes ( const vec &yt, const vec &cond = empty_vec );
-	BM* _copy_() const {
+
+	virtual KalmanFull* _copy() const {
 		KalmanFull* K = new KalmanFull;
 		K->set_parameters ( A, B, C, D, Q, R );
@@ -192,5 +199,5 @@
 public:
 	//! copy constructor
-	BM* _copy_() const {
+	virtual KalmanCh* _copy() const {
 		KalmanCh* K = new KalmanCh;
 		K->set_parameters ( A, B, C, D, Q, R );
@@ -335,5 +342,5 @@
 public:
 	//! copy constructor duplicated - calls different set_parameters
-	BM* _copy_() const {
+	EKFCh* _copy() const {
 		return new EKFCh(*this);
 	}
@@ -422,4 +429,9 @@
 	// TODO dodelat void to_setting( Setting &set ) const;
 
+	virtual double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0); 
+
+	virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL); 
+
+	virtual pdf* predictor() const NOT_IMPLEMENTED(NULL); 
 };
 
Index: library/bdm/estim/arx.cpp
===================================================================
--- library/bdm/estim/arx.cpp (revision 741)
+++ library/bdm/estim/arx.cpp (revision 766)
@@ -78,5 +78,5 @@
 }
 
-ARX* ARX::_copy_ ( ) const {
+ARX* ARX::_copy ( ) const {
 	ARX* Tmp = new ARX ( *this );
 	return Tmp;
Index: library/bdm/estim/particles.h
===================================================================
--- library/bdm/estim/particles.h (revision 744)
+++ library/bdm/estim/particles.h (revision 766)
@@ -203,4 +203,10 @@
 		return _samples;
 	}
+
+	virtual double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0);
+
+	virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL);
+	
+	virtual pdf* predictor() const NOT_IMPLEMENTED(NULL);
 };
 UIREGISTER ( PF );
@@ -242,13 +248,7 @@
 		void qbounds ( vec &lb, vec &ub, double perc = 0.95 ) const;
 
-		vec sample() const {
-			bdm_error ( "Not implemented" );
-			return vec();
-		}
-
-		double evallog ( const vec &val ) const {
-			bdm_error ( "not implemented" );
-			return 0.0;
-		}
+		vec sample() const NOT_IMPLEMENTED(0);
+
+		double evallog ( const vec &val ) const NOT_IMPLEMENTED(0);		
 	};
 
@@ -282,9 +282,10 @@
 		//BMcond0 .condition ( pf->posterior()._sample ( 0 ) );
 		for ( int i = 0; i < n; i++ ) {
-			BMs ( i ) = BMcond0._copy_();
+			BMs ( i ) = (BM*) BMcond0._copy();
 		}
 	};
 
 	void bayes ( const vec &yt, const vec &cond );
+
 	const epdf& posterior() const {
 		return jest;
@@ -301,4 +302,12 @@
 	}
 	PF& _pf() {return *pf;}
+
+
+	virtual double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0); 
+		
+	virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL); 
+	
+	virtual pdf* predictor() const NOT_IMPLEMENTED(NULL); 
+
 
 	/*! configuration structure for basic PF
@@ -315,5 +324,4 @@
 	void from_setting ( const Setting &set ) {
 		shared_ptr<pdf> par = UI::build<pdf> ( set, "parameter_pdf", UI::compulsory );
-		shared_ptr<pdf> obs = new pdf(); // not used!!
 
 		pf = new PF;
@@ -321,5 +329,5 @@
 		pf->prior_from_set ( set );
 		pf->resmethod_from_set ( set );
-		pf->set_model ( par, obs );
+		pf->set_model ( par, par ); // too hackish!
 
 		shared_ptr<BM> BM0 = UI::build<BM> ( set, "BM", UI::compulsory );
@@ -340,8 +348,9 @@
 		validate();
 	}
+
 	void validate() {
 		try {
 			pf->validate();
-		} catch ( std::exception &e ) {
+		} catch ( std::exception ) {
 			throw UIException ( "Error in PF part of MPF:" );
 		}
@@ -351,5 +360,4 @@
 		pf2bm.set_connection ( BMs ( 0 )->_rvc(), pf->posterior()._rv() );
 	}
-
 };
 UIREGISTER ( MPF );
Index: library/bdm/math/chmat.h
===================================================================
--- library/bdm/math/chmat.h (revision 738)
+++ library/bdm/math/chmat.h (revision 766)
@@ -77,7 +77,5 @@
 	  it shouldn't actually be called.
 	*/
-	chmat ( const chmat &M, const ivec &perm ) {
-		bdm_error ( "not implemented" );
-	}
+	chmat ( const chmat &M, const ivec &perm ) NOT_IMPLEMENTED_VOID;
 
 	//! Access function
Index: library/bdm/math/square_mat.h
===================================================================
--- library/bdm/math/square_mat.h (revision 737)
+++ library/bdm/math/square_mat.h (revision 766)
@@ -42,30 +42,19 @@
 	 BLAS-2b operation.
 	 */
-	virtual void opupdt ( const vec &v, double w ) {
-		bdm_error ( "not implemented" );
-	};
+	virtual void opupdt ( const vec &v, double w ) = 0;
 
 	/*! \brief Conversion to full matrix.
 	*/
-
-	virtual mat to_mat() const {
-		bdm_error ( "not implemented" );
-		return mat ( 0, 0 );
-	}
+	virtual mat to_mat() const = 0;
 
 	/*! \brief Inplace symmetric multiplication by a SQUARE matrix \f$C\f$, i.e. \f$V = C*V*C'\f$
 	@param C multiplying matrix,
 	*/
-	virtual void mult_sym ( const mat &C ) {
-		bdm_error ( "not implemented" );
-	};
+	virtual void mult_sym ( const mat &C ) = 0;
 
 	/*! \brief Inplace symmetric multiplication by a SQUARE transpose of matrix \f$C\f$, i.e. \f$V = C'*V*C\f$
 	@param C multiplying matrix,
 	*/
-	virtual void mult_sym_t ( const mat &C ) {
-		bdm_error ( "not implemented" );
-	}
-
+	virtual void mult_sym_t ( const mat &C ) = 0;
 
 	/*!
@@ -73,8 +62,5 @@
 
 	*/
-	virtual double logdet() const {
-		bdm_error ( "not implemented" );
-		return 0;
-	};
+	virtual double logdet() const = 0;
 
 	/*!
@@ -83,8 +69,5 @@
 	Used e.g. in generating normal samples.
 	*/
-	virtual vec sqrt_mult ( const vec &v )  const {
-		bdm_error ( "not implemented" );
-		return vec ( 0 );
-	};
+	virtual vec sqrt_mult ( const vec &v )  const = 0;
 
 	/*!
@@ -92,8 +75,5 @@
 
 	*/
-	virtual double qform ( const vec &v ) const {
-		bdm_error ( "not implemented" );
-		return 0;
-	};
+	virtual double qform ( const vec &v ) const = 0;
 
 	/*!
@@ -101,8 +81,5 @@
 
 	*/
-	virtual double invqform ( const vec &v ) const {
-		bdm_error ( "not implemented" );
-		return 0;
-	};
+	virtual double invqform ( const vec &v ) const = 0;
 
 //	//! easy version of the
@@ -110,7 +87,5 @@
 
 	//! Clearing matrix so that it corresponds to zeros.
-	virtual void clear() {
-		bdm_error ( "not implemented" );
-	};
+	virtual void clear() = 0;
 
 	//! Reimplementing common functions of mat: cols().
Index: library/bdm/mex/mex_datasource.h
===================================================================
--- library/bdm/mex/mex_datasource.h (revision 737)
+++ library/bdm/mex/mex_datasource.h (revision 766)
@@ -117,4 +117,9 @@
 	}
 
+	virtual void getdata ( vec &dt, const ivec &indeces ) NOT_IMPLEMENTED_VOID;
+
+	virtual void write ( const vec &ut, const ivec &indeces ) NOT_IMPLEMENTED_VOID;
+
+
 	void step() {
 		mxArray* tmp;
Index: library/bdm/mex/mex_BM.h
===================================================================
--- library/bdm/mex/mex_BM.h (revision 756)
+++ library/bdm/mex/mex_BM.h (revision 766)
@@ -38,4 +38,10 @@
 		return mxArray2vec ( tmp );
 	}
+
+	virtual vec sample() const NOT_IMPLEMENTED(0);
+
+	virtual double evallog ( const vec &val ) const NOT_IMPLEMENTED(0);
+	
+	virtual vec variance() const NOT_IMPLEMENTED(0);
 };
 UIREGISTER ( mexEpdf );
@@ -92,4 +98,10 @@
 		return est;
 	} //tohle by melo zustat!!
+
+	virtual double logpred ( const vec &yt ) const  NOT_IMPLEMENTED(0);
+
+	virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL);
+
+	virtual pdf* predictor() const NOT_IMPLEMENTED(NULL);
 };
 UIREGISTER ( mexBM );
Index: library/bdm/bdmroot.h
===================================================================
--- library/bdm/bdmroot.h (revision 756)
+++ library/bdm/bdmroot.h (revision 766)
@@ -19,4 +19,5 @@
 #include "itpp_ext.h"
 #include "base/libconfig/lib/libconfig.h++"
+#include "bdmerror.h"
 
 using namespace libconfig;
@@ -94,4 +95,9 @@
 	virtual void validate() {
 	}
+
+	//! Virtual method providing deep copy of instances
+	virtual root* _copy() const NOT_IMPLEMENTED(NULL);
+	
+
 	//! access function
 	int _log_level() const {
Index: library/bdm/bdmerror.h
===================================================================
--- library/bdm/bdmerror.h (revision 737)
+++ library/bdm/bdmerror.h (revision 766)
@@ -64,4 +64,7 @@
 	} else ((void) 0)
 
+#define NOT_IMPLEMENTED(RESULT) { bdm_error( "Not implemented" ); return RESULT; }
+
+#define NOT_IMPLEMENTED_VOID { bdm_error( "Not implemented" ); }
+
 #endif
-
Index: library/bdm/base/bdmbase.h
===================================================================
--- library/bdm/base/bdmbase.h (revision 760)
+++ library/bdm/base/bdmbase.h (revision 766)
@@ -108,6 +108,9 @@
 
 	//! auxiliary function used in constructor
-	void init ( const Array<std::string> &in_names, const ivec &in_sizes, const ivec &in_times );
-	int init ( const string &name, int size );
+	void init( const Array<std::string> &in_names, const ivec &in_sizes, const ivec &in_times );
+
+	//! auxiliary function assigning unique integer index related to the passed name and size of the random variable
+	int assign_id( const string &name, int size );
+
 	//! Private constructor from IDs, potentially dangerous since all ids must be valid!
 	//! dummy is there to prevent confusion with RV(" string");
@@ -319,21 +322,14 @@
 
 	//! log this vector
-	virtual void log_vector ( int id, const vec &v ) {
-		bdm_error ( "Not implemented" );
-	};
+	virtual void log_vector ( int id, const vec &v ) = 0;
 
 	virtual Setting & log_to_setting ( int id ) {
 		return settings ( id )->add ( Setting::TypeGroup );
 	}
-
 	//! log this double
-	virtual void logit ( int id, const double &d ) {
-		bdm_error ( "Not implemented" );
-	};
+	virtual void logit ( int id, const double &d ) = 0;
 
 	//! Shifts storage position for another time step.
-	virtual void step() {
-		bdm_error ( "Not implemneted" );
-	};
+	virtual void step() = 0;
 
 	//! Finalize storing information
@@ -385,4 +381,5 @@
 	//!dimension of the condition
 	int dimc;
+
 	//! random variable in condition
 	RV rvc;
@@ -402,8 +399,4 @@
 	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 pdf* _copy_() const {
-		return new pdf ( *this );
-	}
 	//!@}
 
@@ -412,8 +405,5 @@
 
 	//! Returns a sample from the density conditioned on \c cond, \f$x \sim epdf(rv|cond)\f$. \param cond is numeric value of \c rv
-	virtual vec samplecond ( const vec &cond ) {
-		bdm_error ( "Not implemented" );
-		return vec();
-	}
+	virtual vec samplecond ( const vec &cond ) = 0;
 
 	//! Returns \param N samples from the density conditioned on \c cond, \f$x \sim epdf(rv|cond)\f$. \param cond is numeric value of \c rv
@@ -421,8 +411,5 @@
 
 	//! Shortcut for conditioning and evaluation of the internal epdf. In some cases,  this operation can be implemented efficiently.
-	virtual double evallogcond ( const vec &yt, const vec &cond ) {
-		bdm_error ( "Not implemented" );
-		return 0.0;
-	}
+	virtual double evallogcond ( const vec &yt, const vec &cond ) = 0;
 
 	//! Matrix version of evallogcond
@@ -521,7 +508,4 @@
 	}
 	
-	epdf* _copy_() const {
-		return new epdf ( *this );
-	}
 	//!@}
 
@@ -530,8 +514,5 @@
 
 	//! Returns a sample, \f$ x \f$ from density \f$ f_x()\f$
-	virtual vec sample() const {
-		bdm_error ( "not implemented" );
-		return vec();
-	}
+	virtual vec sample() const = 0;
 
 	//! Returns N samples, \f$ [x_1 , x_2 , \ldots \ \f$  from density \f$ f_x(rv)\f$
@@ -540,9 +521,6 @@
 	//! Compute log-probability of argument \c val
 	//! In case the argument is out of suport return -Infinity
-	virtual double evallog ( const vec &val ) const {
-		bdm_error ( "not implemented" );
-		return 0.0;
-	}
-
+	virtual double evallog ( const vec &val ) const = 0;
+	
 	//! Compute log-probability of multiple values argument \c val
 	virtual vec evallog_mat ( const mat &Val ) const;
@@ -557,15 +535,8 @@
 	virtual shared_ptr<epdf> marginal ( const RV &rv ) const;
 
-	//! return expected value
-	virtual vec mean() const {
-		bdm_error ( "not implemneted" );
-		return vec();
-	}
+	virtual vec mean() const = 0;
 
 	//! return expected variance (not covariance!)
-	virtual vec variance() const {
-		bdm_error ( "not implemneted" );
-		return vec();
-	}
+	virtual vec variance() const = 0;
 
 	//! Lower and upper bounds of \c percentage % quantile, returns mean-2*sigma as default
@@ -639,7 +610,5 @@
 	//! 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 ) {
-		bdm_error ( "Not implemented" );
-	}
+	virtual void condition ( const vec &cond ) = 0;
 
 	//!access function to iepdf
@@ -942,26 +911,17 @@
 	}
 	//! Returns full vector of observed data=[output, input]
-	virtual void getdata ( vec &dt ) const {
-		bdm_error ( "abstract class" );
-	}
+	virtual void getdata ( vec &dt ) const = 0;
+
 	//! Returns data records at indeces.
-	virtual void getdata ( vec &dt, const ivec &indeces ) {
-		bdm_error ( "abstract class" );
-	}
-
-	//! Accepts action variable and schedule it for application.
-	virtual void write ( const vec &ut ) {
-		bdm_error ( "abstract class" );
-	}
+	virtual void getdata ( vec &dt, const ivec &indeces ) = 0;
+
+	//! Accepts action variable and schedule it for application.	
+	virtual void write ( const vec &ut ) = 0;
 
 	//! Accepts action variables at specific indeces
-	virtual void write ( const vec &ut, const ivec &indeces ) {
-		bdm_error ( "abstract class" );
-	}
+	virtual void write ( const vec &ut, const ivec &indeces ) = 0;
 
 	//! Moves from \f$ t \f$ to \f$ t+1 \f$, i.e. perfroms the actions and reads response of the system.
-	virtual void step() {
-		bdm_error ( "abstract class" );
-	}
+	virtual void step() = 0;
 
 	//! Register DS for logging into logger L
@@ -1033,8 +993,6 @@
 //	BM ( const BM &B ) :  yrv ( B.yrv ), dimy(B.dimy), rvc ( B.rvc ),dimc(B.dimc), ll ( B.ll ), evalll ( B.evalll ) {}
 	//! \brief Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually!
-	//! Prototype: \code BM* _copy_() const {return new BM(*this);} \endcode
-	virtual BM* _copy_() const {
-		return NULL;
-	};
+	//! Prototype: \code BM* _copy() const {return new BM(*this);} \endcode
+	virtual BM* _copy() const { 		return NULL; 	}; // TODO NEBUDE TU TAKY LEPSI BDM_ERROR??!
 	//!@}
 
@@ -1054,8 +1012,5 @@
 	//! This function evaluates only \f$ y_t \f$, condition is assumed to be the last used in bayes().
 	//! See bdm::BM::predictor for conditional version.
-	virtual double logpred ( const vec &yt ) const {
-		bdm_error ( "Not implemented" );
-		return 0.0;
-	}
+	virtual double logpred ( const vec &yt ) const = 0;
 
 	//! Matrix version of logpred
@@ -1069,13 +1024,9 @@
 
 	//!Constructs a predictive density \f$ f(d_{t+1} |d_{t}, \ldots d_{0}) \f$
-	virtual epdf* epredictor() const {
-		bdm_error ( "Not implemented" );
-		return NULL;
-	};
+	virtual epdf* epredictor() const = 0;
+
 	//!Constructs conditional density of 1-step ahead predictor \f$ f(d_{t+1} |d_{t+h-1}, \ldots d_{t}) \f$
-	virtual pdf* predictor() const {
-		bdm_error ( "Not implemented" );
-		return NULL;
-	};
+	virtual pdf* predictor() const = 0;
+
 	//!@}
 
Index: library/bdm/base/datasources.h
===================================================================
--- library/bdm/base/datasources.h (revision 738)
+++ library/bdm/base/datasources.h (revision 766)
@@ -129,4 +129,10 @@
 	}
 
+	//! Accepts action variable and schedule it for application.	
+	virtual void write ( const vec &ut ) NOT_IMPLEMENTED_VOID;
+		
+	//! Accepts action variables at specific indeces
+	virtual void write ( const vec &ut, const ivec &indeces ) NOT_IMPLEMENTED_VOID;
+
 	/*!
 	\code
@@ -182,4 +188,9 @@
 	}
 
+
+	//! Returns data records at indeces.
+	virtual void getdata ( vec &dt, const ivec &indeces ) NOT_IMPLEMENTED_VOID;
+
+
 	/*!
 	\code
@@ -353,4 +364,6 @@
 	}
 
+	virtual void write ( const vec &ut, const ivec &indeces ) NOT_IMPLEMENTED_VOID;
+
 	/*! UI for stateDS
 
Index: library/bdm/base/loggers.cpp
===================================================================
--- library/bdm/base/loggers.cpp (revision 737)
+++ library/bdm/base/loggers.cpp (revision 766)
@@ -48,5 +48,4 @@
 
 void memlog::from_setting ( const Setting &set ) {
-	// TODO tady se natvrdo ocekava existence stringu, nejsou zadne defaulty.. je to tak OK?
 	UI::get ( maxlen,  set, "maxlen", UI::compulsory );
 	UI::get ( filename, set, "filename" );
@@ -174,5 +173,4 @@
 
 void dirfilelog::from_setting ( const Setting &set ) {
-	// TODO tady se natvrdo ocekava existence stringu, nejsou zadne defaulty.. je to tak OK?
 	dirname = ( const char* ) set["dirname"];
 	maxlen = set["maxlen"];
Index: library/bdm/base/loggers.h
===================================================================
--- library/bdm/base/loggers.h (revision 737)
+++ library/bdm/base/loggers.h (revision 766)
@@ -78,6 +78,4 @@
 	/*! \brief UI for memlog
 
-	TODO dat tam kam patri, a to celej blok
-
 	\code
 	logger = {
@@ -130,6 +128,4 @@
 	/*! \brief UI for stdlog
 
-	TODO dat tam kam patri, a to celej blok
-
 	\code
 	logger = {
@@ -140,5 +136,4 @@
 	void from_setting ( const Setting &set ) {
 	}
-
 };
 UIREGISTER ( stdlog );
Index: library/bdm/base/bdmbase.cpp
===================================================================
--- library/bdm/base/bdmbase.cpp (revision 746)
+++ library/bdm/base/bdmbase.cpp (revision 766)
@@ -27,5 +27,5 @@
 };
 
-int RV::init ( const string &name, int size ) {
+int RV::assign_id( const string &name, int size ) {
 	//Refer
 	int id;
@@ -86,5 +86,5 @@
 	int id;
 	for ( int i = 0; i < len; i++ ) {
-		id = init ( in_names ( i ), in_sizes ( i ) );
+		id = assign_id ( in_names ( i ), in_sizes ( i ) );
 		ids ( i ) = id;
 	}
@@ -100,5 +100,4 @@
 
 bool RV::add ( const RV &rv2 ) {
-	// TODO
 	if ( rv2.len > 0 ) { //rv2 is nonempty
 		ivec ind = rv2.findself ( *this ); //should be -1 all the time
@@ -146,13 +145,8 @@
 }
 
-shared_ptr<pdf> epdf::condition ( const RV &rv ) const {
-	bdm_warning ( "Not implemented" );
-	return shared_ptr<pdf>();
-}
-
-shared_ptr<epdf> epdf::marginal ( const RV &rv ) const {
-	bdm_warning ( "Not implemented" );
-	return shared_ptr<epdf>();
-}
+shared_ptr<pdf> epdf::condition ( const RV &rv ) const NOT_IMPLEMENTED( shared_ptr<pdf>() );
+
+
+shared_ptr<epdf> epdf::marginal ( const RV &rv ) const NOT_IMPLEMENTED( shared_ptr<epdf>() );
 
 mat epdf::sample_mat ( int N ) const {
Index: library/bdm/stat/discrete.cpp
===================================================================
--- library/bdm/stat/discrete.cpp (revision 760)
+++ library/bdm/stat/discrete.cpp (revision 766)
@@ -81,5 +81,5 @@
 				inds ( j ) = gridsizes ( j ) - 1;
 			else {
-				inds ( j ) = ::round ( val ( j ) - ranges ( j ) ( 0 ) / steps ( j ) );
+				inds ( j ) = (int) ::round ( val ( j ) - ranges ( j ) ( 0 ) / steps ( j ) );
 			}
 		}
Index: library/bdm/stat/emix.cpp
===================================================================
--- library/bdm/stat/emix.cpp (revision 760)
+++ library/bdm/stat/emix.cpp (revision 766)
@@ -3,29 +3,33 @@
 namespace bdm {
 
-void emix::set_parameters ( const vec &w0, const Array<shared_ptr<epdf> > &Coms0 ) {
-	w = w0 / sum ( w0 );
-	
-	bool isnamed = Coms0 ( 0 )->isnamed();
-	RV tmp_rv;
-	if ( isnamed ) tmp_rv = Coms0 ( 0 )->_rv();
-	Coms = Coms0;
-
-	if ( isnamed ) epdf::set_rv ( tmp_rv ); //coms aer already OK, no need for set_rv
-}
-
 void emix::validate (){
-	dim = Coms ( 0 )->dimension();
-	bool isnamed = Coms ( 0 )->isnamed();
-	int i;
-	RV tmp_rv;
-	if ( isnamed ) tmp_rv = Coms ( 0 )->_rv();
-	for ( i = 0; i < w.length(); i++ ) {
+	bdm_assert ( Coms.length() > 0, "There has to be at least one component." );
+
+	bdm_assert ( Coms.length() == w.length(), "It is obligatory to define weights of all the components." );
+
+	double sum_w = sum ( w );
+	bdm_assert ( sum_w != 0, "There has to be a component with non-zero weight." );
+	w = w / sum_w;
+
+	int dim = Coms ( 0 )->dimension();
+	for ( int i = 1; i < Coms.length(); i++ ) {
 		bdm_assert ( dim == ( Coms ( i )->dimension() ), "Component sizes do not match!" );
-		bdm_assert ( !isnamed || tmp_rv.equal ( Coms ( i )->_rv() ), "Component RVs do not match!" );
-	}
-
-}
-
-
+		bdm_assert ( Coms(i)->isnamed() , "An unnamed component is forbidden here!" );
+	}
+
+	set_rv ( Coms ( 0 )->_rv() ); 
+}
+
+void emix::from_setting ( const Setting &set ) {
+	UI::get ( Coms, set, "pdfs", UI::compulsory );
+
+	if ( !UI::get ( w, set, "weights", UI::optional ) ) {
+		int len = Coms.length();
+		w.set_length ( len );
+		w = 1.0 / len;
+	}
+
+	validate();
+}
 
 
@@ -109,5 +113,6 @@
 	}
 
-	target.set_parameters ( w, Cn );
+	target._w() = w;
+	target._Coms() = Cn;
 	target.validate();
 }
@@ -190,5 +195,6 @@
 	}
 
-	target.set_parameters ( w, Cn );
+	target._w() = w;
+	target._Coms() = Cn;
 	target.validate();
 }
@@ -313,4 +319,36 @@
 		dls ( i ) = new datalink_m2m;
 		dls ( i )->set_connection ( pdfs ( i )->_rv(), pdfs ( i )->_rvc(), _rv(), _rvc() );
+	}
+}
+
+void mmix::validate()
+{	
+	bdm_assert ( Coms.length() > 0, "There has to be at least one component." );
+
+	bdm_assert ( Coms.length() == w.length(), "It is obligatory to define weights of all the components." );
+
+	double sum_w = sum ( w );
+	bdm_assert ( sum_w != 0, "There has to be a component with non-zero weight." );
+	w = w / sum_w;
+
+	int dim = Coms ( 0 )->dimension();
+	int dimc = Coms ( 0 )->dimensionc();
+	for ( int i = 1; i < Coms.length(); i++ ) {
+		bdm_assert ( dim == ( Coms ( i )->dimension() ), "Component sizes do not match!" );
+		bdm_assert ( dimc == ( Coms ( i )->dimensionc() ), "Component sizes do not match!" );
+		bdm_assert ( Coms(i)->isnamed() , "An unnamed component is forbidden here!" );
+	}
+
+	set_rv ( Coms ( 0 )->_rv() );
+	set_rvc ( Coms ( 0 )->_rvc() );
+}
+
+void mmix::from_setting ( const Setting &set ) {
+	UI::get ( Coms, set, "pdfs", UI::compulsory );
+
+	if ( !UI::get ( w, set, "weights", UI::optional ) ) {
+		int len = Coms.length();
+		w.set_length ( len );
+		w = 1.0 / len;
 	}
 }
Index: library/bdm/stat/exp_family.h
===================================================================
--- library/bdm/stat/exp_family.h (revision 763)
+++ library/bdm/stat/exp_family.h (revision 766)
@@ -44,8 +44,5 @@
 
 	//!Evaluate normalized log-probability
-	virtual double evallog_nn ( const vec &val ) const {
-		bdm_error ( "Not implemented" );
-		return 0.0;
-	}
+	virtual double evallog_nn ( const vec &val ) const NOT_IMPLEMENTED(0);
 
 	//!Evaluate normalized log-probability
@@ -73,7 +70,5 @@
 
 	//!Power of the density, used e.g. to flatten the density
-	virtual void pow ( double p ) {
-		bdm_error ( "Not implemented" );
-	}
+	virtual void pow ( double p ) NOT_IMPLEMENTED_VOID;
 };
 
@@ -92,7 +87,5 @@
 	BMEF ( const BMEF &B ) : BM ( B ), frg ( B.frg ), last_lognc ( B.last_lognc ) {}
 	//!get statistics from another model
-	virtual void set_statistics ( const BMEF* BM0 ) {
-		bdm_error ( "Not implemented" );
-	}
+	virtual void set_statistics ( const BMEF* BM0 ) NOT_IMPLEMENTED_VOID;
 
 	//! Weighted update of sufficient statistics (Bayes rule)
@@ -102,17 +95,16 @@
 
 	//!Flatten the posterior according to the given BMEF (of the same type!)
-	virtual void flatten ( const BMEF * B ) {
-		bdm_error ( "Not implemented" );
-	}
-
-	BMEF* _copy_ () const {
-		bdm_error ( "function _copy_ not implemented for this BM" );
-		return NULL;
-	}
+	virtual void flatten ( const BMEF * B ) NOT_IMPLEMENTED_VOID;
+
+	double logpred ( const vec &yt ) const NOT_IMPLEMENTED(0);
+	
+	virtual epdf* epredictor() const NOT_IMPLEMENTED(NULL);
+
+	virtual pdf* predictor() const NOT_IMPLEMENTED(NULL);
 
 	void to_setting ( Setting &set ) const
 	{			
 		BM::to_setting( set );
-		// TODO DOPLNIT? CHYBI FROM_SETTING PRO INSPIRACI
+		// TODO DOPLNIT? ALE MOMENTALNE CHYBI FROM_SETTING PRO INSPIRACI
 	} 
 };
@@ -1112,4 +1104,5 @@
 	//! Constructor
 	migamma_ref () : migamma (), refl () {};
+	
 	//! Set value of \c k
 	void set_parameters ( double k0 , vec ref0, double l0 ) {
@@ -1266,15 +1259,26 @@
 		return X*Y._Ch();// return upper triangular part of the decomposition
 	}
+
 	vec sample () const {
 		return vec ( sample_mat()._data(), p*p );
 	}
+
+	virtual vec mean() const NOT_IMPLEMENTED(0);
+
+	//! return expected variance (not covariance!)
+	virtual vec variance() const NOT_IMPLEMENTED(0);
+
+	virtual double evallog ( const vec &val ) const NOT_IMPLEMENTED(0);
+
 	//! fast access function y0 will be copied into Y.Ch.
 	void setY ( const mat &Ch0 ) {
 		copy_vector ( dim, Ch0._data(), Y._Ch()._data() );
 	}
+
 	//! fast access function y0 will be copied into Y.Ch.
 	void _setY ( const vec &ch0 ) {
 		copy_vector ( dim, ch0._data(), Y._Ch()._data() );
 	}
+
 	//! access function
 	const chmat& getY() const {
@@ -1321,4 +1325,5 @@
 		W.setY ( iCh );
 	}
+
 	virtual double evallog ( const vec &val ) const {
 		chmat X ( p );
@@ -1345,4 +1350,8 @@
 	};
 
+	virtual vec mean() const NOT_IMPLEMENTED(0);
+
+	//! return expected variance (not covariance!)
+	virtual vec variance() const NOT_IMPLEMENTED(0);
 };
 
@@ -1464,14 +1473,8 @@
 
 	//! inherited operation : NOT implemented
-	vec sample() const {
-		bdm_error ( "Not implemented" );
-		return vec();
-	}
+	vec sample() const NOT_IMPLEMENTED(0);
 
 	//! inherited operation : NOT implemented
-	double evallog ( const vec &val ) const {
-		bdm_error ( "Not implemented" );
-		return 0.0;
-	}
+	double evallog ( const vec &val ) const NOT_IMPLEMENTED(0);
 
 	vec mean() const {
Index: library/bdm/stat/merger.h
===================================================================
--- library/bdm/stat/merger.h (revision 763)
+++ library/bdm/stat/merger.h (revision 766)
@@ -148,4 +148,10 @@
 
 	vec variance() const;
+
+	//! Compute log-probability of argument \c val
+	virtual double evallog ( const vec &val ) const NOT_IMPLEMENTED(0);
+
+	//! Returns a sample, \f$ x \f$ from density \f$ f_x()\f$
+	virtual vec sample() const NOT_IMPLEMENTED(0);
 
 	//!@}
Index: library/bdm/stat/emix.h
===================================================================
--- library/bdm/stat/emix.h (revision 750)
+++ library/bdm/stat/emix.h (revision 766)
@@ -53,5 +53,5 @@
 		// adjust rv and rvc
 
-		set_rv ( rv ); // TODO co kdyby tohle samo uz nastavovalo dimension?!?!
+		set_rv ( rv ); 
 		dim = rv._dsize();
 
@@ -81,4 +81,8 @@
 		return tmp;
 	}
+
+	//! Returns a sample from the density conditioned on \c cond, \f$x \sim epdf(rv|cond)\f$. \param cond is numeric value of \c rv
+	virtual vec samplecond ( const vec &cond ) NOT_IMPLEMENTED(0);
+
 	//! Object takes ownership of nom and will destroy it
 	void ownnom() {
@@ -91,4 +95,7 @@
 		}
 	}
+
+
+
 
 private:
@@ -120,12 +127,4 @@
 	emix ( ) : epdf ( ) { }
 
-	/*!
-	  \brief Set weights \c w and components \c Coms
-
-	  Shared pointers in Coms are kept inside this instance and
-	  shouldn't be modified after being passed to this method.
-	*/
-	void set_parameters ( const vec &w, const Array<shared_ptr<epdf> > &Coms );
-    
 	virtual void validate ();
 
@@ -148,11 +147,21 @@
 	shared_ptr<pdf> condition ( const RV &rv ) const;
 
-	//Access methods
-	//! returns a pointer to the internal mean value. Use with Care!
+	//Access methods	
+	//! returns a reference to the internal weights. Use with Care!
 	vec& _w() {
 		return w;
 	}
 
-	//!access function
+	/*!
+	  \brief returns a reference to the internal array of components. Use with Care! Set components \c Coms
+
+	  Shared pointers in Coms are kept inside this instance and
+	  shouldn't be modified after being passed to this method.
+	*/
+	Array<shared_ptr<epdf>>& _Coms ( ) {
+		return Coms;
+	}
+
+	//! returns a reference to the internal components specified by index i. Use with Care!
 	shared_ptr<epdf> _Coms ( int i ) {
 		return Coms ( i );
@@ -174,21 +183,5 @@
 	//! \endcode
 	//!@}
-	void from_setting ( const Setting &set ) {
-
-		vec w0;
-		Array<shared_ptr<epdf> > Coms0;
-
-		UI::get ( Coms0, set, "pdfs", UI::compulsory );
-
-		if ( !UI::get ( w0, set, "weights", UI::optional ) ) {
-			int len = Coms.length();
-			w0.set_length ( len );
-			w0 = 1.0 / len;
-		}
-
-		// TODO asi lze nacitat primocare do w a coms, jen co bude hotovy validate()
-		set_parameters ( w0, Coms0 );
-		validate();
-	}
+	void from_setting ( const Setting &set );
 };
 SHAREDPTR ( emix );
@@ -284,8 +277,4 @@
 	//! Data link for each pdfs
 	Array<shared_ptr<datalink_m2m> > dls;
-
-protected:
-	//! dummy epdf used only as storage for RV and dim
-	epdf iepdf;
 
 public:
@@ -330,7 +319,7 @@
 	//!@}
 	void from_setting ( const Setting &set ) {
-		Array<shared_ptr<pdf> > atmp; //temporary Array
-		UI::get ( atmp, set, "pdfs", UI::compulsory );
-		set_elements ( atmp );
+		Array<shared_ptr<pdf> > temp_array; 
+		UI::get ( temp_array, set, "pdfs", UI::compulsory );
+		set_elements ( temp_array );
 	}
 };
@@ -418,17 +407,4 @@
 	mmix() : Coms ( 0 ) { }
 
-	//! Set weights \c w and components \c R
-	void set_parameters ( const vec &w0, const Array<shared_ptr<pdf> > &Coms0 ) {
-		//!\todo check if all components are OK
-		Coms = Coms0;
-		w = w0;
-
-		if ( Coms0.length() > 0 ) {
-			set_rv ( Coms ( 0 )->_rv() );
-			dim = rv._dsize();
-			set_rvc ( Coms ( 0 )->_rvc() );
-			dimc = rvc._dsize();
-		}
-	}
 	double evallogcond ( const vec &dt, const vec &cond ) {
 		double ll = 0.0;
@@ -449,21 +425,7 @@
 	//! \endcode
 	//!@}
-	void from_setting ( const Setting &set ) {
-		UI::get ( Coms, set, "pdfs", UI::compulsory );
-
-		// TODO ma byt zde, ci ve validate()?
-		if ( Coms.length() > 0 ) {
-			set_rv ( Coms ( 0 )->_rv() );
-			dim = rv._dsize();
-			set_rvc ( Coms ( 0 )->_rvc() );
-			dimc = rvc._dsize();
-		}
-
-		if ( !UI::get ( w, set, "weights", UI::optional ) ) {
-			int len = Coms.length();
-			w.set_length ( len );
-			w = 1.0 / len;
-		}
-	}
+	void from_setting ( const Setting &set );
+
+	virtual void validate();
 };
 SHAREDPTR ( mmix );
Index: library/bdm/itpp_ext.cpp
===================================================================
--- library/bdm/itpp_ext.cpp (revision 737)
+++ library/bdm/itpp_ext.cpp (revision 766)
@@ -359,5 +359,5 @@
 	}
 	if ( xa == ( int ) xa ) {
-		n = xa;
+		n = (int) xa;
 		for ( k = 1; k < n; k++ ) {
 			s += 1.0 / k;
@@ -365,5 +365,5 @@
 		ps =  s - el;
 	} else if ( ( xa + 0.5 ) == ( ( int ) ( xa + 0.5 ) ) ) {
-		n = xa - 0.5;
+		n = (int) (xa - 0.5);
 		for ( k = 1; k <= n; k++ ) {
 			s += 1.0 / ( 2.0 * k - 1.0 );
@@ -410,5 +410,5 @@
 	//! generate randun() sample
 	double get() {
-		long long tmp = A * seed;
+		long tmp = (long) (A * seed);
 		tmp = tmp % M;
 		seed = tmp;
Index: library/tests/testsuite/emix_test.cpp
===================================================================
--- library/tests/testsuite/emix_test.cpp (revision 750)
+++ library/tests/testsuite/emix_test.cpp (revision 766)
@@ -38,5 +38,6 @@
 	emix M1;
 	M1.set_rv ( xy );
-	M1.set_parameters ( vec ( "1" ), A1 );
+	M1._Coms() = A1;
+	M1._w() = 1;
 	M1.validate();
 
@@ -68,5 +69,6 @@
 	emix M2;
 	M2.set_rv ( xy );
-	M2.set_parameters ( vec ( "1" ), A2 );
+	M2._Coms() = A2;
+	M2._w() = 1;
 	M2.validate();
 
Index: library/tests/testsuite/square_mat_test.cpp
===================================================================
--- library/tests/testsuite/square_mat_test.cpp (revision 717)
+++ library/tests/testsuite/square_mat_test.cpp (revision 766)
@@ -20,67 +20,67 @@
 	mat A = A0 * A0.T();
 
-	TMatrix sqmat ( A );
-	CHECK_EQUAL ( sz, sqmat.rows() );
-	CHECK_EQUAL ( sz, sqmat.cols() );
+	TMatrix sq_mat ( A );
+	CHECK_EQUAL ( sz, sq_mat.rows() );
+	CHECK_EQUAL ( sz, sq_mat.cols() );
 
-	mat res = sqmat.to_mat();
+	mat res = sq_mat.to_mat();
 	CHECK_CLOSE ( A, res, epsilon );
 
 	vec v = randu ( sz );
 	double w = randu();
-	TMatrix sqmat2 = sqmat;
-	sqmat2.opupdt ( v, w );
+	TMatrix sq_mat2 = sq_mat;
+	sq_mat2.opupdt ( v, w );
 
 	res = A + w * outer_product ( v, v );
-	CHECK_CLOSE ( res, sqmat2.to_mat(), epsilon );
+	CHECK_CLOSE ( res, sq_mat2.to_mat(), epsilon );
 
 	TMatrix invmat ( sz );
-	sqmat.inv ( invmat );
+	sq_mat.inv ( invmat );
 	mat invA = inv ( A );
 	CHECK_CLOSE ( invA, invmat.to_mat(), epsilon );
 
 	double d = det ( A );
-	CHECK_CLOSE ( log ( d ), sqmat.logdet(), epsilon );
+	CHECK_CLOSE ( log ( d ), sq_mat.logdet(), epsilon );
 
-	double q = sqmat.qform ( ones ( sz ) );
+	double q = sq_mat.qform ( ones ( sz ) );
 	CHECK_CLOSE ( sumsum ( A ), q, epsilon );
 
-	q = sqmat.qform ( v );
+	q = sq_mat.qform ( v );
 	double r = ( A * v ) * v;
 	CHECK_CLOSE ( r, q, epsilon );
 
-	q = sqmat.invqform ( v );
+	q = sq_mat.invqform ( v );
 	r = ( invA * v ) * v;
 	CHECK_CLOSE ( r, q, epsilon );
 
-	sqmat2 = sqmat;
-	sqmat2.clear();
-	CHECK_EQUAL ( 0, sqmat2.qform ( ones ( sz ) ) );
+	sq_mat2 = sq_mat;
+	sq_mat2.clear();
+	CHECK_EQUAL ( 0, sq_mat2.qform ( ones ( sz ) ) );
 
-	TMatrix twice = sqmat;
-	twice += sqmat;
+	TMatrix twice = sq_mat;
+	twice += sq_mat;
 	res = 2 * A;
 	CHECK_CLOSE ( res, twice.to_mat(), epsilon );
 
-	twice = sqmat;
+	twice = sq_mat;
 	twice *= 2;
 	CHECK_CLOSE ( res, twice.to_mat(), epsilon );
 
-	sqmat2 = sqmat;
+	sq_mat2 = sq_mat;
 	mat B = randu ( sz, sz );
-	sqmat2.mult_sym ( B );
+	sq_mat2.mult_sym ( B );
 	res = ( B * A ) * B.T();
-	CHECK_CLOSE ( res, sqmat2.to_mat(), epsilon );
+	CHECK_CLOSE ( res, sq_mat2.to_mat(), epsilon );
 
 	mat C = randu ( sz, sz - 1 );
 	TMatrix CAC ( sz - 1 );
-	sqmat.mult_sym_t ( C, CAC );
+	sq_mat.mult_sym_t ( C, CAC );
 	res = ( C.T() * A ) * C;
 	CHECK_CLOSE ( res, CAC.to_mat(), epsilon );
 
-	sqmat2 = sqmat;
-	sqmat2.mult_sym_t ( B );
+	sq_mat2 = sq_mat;
+	sq_mat2.mult_sym_t ( B );
 	res = ( B.T() * A ) * B;
-	CHECK_CLOSE ( res, sqmat2.to_mat(), epsilon );
+	CHECK_CLOSE ( res, sq_mat2.to_mat(), epsilon );
 }
 
Index: library/tests/stresssuite/square_mat_stress.cpp
===================================================================
--- library/tests/stresssuite/square_mat_stress.cpp (revision 717)
+++ library/tests/stresssuite/square_mat_stress.cpp (revision 766)
@@ -60,10 +60,10 @@
 
 	tt.tic();
-	TMatrix sqmat ( A );
+	TMatrix sq_mat ( A );
 	double elapsed = tt.toc();
 	cout << "ctor(" << sz << " x " << sz << "): " << elapsed << " s" << endl;
 
 	tt.tic();
-	mat res = sqmat.to_mat();
+	mat res = sq_mat.to_mat();
 	elapsed = tt.toc();
 
@@ -76,13 +76,13 @@
 	vec v = point->get_vector();
 	double w = point->get_scalar();
-	TMatrix sqmat2 = sqmat;
-
-	tt.tic();
-	sqmat2.opupdt ( v, w );
+	TMatrix sq_mat2 = sq_mat;
+
+	tt.tic();
+	sq_mat2.opupdt ( v, w );
 	elapsed = tt.toc();
 
 	if ( !fast ) {
 		mat expA = A + w * outer_product ( v, v );
-		CHECK_CLOSE ( expA, sqmat2.to_mat(), epsilon );
+		CHECK_CLOSE ( expA, sq_mat2.to_mat(), epsilon );
 	}
 
@@ -92,5 +92,5 @@
 
 	tt.tic();
-	sqmat.inv ( invmat );
+	sq_mat.inv ( invmat );
 	elapsed = tt.toc();
 
@@ -104,5 +104,5 @@
 
 	tt.tic();
-	double ld = sqmat.logdet();
+	double ld = sq_mat.logdet();
 	elapsed = tt.toc();
 
@@ -115,5 +115,5 @@
 
 	tt.tic();
-	double q = sqmat.qform ( ones ( sz ) );
+	double q = sq_mat.qform ( ones ( sz ) );
 	elapsed = tt.toc();
 
@@ -125,5 +125,5 @@
 
 	tt.tic();
-	q = sqmat.qform ( v );
+	q = sq_mat.qform ( v );
 	elapsed = tt.toc();
 
@@ -136,5 +136,5 @@
 
 	tt.tic();
-	q = sqmat.invqform ( v );
+	q = sq_mat.invqform ( v );
 	elapsed = tt.toc();
 
@@ -146,8 +146,8 @@
 	cout << "invqform: " << elapsed << " s" << endl;
 
-	TMatrix twice = sqmat;
-
-	tt.tic();
-	twice += sqmat;
+	TMatrix twice = sq_mat;
+
+	tt.tic();
+	twice += sq_mat;
 	elapsed = tt.toc();
 
@@ -159,13 +159,13 @@
 	cout << "+=: " << elapsed << " s" << endl;
 
-	sqmat2 = sqmat;
-
-	tt.tic();
-	sqmat2.mult_sym ( A );
+	sq_mat2 = sq_mat;
+
+	tt.tic();
+	sq_mat2.mult_sym ( A );
 	elapsed = tt.toc();
 
 	if ( !fast ) {
 		res = ( A * A ) * A.T();
-		CHECK_CLOSE ( res, sqmat2.to_mat(), epsilon );
+		CHECK_CLOSE ( res, sq_mat2.to_mat(), epsilon );
 	}
 
Index: library/tests/stresssuite/mixtures_stress.cpp
===================================================================
--- library/tests/stresssuite/mixtures_stress.cpp (revision 750)
+++ library/tests/stresssuite/mixtures_stress.cpp (revision 766)
@@ -67,5 +67,6 @@
 	emix Simul;
 	Simul.set_rv ( x );
-	Simul.set_parameters ( "0.5 0.6", Sim );
+	Simul._w() = "0.5 0.6";
+	Simul._Coms() = Sim;
 	Simul.validate();
 
Index: library/tests/stresssuite/arx_stress.cpp
===================================================================
--- library/tests/stresssuite/arx_stress.cpp (revision 722)
+++ library/tests/stresssuite/arx_stress.cpp (revision 766)
@@ -24,5 +24,5 @@
 	//Test constructor
 	mat V0 = 0.00001 * eye ( ord + 1 );
-	V0 ( 0.0 ) = 1; //
+	V0 ( 0 ) = 1; //
 	double nu0 = ord + 5.0;
 
