Index: library/bdm/mex/config2mxstruct.h
===================================================================
--- library/bdm/mex/config2mxstruct.h (revision 728)
+++ library/bdm/mex/config2mxstruct.h (revision 737)
@@ -32,8 +32,8 @@
 		if ( !setting.isArray() ) mexErrMsgTxt ( "Given setting is not an array" );
 		mxArray *result = mxCreateDoubleMatrix ( 1, setting.getLength(), mxREAL );
-		double *elements = mxGetPr(result);
+		double *elements = mxGetPr ( result );
 		for ( int i = 0; i < setting.getLength(); i++ ) {
 			if ( setting.getType() == Setting::TypeInt ) { //TODO: tady je chyba -- zaporna cisla nejsou TypeInt
-				elements[i] = (int) setting[i];
+				elements[i] = ( int ) setting[i];
 			} else {
 				elements[i] =  setting[i];
@@ -45,5 +45,5 @@
 	//! Convert libconfig's array to Matlab matrix
 	mxArray* list2mxmatrix ( const Setting &setting )  {
-		if ( !setting.isList() || ( strcmp("matrix", setting[0])!=0 ) )
+		if ( !setting.isList() || ( strcmp ( "matrix", setting[0] ) != 0 ) )
 			mexErrMsgTxt ( "Given setting is not a matrix" );
 		int rows = setting[1];
@@ -62,5 +62,5 @@
 		return result;
 	}
-	
+
 	//! Convert libconfig's gourp to Matlab structure
 	mxArray* group2mxstruct ( const Setting &setting ) {
@@ -114,8 +114,8 @@
 			return result;
 		}
-		
-		if ( ( setting[0].getType() == Setting::TypeString )){
-			string s=(setting[0]);
-			if (s=="matrix") {
+
+		if ( ( setting[0].getType() == Setting::TypeString ) ) {
+			string s = ( setting[0] );
+			if ( s == "matrix" ) {
 				return list2mxmatrix ( setting );
 			}
Index: library/bdm/mex/mex_datasource.h
===================================================================
--- library/bdm/mex/mex_datasource.h (revision 706)
+++ library/bdm/mex/mex_datasource.h (revision 737)
@@ -16,7 +16,7 @@
 */
 class mxArrayDS : public MemDS {
-	public:
+public:
 	//!Default constructor
-	mxArrayDS ():MemDS() {};
+	mxArrayDS () : MemDS() {};
 
 	/*! \brief Create memory data source from mxArray
@@ -26,5 +26,5 @@
 		type="mexDS";
 		varname="";                // name of workspace variable
-		row_rv = {class='RV',...}  // definition of 
+		row_rv = {class='RV',...}  // definition of
 		};
 	\endcode
@@ -35,24 +35,24 @@
 	void from_setting ( const Setting &set ) {
 		Data = mxArray2mat ( mexGetVariable ( "base", set["varname"] ) );
-/*		UI::get ( rowid, set, "rids" , UI::compulsory );
-		bdm_assert_debug ( max ( rowid ) <= Data.rows(), "MemDS rowid is too high for given Dat." );
+		/*		UI::get ( rowid, set, "rids" , UI::compulsory );
+				bdm_assert_debug ( max ( rowid ) <= Data.rows(), "MemDS rowid is too high for given Dat." );
 
-		UI::get ( delays, set, "tds", UI::compulsory );
-		time = max ( delays );
-		bdm_assert_debug ( time < Data.cols(), "MemDS delays are too high." );
-*/
+				UI::get ( delays, set, "tds", UI::compulsory );
+				time = max ( delays );
+				bdm_assert_debug ( time < Data.cols(), "MemDS delays are too high." );
+		*/
 		//set MemDS
-		rowid = linspace(0,Data.rows()-1);
-		dtsize=rowid.length();
-		ytsize=rowid.length();
-		utsize=0;
-		
+		rowid = linspace ( 0, Data.rows() - 1 );
+		dtsize = rowid.length();
+		ytsize = rowid.length();
+		utsize = 0;
+
 		shared_ptr<RV> r = UI::build<RV> ( set, "rv", UI::optional );
 		RV ru = RV();
-		if (r){
+		if ( r ) {
 			set_drv ( *r, ru );
 		} else {
-			RV def((const char*)set["varname"],Data.rows());
-			set_drv(def, ru);
+			RV def ( ( const char* ) set["varname"], Data.rows() );
+			set_drv ( def, ru );
 		}
 	}
@@ -69,21 +69,21 @@
 
 The identifier of matlab function is stored in attribute \c name.
-This identifier defines: 
+This identifier defines:
 \li function to call to do a step(): name_step.m
 \li workspace variable to write input to: name_input
 */
 class mexDS : public DS {
-	protected:
-		//! identifier of matlab function 
-		string step_name;
-		//! identifier of matlab input variabel
-		string input_name;
-		//! cache of results from name_step
-		vec dt;
-		//! cache of inputs 
-		vec ut;
-	public:
+protected:
+	//! identifier of matlab function
+	string step_name;
+	//! identifier of matlab input variabel
+	string input_name;
+	//! cache of results from name_step
+	vec dt;
+	//! cache of inputs
+	vec ut;
+public:
 	//!Default constructor
-	mexDS ():DS() {};
+	mexDS () : DS() {};
 
 	/*! \brief Create memory data source from mxArray
@@ -103,57 +103,57 @@
 	*/
 	void from_setting ( const Setting &set ) {
-		UI::get(step_name, set, "step_name", UI::compulsory);
-		UI::get(input_name, set, "input_name", UI::compulsory);
-		
+		UI::get ( step_name, set, "step_name", UI::compulsory );
+		UI::get ( input_name, set, "input_name", UI::compulsory );
+
 		shared_ptr<RV> ry = UI::build<RV> ( set, "yrv", UI::compulsory );
-		shared_ptr<RV> ru = UI::build<RV> ( set, "urv", UI::compulsory);
+		shared_ptr<RV> ru = UI::build<RV> ( set, "urv", UI::compulsory );
 
-		ytsize=ry->_dsize();
-		utsize=ru->_dsize();
-		dtsize = ytsize+utsize;
-		
-		set_drv(*ry, *ru);
+		ytsize = ry->_dsize();
+		utsize = ru->_dsize();
+		dtsize = ytsize + utsize;
+
+		set_drv ( *ry, *ru );
 		validate();
 	}
-	
+
 	void step() {
 		mxArray* tmp;
-		mxArray* dummy=NULL;
+		mxArray* dummy = NULL;
 		// write inputs to variable input_name
-		mxArray* mxinp= mexGetVariable ( "global", input_name.c_str()) ;
-		if (mxinp){
-			if((int)mxGetM(mxinp)!=utsize || (int)mxGetN(mxinp)!=utsize) {
+		mxArray* mxinp = mexGetVariable ( "global", input_name.c_str() ) ;
+		if ( mxinp ) {
+			if ( ( int ) mxGetM ( mxinp ) != utsize || ( int ) mxGetN ( mxinp ) != utsize ) {
 				// mxinp is invalid - create new one
-				mxDestroyArray(mxinp);
-				mxinp=mxCreateDoubleMatrix(utsize,1,mxREAL);
+				mxDestroyArray ( mxinp );
+				mxinp = mxCreateDoubleMatrix ( utsize, 1, mxREAL );
 			}
-			
+
 		} else {
-			mxinp=mxCreateDoubleMatrix(utsize,1,mxREAL);
+			mxinp = mxCreateDoubleMatrix ( utsize, 1, mxREAL );
 		}
-		vec2mxArray(ut, mxinp);
-		mexPutVariable("global",input_name.c_str(),mxinp);
+		vec2mxArray ( ut, mxinp );
+		mexPutVariable ( "global", input_name.c_str(), mxinp );
 		// call function step_name
-		mexCallMATLAB(1, &tmp, 0, (mxArray **) &dummy, step_name.c_str());
+		mexCallMATLAB ( 1, &tmp, 0, ( mxArray ** ) &dummy, step_name.c_str() );
 		// save its results
-		bdm_assert_debug((int)mxGetM(tmp)==ytsize || (int)mxGetN(tmp)==ytsize,"mexDS.step() expected return vector of length " + num2str(dtsize) +
-		"got vector " + num2str((int)mxGetM(tmp)) + "x" + num2str((int)mxGetN(tmp)));
+		bdm_assert_debug ( ( int ) mxGetM ( tmp ) == ytsize || ( int ) mxGetN ( tmp ) == ytsize, "mexDS.step() expected return vector of length " + num2str ( dtsize ) +
+		                   "got vector " + num2str ( ( int ) mxGetM ( tmp ) ) + "x" + num2str ( ( int ) mxGetN ( tmp ) ) );
 		//write  y
-		dt.set_subvector(0,mxArray2vec(tmp));
+		dt.set_subvector ( 0, mxArray2vec ( tmp ) );
 		//write u
-		dt.set_subvector(ytsize,ut);
+		dt.set_subvector ( ytsize, ut );
 	}
-	void write(const vec &ut0){ 
-		bdm_assert_debug(ut0.length()==ut.length(),"mexDS: Incompatible input vector");
-		ut=ut0;
+	void write ( const vec &ut0 ) {
+		bdm_assert_debug ( ut0.length() == ut.length(), "mexDS: Incompatible input vector" );
+		ut = ut0;
 	}
-	void getdata(vec &dt_out) const {
-		bdm_assert_debug(dt_out.length()==dt.length(),"mexDS: Incompatible output vector");
-		dt_out = dt;	
+	void getdata ( vec &dt_out ) const {
+		bdm_assert_debug ( dt_out.length() == dt.length(), "mexDS: Incompatible output vector" );
+		dt_out = dt;
 	}
 
 	void validate() {
-		dt=zeros(dtsize);
-		ut=zeros(utsize);
+		dt = zeros ( dtsize );
+		ut = zeros ( utsize );
 	}
 
Index: library/bdm/mex/mex_parser.h
===================================================================
--- library/bdm/mex/mex_parser.h (revision 706)
+++ library/bdm/mex/mex_parser.h (revision 737)
@@ -53,5 +53,5 @@
 		//treat empty matrices independently
 		mat val;
-		if (mxGetM(value)>0) {
+		if ( mxGetM ( value ) > 0 ) {
 			val = mxArray2mat ( value );
 		}
@@ -112,5 +112,5 @@
 			mexErrMsgTxt ( "Given mxArray is not a cell." );
 		};
-		for ( unsigned int i = 0; i < (unsigned int) mxGetNumberOfElements ( mxarray ); i++ ) {
+		for ( unsigned int i = 0; i < ( unsigned int ) mxGetNumberOfElements ( mxarray ); i++ ) {
 			mxArray *value = mxGetCell ( mxarray, i );
 			if ( mxIsChar ( value ) ) {
Index: library/bdm/mex/mex_BM.h
===================================================================
--- library/bdm/mex/mex_BM.h (revision 706)
+++ library/bdm/mex/mex_BM.h (revision 737)
@@ -6,5 +6,5 @@
 namespace bdm {
 /*!
-* \brief Wrapper of BM mapping BM's methods to matlab functions 
+* \brief Wrapper of BM mapping BM's methods to matlab functions
 
 The data are stored in an internal matrix \c Data . Each column of Data corresponds to one discrete time observation \f$t\f$. Access to this matrix is via indices \c rowid and \c delays.
@@ -16,83 +16,83 @@
 
 //! epdf with functions implemented in matlab
-class mexEpdf: public epdf{
-	protected:
-		//! prefix of matlab functions
-		string name;
-		//! pointer to storage structure
-		mxArray *data;
-	public:
-		mexEpdf() {};
-		void from_setting(const Setting &S)  {
-			name = (const char *) S["name"];
-			UImxConfig conf(S);
-			data = mxDuplicateArray(conf.mxconfig);
-			//mexCallMATLAB(1, &data, 0, 0, (name+"_new").c_str());
-			//TODO (future...):
-			//mxArray * init_data = setting2mxarray S["init_data"];
-			//mexCallMATLAB(1, &data, 1, &init_data, name+"_from_setting");
-			//delete init_data;
-		} 
-		vec mean() const {
-			mxArray *tmp;
-			string fname = name+"_mean";
-			mexCallMATLAB(1, &tmp, 1, (mxArray **) &data, fname.c_str());
-			return mxArray2vec(tmp);
-		} 
+class mexEpdf: public epdf {
+protected:
+	//! prefix of matlab functions
+	string name;
+	//! pointer to storage structure
+	mxArray *data;
+public:
+	mexEpdf() {};
+	void from_setting ( const Setting &S )  {
+		name = ( const char * ) S["name"];
+		UImxConfig conf ( S );
+		data = mxDuplicateArray ( conf.mxconfig );
+		//mexCallMATLAB(1, &data, 0, 0, (name+"_new").c_str());
+		//TODO (future...):
+		//mxArray * init_data = setting2mxarray S["init_data"];
+		//mexCallMATLAB(1, &data, 1, &init_data, name+"_from_setting");
+		//delete init_data;
+	}
+	vec mean() const {
+		mxArray *tmp;
+		string fname = name + "_mean";
+		mexCallMATLAB ( 1, &tmp, 1, ( mxArray ** ) &data, fname.c_str() );
+		return mxArray2vec ( tmp );
+	}
 };
-UIREGISTER(mexEpdf);
+UIREGISTER ( mexEpdf );
 
 //! BM with functions implemented in matlab
-class mexBM: public BM{
-	protected :
-		//! prefix of matlab functions
-		string name;
-		//! internal estimator
-		mexEpdf est;
-		//! mxArray with attributes of this object
-		mxArray *data;
-	public:
-		mexBM() {}
+class mexBM: public BM {
+protected :
+	//! prefix of matlab functions
+	string name;
+	//! internal estimator
+	mexEpdf est;
+	//! mxArray with attributes of this object
+	mxArray *data;
+public:
+	mexBM() {}
 
-		//! duplicate internal data pointer?
-		mxArray *get_data() {
-			//mexCallMATLAB(0, NULL, 1, &data, "dump");
-			return mxDuplicateArray(data);
-		}
+	//! duplicate internal data pointer?
+	mxArray *get_data() {
+		//mexCallMATLAB(0, NULL, 1, &data, "dump");
+		return mxDuplicateArray ( data );
+	}
 
-		void from_setting(const Setting &S)  {
-			BM::from_setting(S);
-			name = (const char *) S["name"];
-			UImxConfig conf(S);
-			data = mxDuplicateArray(conf.mxconfig);
-			//string fname = name+"_new";
-			//mexCallMATLAB(1, &data, 0, 0, (name+"_new").c_str());
-			//the following works as long as the posterior is the
-			//only member object there could be a structure of 
-			//member objects in the setting and a for cycle over
-			//all of them right here in the code
-			Setting &posterior = S["posterior"]; 
-			est.from_setting(posterior);
-		}
-		void bayes(const vec &yt, const vec &cond)  {
+	void from_setting ( const Setting &S )  {
+		BM::from_setting ( S );
+		name = ( const char * ) S["name"];
+		UImxConfig conf ( S );
+		data = mxDuplicateArray ( conf.mxconfig );
+		//string fname = name+"_new";
+		//mexCallMATLAB(1, &data, 0, 0, (name+"_new").c_str());
+		//the following works as long as the posterior is the
+		//only member object there could be a structure of
+		//member objects in the setting and a for cycle over
+		//all of them right here in the code
+		Setting &posterior = S["posterior"];
+		est.from_setting ( posterior );
+	}
+	void bayes ( const vec &yt, const vec &cond )  {
 		//void bayes()  {
-			mxArray *tmp, *old;
-			mxArray *in[2];
-			in[0] = data;
-			in[1] = mxCreateDoubleMatrix(yt.size(), 1, mxREAL);
-			vec2mxArray(yt, in[1]);
-			mexCallMATLAB(1, &tmp, 2, in, (name+"_bayes").c_str());
-			old = data;
-			data = mxDuplicateArray(tmp);
-			if (old) mxDestroyArray(old);
-			if (tmp) mxDestroyArray(tmp);
-			//mexCallMATLAB(0, NULL, 1, &data, "dump");
-		} 
-		//! return correctly typed posterior (covariant return)
-		const mexEpdf& posterior() const  {
-			return est;
-		} //tohle by melo zustat!!
+		mxArray *tmp, *old;
+		mxArray *in[2];
+		in[0] = data;
+		in[1] = mxCreateDoubleMatrix ( yt.size(), 1, mxREAL );
+		vec2mxArray ( yt, in[1] );
+		mexCallMATLAB ( 1, &tmp, 2, in, ( name + "_bayes" ).c_str() );
+		old = data;
+		data = mxDuplicateArray ( tmp );
+		if ( old ) mxDestroyArray ( old );
+		if ( tmp ) mxDestroyArray ( tmp );
+		//mexCallMATLAB(0, NULL, 1, &data, "dump");
+	}
+	//! return correctly typed posterior (covariant return)
+	const mexEpdf& posterior() const  {
+		return est;
+	} //tohle by melo zustat!!
 };
-UIREGISTER(mexBM);
+UIREGISTER ( mexBM );
 
 }
Index: library/bdm/mex/mex_logger.h
===================================================================
--- library/bdm/mex/mex_logger.h (revision 728)
+++ library/bdm/mex/mex_logger.h (revision 737)
@@ -36,5 +36,5 @@
 		for ( r = 0; r < rows; r++ ) {
 			*temp++ = in ( c ) ( r );
-			
+
 		}
 	}
@@ -48,5 +48,5 @@
 	mexlog() : memlog ( 0, "" ) {};
 	//! constructor
-	mexlog(long maxlen0) : memlog ( maxlen0, "" ) {};
+	mexlog ( long maxlen0 ) : memlog ( maxlen0, "" ) {};
 	//! copy internal data to output mxArray
 	mxArray* toCell() {
@@ -62,5 +62,5 @@
 			istart = 0;
 			for ( int j = 0; j < entries ( i ).length(); j++ ) { // same for as in add!!!
-				vec_name = names ( i ) +prefix_sep()+ entries ( i ).name ( j );
+				vec_name = names ( i ) + prefix_sep() + entries ( i ).name ( j );
 				iend = istart + entries ( i ).size ( j ) - 1;
 				M = vectors ( i ).get_cols ( istart, iend );
@@ -77,5 +77,7 @@
 		maxlen = root["maxlen"];
 	}
-	Config& _setting_conf(){return setting_conf;}
+	Config& _setting_conf() {
+		return setting_conf;
+	}
 };
 UIREGISTER ( mexlog );
