Index: library/tests/loggers_test.cpp
===================================================================
--- library/tests/loggers_test.cpp (revision 470)
+++ library/tests/loggers_test.cpp (revision 477)
@@ -10,34 +10,33 @@
 using namespace bdm;
 
-TEST(test_dirfilelog)
-{
-    RV th = RV("{alog blog }");
-    RV r = RV("{r }", "2");
+TEST ( test_dirfilelog ) {
+	RV th = RV ( "{alog blog }" );
+	RV r = RV ( "{r }", "2" );
 
-    string ls("exp");
-    remove_all(ls.c_str());
-    makedir(ls, false);
-    remove_all("exp/dirfile");
+	string ls ( "exp" );
+	remove_all ( ls.c_str() );
+	makedir ( ls, false );
+	remove_all ( "exp/dirfile" );
 
-    dirfilelog L("exp/dirfile", 10);
+	dirfilelog L ( "exp/dirfile", 10 );
 
-    int rid;
-    int thid;
+	int rid;
+	int thid;
 
-    rid = L.add(r, "");
-    thid = L.add(th, "th");
+	rid = L.add ( r, "" );
+	thid = L.add ( th, "th" );
 
-    L.init();
+	L.init();
 
-    for (int i = 0; i < 150; i++) {
-	    L.logit(rid, vec_2((double)i, (double)(i + 1)));
-	    L.logit(thid, vec_2((double)(100 - i), (double)(i - 50)));
-	    L.step();
-    }
+	for ( int i = 0; i < 150; i++ ) {
+		L.logit ( rid, vec_2 ( ( double ) i, ( double ) ( i + 1 ) ) );
+		L.logit ( thid, vec_2 ( ( double ) ( 100 - i ), ( double ) ( i - 50 ) ) );
+		L.step();
+	}
 
-    L.finalize();
+	L.finalize();
 
-    std::string expected(load_test_file("dirfile-format.matrix"));
-    std::string actual(load_test_file("exp/dirfile/format"));
-    CHECK_EQUAL(expected, actual);
+	std::string expected ( load_test_file ( "dirfile-format.matrix" ) );
+	std::string actual ( load_test_file ( "exp/dirfile/format" ) );
+	CHECK_EQUAL ( expected, actual );
 }
Index: library/tests/emix_test.cpp
===================================================================
--- library/tests/emix_test.cpp (revision 461)
+++ library/tests/emix_test.cpp (revision 477)
@@ -9,17 +9,18 @@
 using std::endl;
 
-double normcoef ( const epdf* ep,const vec &xb, const vec &yb, int Ngr=100 ) {
-	mat PPdf ( Ngr+1,Ngr+1 );
+double normcoef ( const epdf* ep, const vec &xb, const vec &yb, int Ngr = 100 ) {
+	mat PPdf ( Ngr + 1, Ngr + 1 );
 	vec rgr ( 2 );
 
-	int i=0,j=0;
-	double xstep= ( xb ( 1 )-xb ( 0 ) ) /Ngr;
-	double ystep= ( yb ( 1 )-yb ( 0 ) ) /Ngr;
+	int i = 0, j = 0;
+	double xstep = ( xb ( 1 ) - xb ( 0 ) ) / Ngr;
+	double ystep = ( yb ( 1 ) - yb ( 0 ) ) / Ngr;
 
-	for ( double x=xb ( 0 );x<=xb ( 1 );x+= xstep,i++ ) {
-		rgr ( 0 ) =x;j=0;
-		for ( double y=yb ( 0 );y<=yb ( 1 );y+=ystep,j++ ) {
-			rgr ( 1 ) =y;
-			PPdf ( i,j ) =exp ( ep->evallog ( rgr ) );
+	for ( double x = xb ( 0 ); x <= xb ( 1 ); x += xstep, i++ ) {
+		rgr ( 0 ) = x;
+		j = 0;
+		for ( double y = yb ( 0 ); y <= yb ( 1 ); y += ystep, j++ ) {
+			rgr ( 1 ) = y;
+			PPdf ( i, j ) = exp ( ep->evallog ( rgr ) );
 		}
 	}
@@ -32,63 +33,67 @@
 	RV x ( "{x }" );
 	RV y ( "{y }" );
-	RV xy=concat(x,y);
-	
-	enorm<ldmat> E1; E1.set_rv ( xy );
-		
-	E1.set_parameters( "1.00054 1.0455" , mat ( "0.740142 -0.259015; -0.259015 1.0302" ));
-	enorm<ldmat> E2;E2.set_rv ( xy );
-	E2.set_parameters( "-1.2 -0.1" , mat ( "1 0.4; 0.4 0.5" ));
+	RV xy = concat ( x, y );
 
-	Array<epdf*> A1(1);
-	A1(0) = &E1;
-	
-	emix M1; M1.set_rv(xy);
-	M1.set_parameters(vec("1"), A1, false);
-	cout << "======== test if ARX and emix with one ARX are the same ==="<<endl;
-	
-	epdf* Mm = M1.marginal(y);
-	epdf* Am = E1.marginal(y);
-	mpdf* Mc = M1.condition(y);
-	mpdf* Ac = E1.condition(y);
-	
-	cout << *((mlnorm<ldmat>*)Ac) <<endl;
-	
-	cout << "Mix marg at 0: " << Mm->evallog(vec_1(0.0)) <<endl;
-	cout << "ARX marg at 0: " << Am->evallog(vec_1(0.0)) <<endl;
-	cout << "Mix cond at 0,0: " << Mc->evallogcond(vec_1(0.0),vec_1(0.0)) <<endl;
-	cout << "ARX cond at 0,0: " << Ac->evallogcond(vec_1(0.0),vec_1(0.0)) <<endl;
-	
-	cout << "======== Mixture with two components ==="<<endl;
-	Array<epdf*> A2(2);
-	A2(0) = &E1;
-	A2(1) = &E2;
-	
-	emix M2; M2.set_rv(xy);
-	M2.set_parameters(vec("1"), A2, false);
-	
-	
-	cout << "Mixture normalization: " << normcoef(&M2, vec("-3 3 "), vec("-3 3 ")) <<endl;
-	
-	int N=3;
+	enorm<ldmat> E1;
+	E1.set_rv ( xy );
+
+	E1.set_parameters ( "1.00054 1.0455" , mat ( "0.740142 -0.259015; -0.259015 1.0302" ) );
+	enorm<ldmat> E2;
+	E2.set_rv ( xy );
+	E2.set_parameters ( "-1.2 -0.1" , mat ( "1 0.4; 0.4 0.5" ) );
+
+	Array<epdf*> A1 ( 1 );
+	A1 ( 0 ) = &E1;
+
+	emix M1;
+	M1.set_rv ( xy );
+	M1.set_parameters ( vec ( "1" ), A1, false );
+	cout << "======== test if ARX and emix with one ARX are the same ===" << endl;
+
+	epdf* Mm = M1.marginal ( y );
+	epdf* Am = E1.marginal ( y );
+	mpdf* Mc = M1.condition ( y );
+	mpdf* Ac = E1.condition ( y );
+
+	cout << * ( ( mlnorm<ldmat>* ) Ac ) << endl;
+
+	cout << "Mix marg at 0: " << Mm->evallog ( vec_1 ( 0.0 ) ) << endl;
+	cout << "ARX marg at 0: " << Am->evallog ( vec_1 ( 0.0 ) ) << endl;
+	cout << "Mix cond at 0,0: " << Mc->evallogcond ( vec_1 ( 0.0 ), vec_1 ( 0.0 ) ) << endl;
+	cout << "ARX cond at 0,0: " << Ac->evallogcond ( vec_1 ( 0.0 ), vec_1 ( 0.0 ) ) << endl;
+
+	cout << "======== Mixture with two components ===" << endl;
+	Array<epdf*> A2 ( 2 );
+	A2 ( 0 ) = &E1;
+	A2 ( 1 ) = &E2;
+
+	emix M2;
+	M2.set_rv ( xy );
+	M2.set_parameters ( vec ( "1" ), A2, false );
+
+
+	cout << "Mixture normalization: " << normcoef ( &M2, vec ( "-3 3 " ), vec ( "-3 3 " ) ) << endl;
+
+	int N = 3;
 	vec ll ( N );
 	vec ll2 ( N );
-	mat Smp=M2.sample_m ( N );
-	ll = M2.evallog_m(Smp);
-	
-	vec Emu = sum ( Smp,2 ) /N;
-	mat Er = ( Smp*Smp.transpose() ) /N - outer_product ( Emu,Emu );
+	mat Smp = M2.sample_m ( N );
+	ll = M2.evallog_m ( Smp );
 
-	cout << "original empirical mean: " <<Emu <<endl;
-	cout << "original empirical variance: " <<Er <<endl;
+	vec Emu = sum ( Smp, 2 ) / N;
+	mat Er = ( Smp * Smp.transpose() ) / N - outer_product ( Emu, Emu );
 
-	shared_ptr<epdf> Mg(dynamic_cast<epdf *>(M2.marginal(y)));
-	mpdf* Cn = (mpdf*)M2.condition ( x );
+	cout << "original empirical mean: " << Emu << endl;
+	cout << "original empirical variance: " << Er << endl;
 
-	it_file it("emix_test.it");
-	it << Name("Smp") << Smp;
+	shared_ptr<epdf> Mg ( dynamic_cast<epdf *> ( M2.marginal ( y ) ) );
+	mpdf* Cn = ( mpdf* ) M2.condition ( x );
 
-	cout<< "marginal mean: " << Mg->mean() <<endl;
+	it_file it ( "emix_test.it" );
+	it << Name ( "Smp" ) << Smp;
 
-	cout << "========== putting them back together ======= "<<endl;
+	cout << "marginal mean: " << Mg->mean() << endl;
+
+	cout << "========== putting them back together ======= " << endl;
 	mepdf mMg ( Mg );
 	Array<mpdf*> AA ( 2 );
@@ -97,10 +102,10 @@
 	mprod mEp ( AA );
 
-	for (int j=0; j<N; j++){
-		ll2(j)=mEp.evallogcond (Smp.get_col(j), vec ( 0 ));
+	for ( int j = 0; j < N; j++ ) {
+		ll2 ( j ) = mEp.evallogcond ( Smp.get_col ( j ), vec ( 0 ) );
 	}
-	it << Name("ll") << ll;
-	it << Name("ll2") << ll2;
-	
-	
+	it << Name ( "ll" ) << ll;
+	it << Name ( "ll2" ) << ll2;
+
+
 }
Index: library/tests/merger_2d_test.cpp
===================================================================
--- library/tests/merger_2d_test.cpp (revision 386)
+++ library/tests/merger_2d_test.cpp (revision 477)
@@ -14,56 +14,60 @@
 
 	RNG_randomize();
-	
-	RV x ( "{x }","1" );
-	RV y ( "{y }","1" );
 
-	RV xy=x; xy.add(y);
-	
-	enorm<fsqmat> f1; f1.set_rv ( xy );
-	enorm<fsqmat> f2; f1.set_rv ( xy );
-		
+	RV x ( "{x }", "1" );
+	RV y ( "{y }", "1" );
+
+	RV xy = x;
+	xy.add ( y );
+
+	enorm<fsqmat> f1;
+	f1.set_rv ( xy );
+	enorm<fsqmat> f2;
+	f1.set_rv ( xy );
+
 	mat R1 ( "0.5 0.48; 0.48 0.5" );
 	mat R2 ( "0.5 0; 0 0.1" );
-	f1.set_parameters ( "1 1", R1);
-	f2.set_parameters ( "1 1",mat ( "0.5 0; 0 0.1" ) );
-	
+	f1.set_parameters ( "1 1", R1 );
+	f2.set_parameters ( "1 1", mat ( "0.5 0; 0 0.1" ) );
+
 	Array<mpdf* > A ( 2 );
-	mepdf A1(&f1);
-	mepdf A2(&f2);
-	A ( 0 ) =&A1;
-	A ( 1 ) =&A2;
-	
-	int Npoints=100;
-	mat x_grid(1,Npoints);
-	x_grid.set_row(0,linspace ( -2.0, 4.0, Npoints ));
-	mat y_grid(1,Npoints);
-	y_grid.set_row(0,linspace ( -2.0, 4.0, Npoints ));
-	
-	mat Grid (2,Npoints*Npoints);
-	Grid.set_submatrix ( 0,0, kron(x_grid,ones(1,Npoints)) );
-	Grid.set_submatrix ( 1,0, kron(ones(1,Npoints), y_grid) );
-	
+	mepdf A1 ( &f1 );
+	mepdf A2 ( &f2 );
+	A ( 0 ) = &A1;
+	A ( 1 ) = &A2;
+
+	int Npoints = 100;
+	mat x_grid ( 1, Npoints );
+	x_grid.set_row ( 0, linspace ( -2.0, 4.0, Npoints ) );
+	mat y_grid ( 1, Npoints );
+	y_grid.set_row ( 0, linspace ( -2.0, 4.0, Npoints ) );
+
+	mat Grid ( 2, Npoints*Npoints );
+	Grid.set_submatrix ( 0, 0, kron ( x_grid, ones ( 1, Npoints ) ) );
+	Grid.set_submatrix ( 1, 0, kron ( ones ( 1, Npoints ), y_grid ) );
+
 	merger_mix M ( A );
-	enorm<fsqmat> g0; g0.set_rv(xy);
-	g0.set_parameters(vec("1 1"),mat("10 0; 0 10"));
-	
-	M.set_parameters(1);
-	M.set_method(LOGNORMAL,1e8);
-	M.set_support(g0,400);
+	enorm<fsqmat> g0;
+	g0.set_rv ( xy );
+	g0.set_parameters ( vec ( "1 1" ), mat ( "10 0; 0 10" ) );
+
+	M.set_parameters ( 1 );
+	M.set_method ( LOGNORMAL, 1e8 );
+	M.set_support ( g0, 400 );
 	M.merge();
-	
+
 	MixEF &MM = M._Mix();
 	emix* MP = MM.epredictor(); //xy
-	
-	vec Res1 = M.evallog_m(Grid);
-	mat Res2 = (MP)->evallog_M(Grid);
-	
-	it_file it("merger_2d_test.it");
-	it << Name("Npoints") << Npoints;
-	it << Name("Grid") << Grid;
-	it << Name("Res1") << Res1;
-	it << Name("Res2") << Res2;
-	it << Name("S1") << f1.evallog_m(Grid);
-	it << Name("S2") << f2.evallog_m(Grid);
-	cout << ((enorm<ldmat>*)(MP->_Coms(0)))->_R().to_mat() << endl;
+
+	vec Res1 = M.evallog_m ( Grid );
+	mat Res2 = ( MP )->evallog_M ( Grid );
+
+	it_file it ( "merger_2d_test.it" );
+	it << Name ( "Npoints" ) << Npoints;
+	it << Name ( "Grid" ) << Grid;
+	it << Name ( "Res1" ) << Res1;
+	it << Name ( "Res2" ) << Res2;
+	it << Name ( "S1" ) << f1.evallog_m ( Grid );
+	it << Name ( "S2" ) << f2.evallog_m ( Grid );
+	cout << ( ( enorm<ldmat>* ) ( MP->_Coms ( 0 ) ) )->_R().to_mat() << endl;
 }
Index: library/tests/test_kalman_QRexh.cpp
===================================================================
--- library/tests/test_kalman_QRexh.cpp (revision 386)
+++ library/tests/test_kalman_QRexh.cpp (revision 477)
@@ -11,5 +11,5 @@
 int main() {
 	// Klaman filter
-	mat A, B,C,D,R,Q,P0;
+	mat A, B, C, D, R, Q, P0;
 	vec mu0;
 	mat Mu0;// read from matlab
@@ -17,12 +17,14 @@
 	it_file fin ( "testKF.it" );
 
-	mat Dt, XQRt,eR,eQ;
+	mat Dt, XQRt, eR, eQ;
 	int Ndat;
 
-	bool xxx= fin.seek ( "d" );
+	bool xxx = fin.seek ( "d" );
 
-	if ( !xxx ) { it_error ( "testKF.it not found" );}
+	if ( !xxx ) {
+		it_error ( "testKF.it not found" );
+	}
 
-	fin >>Dt;
+	fin >> Dt;
 
 	fin.seek ( "A" );
@@ -36,8 +38,11 @@
 	fin.seek ( "R" );
 	fin >> R;
-	fin.seek ( "Q" ); fin >> Q;
-	fin.seek ( "P0" ); fin >> P0;
-	fin.seek ( "mu0" ); fin >> Mu0;
-	mu0=Mu0.get_col ( 0 );
+	fin.seek ( "Q" );
+	fin >> Q;
+	fin.seek ( "P0" );
+	fin >> P0;
+	fin.seek ( "mu0" );
+	fin >> Mu0;
+	mu0 = Mu0.get_col ( 0 );
 
 	vec vQ1 = "0.01:0.04:1";
@@ -48,24 +53,24 @@
 	Ndat = Dt.cols();
 
-	RV rx ( "{x}","2" );
-	RV ru ( "{u}","1" );
-	RV ry ( "{y}","2" );
+	RV rx ( "{x}", "2" );
+	RV ru ( "{u}", "1" );
+	RV ry ( "{y}", "2" );
 	//
 	//
 	Kalman<ldmat> KFtr;
 
-	for ( int i =0; i<vQ1.length();i++ ) {
+	for ( int i = 0; i < vQ1.length(); i++ ) {
 
-		for ( int j = 0; j<vQ2.length();j++ ) {
+		for ( int j = 0; j < vQ2.length(); j++ ) {
 			// KF with R unknown
 			mat Qj = Q;
-			Qj ( 0,0 ) = vQ1 ( i );
-			Qj ( 1,1 ) = vQ2 ( j );
-			KFtr.set_parameters ( A,B,C,D,ldmat ( R ),ldmat ( Qj ) );
-			KFtr.set_est ( mu0,ldmat ( P0 ) );
+			Qj ( 0, 0 ) = vQ1 ( i );
+			Qj ( 1, 1 ) = vQ2 ( j );
+			KFtr.set_parameters ( A, B, C, D, ldmat ( R ), ldmat ( Qj ) );
+			KFtr.set_est ( mu0, ldmat ( P0 ) );
 
-			for ( int t=1;t<Ndat;t++ ) {
+			for ( int t = 1; t < Ndat; t++ ) {
 				KFtr.bayes ( Dt.get_col ( t ) );
-				LL ( i,j ) += KFtr._ll();
+				LL ( i, j ) += KFtr._ll();
 			}
 		}
Index: library/tests/epdf_test.cpp
===================================================================
--- library/tests/epdf_test.cpp (revision 457)
+++ library/tests/epdf_test.cpp (revision 477)
@@ -8,24 +8,24 @@
 
 template<>
-const ParticularUI<egamma> &ParticularUI<egamma>::factory(
-    ParticularUI<egamma>("egamma"));
+const ParticularUI<egamma> &ParticularUI<egamma>::factory (
+    ParticularUI<egamma> ( "egamma" ) );
 
 template<>
-const ParticularUI<enorm<ldmat> > &ParticularUI<enorm<ldmat> >::factory(
-    ParticularUI<enorm<ldmat> >("enorm<ldmat>"));
+const ParticularUI<enorm<ldmat> > &ParticularUI<enorm<ldmat> >::factory (
+    ParticularUI<enorm<ldmat> > ( "enorm<ldmat>" ) );
 
 template<>
-const ParticularUI<enorm<fsqmat> > &ParticularUI<enorm<fsqmat> >::factory(
-    ParticularUI<enorm<fsqmat> >("enorm<fsqmat>"));
+const ParticularUI<enorm<fsqmat> > &ParticularUI<enorm<fsqmat> >::factory (
+    ParticularUI<enorm<fsqmat> > ( "enorm<fsqmat>" ) );
 
- template<>
-const ParticularUI<enorm<chmat> > &ParticularUI<enorm<chmat> >::factory(
-    ParticularUI<enorm<chmat> >("enorm<chmat>"));
+template<>
+const ParticularUI<enorm<chmat> > &ParticularUI<enorm<chmat> >::factory (
+    ParticularUI<enorm<chmat> > ( "enorm<chmat>" ) );
 
-TEST(test_egamma) {
-    epdf_harness::test_config("egamma.cfg");
+TEST ( test_egamma ) {
+	epdf_harness::test_config ( "egamma.cfg" );
 }
 
-TEST(test_enorm) {
-    epdf_harness::test_config("enorm.cfg");
+TEST ( test_enorm ) {
+	epdf_harness::test_config ( "enorm.cfg" );
 }
Index: library/tests/square_mat_point.h
===================================================================
--- library/tests/square_mat_point.h (revision 468)
+++ library/tests/square_mat_point.h (revision 477)
@@ -20,43 +20,42 @@
   random vector and one random scalar.
  */
-class square_mat_point : public bdm::root
-{
+class square_mat_point : public bdm::root {
 private:
-    itpp::mat matrix;
-    itpp::vec vector;
-    double scalar;
+	itpp::mat matrix;
+	itpp::vec vector;
+	double scalar;
 
 public:
-    square_mat_point():scalar(0) { }
+	square_mat_point() : scalar ( 0 ) { }
 
-    itpp::mat get_matrix() const {
-	return matrix;
-    }
+	itpp::mat get_matrix() const {
+		return matrix;
+	}
 
-    itpp::vec get_vector() const {
-	return vector;
-    }
+	itpp::vec get_vector() const {
+		return vector;
+	}
 
-    double get_scalar() const {
-        return scalar;
-    }
+	double get_scalar() const {
+		return scalar;
+	}
 
-    void set_parameters(const itpp::mat &m, const itpp::vec &v, double s) {
-        matrix = m;
-	vector = v;
-	scalar = s;
-    }
+	void set_parameters ( const itpp::mat &m, const itpp::vec &v, double s ) {
+		matrix = m;
+		vector = v;
+		scalar = s;
+	}
 
-    //! Load from structure with elements:
-    //!  \code
-    //! { matrix = ( "matrix", ...
-    //!   vector = [ ...
-    //!   scalar = ...
-    //! }
-    //! \endcode
-    //! All elements are mandatory.
-    void from_setting(const Setting &set);
-  
-    void to_setting(Setting &set) const;
+	//! Load from structure with elements:
+	//!  \code
+	//! { matrix = ( "matrix", ...
+	//!   vector = [ ...
+	//!   scalar = ...
+	//! }
+	//! \endcode
+	//! All elements are mandatory.
+	void from_setting ( const Setting &set );
+
+	void to_setting ( Setting &set ) const;
 };
 
Index: library/tests/test_util.h
===================================================================
--- library/tests/test_util.h (revision 436)
+++ library/tests/test_util.h (revision 477)
@@ -26,5 +26,5 @@
   characters, but for testing that should be enough.
 */
-std::string load_test_file(const char *fname);
+std::string load_test_file ( const char *fname );
 
 /*! \brief Recursively removes directories and files.
@@ -35,11 +35,11 @@
   exception otherwise.
 */
-bool remove_all(const char *path);
+bool remove_all ( const char *path );
 
-double normcoef(const epdf *ep, const itpp::vec &xb, const itpp::vec &yb,
-		int xn = 100, int yn = 100);
+double normcoef ( const epdf *ep, const itpp::vec &xb, const itpp::vec &yb,
+                  int xn = 100, int yn = 100 );
 
-itpp::vec num_mean2(const epdf *ep, const itpp::vec &xb, const itpp::vec &yb,
-		    int xn = 100, int yn = 100);
+itpp::vec num_mean2 ( const epdf *ep, const itpp::vec &xb, const itpp::vec &yb,
+                      int xn = 100, int yn = 100 );
 
 }
Index: library/tests/mpdf_test.cpp
===================================================================
--- library/tests/mpdf_test.cpp (revision 462)
+++ library/tests/mpdf_test.cpp (revision 477)
@@ -11,20 +11,20 @@
 
 template<>
-const ParticularUI<mgamma> &ParticularUI<mgamma>::factory(
-    ParticularUI<mgamma>("mgamma"));
+const ParticularUI<mgamma> &ParticularUI<mgamma>::factory (
+    ParticularUI<mgamma> ( "mgamma" ) );
 
 template<>
-const ParticularUI<mlnorm<ldmat> > &ParticularUI<mlnorm<ldmat> >::factory(
-    ParticularUI<mlnorm<ldmat> >("mlnorm<ldmat>"));
+const ParticularUI<mlnorm<ldmat> > &ParticularUI<mlnorm<ldmat> >::factory (
+    ParticularUI<mlnorm<ldmat> > ( "mlnorm<ldmat>" ) );
 
-TEST(test_mepdf) {
-    mpdf_harness::test_config("mepdf.cfg");
+TEST ( test_mepdf ) {
+	mpdf_harness::test_config ( "mepdf.cfg" );
 }
 
-TEST(test_mgamma) {
-    mpdf_harness::test_config("mgamma.cfg");
+TEST ( test_mgamma ) {
+	mpdf_harness::test_config ( "mgamma.cfg" );
 }
 
-TEST(test_mlnorm) {
-    mpdf_harness::test_config("mlnorm.cfg");
+TEST ( test_mlnorm ) {
+	mpdf_harness::test_config ( "mlnorm.cfg" );
 }
Index: library/tests/testsuite.cpp
===================================================================
--- library/tests/testsuite.cpp (revision 452)
+++ library/tests/testsuite.cpp (revision 477)
@@ -2,7 +2,6 @@
 #include "itpp_ext.h"
 
-int main(int, char const *[])
-{
-    itpp::RNG_randomize();
-    return UnitTest::RunAllTests();
+int main ( int, char const *[] ) {
+	itpp::RNG_randomize();
+	return UnitTest::RunAllTests();
 }
Index: library/tests/egiw_test.cpp
===================================================================
--- library/tests/egiw_test.cpp (revision 456)
+++ library/tests/egiw_test.cpp (revision 477)
@@ -14,62 +14,62 @@
 
 template<>
-const ParticularUI<egiw> &ParticularUI<egiw>::factory(
-    ParticularUI<egiw>("egiw"));
+const ParticularUI<egiw> &ParticularUI<egiw>::factory (
+    ParticularUI<egiw> ( "egiw" ) );
 
 template<>
-const ParticularUI<egiw_harness> &ParticularUI<egiw_harness>::factory(
-    ParticularUI<egiw_harness>("egiw_harness"));
+const ParticularUI<egiw_harness> &ParticularUI<egiw_harness>::factory (
+    ParticularUI<egiw_harness> ( "egiw_harness" ) );
 
-TEST(test_egiw) {
-    epdf_harness::test_config("egiw.cfg");
+TEST ( test_egiw ) {
+	epdf_harness::test_config ( "egiw.cfg" );
 }
 
-TEST(test_egiw_1_2) {
-    // Setup model
-    double mu = 1.1; //unit step parametr
-    double b = 3.0; // sequence of <1 -1 1 -1...>
-    double s = 0.1;
+TEST ( test_egiw_1_2 ) {
+	// Setup model
+	double mu = 1.1; //unit step parametr
+	double b = 3.0; // sequence of <1 -1 1 -1...>
+	double s = 0.1;
 
 
-    // TEST 1x1 EGIW
-    mat V(3, 3);
-    V(0, 0) = pow(mu, 2) + pow(b, 2) + s;
-    V(1, 0) = mu;
-    V(2, 0) = b;
+	// TEST 1x1 EGIW
+	mat V ( 3, 3 );
+	V ( 0, 0 ) = pow ( mu, 2 ) + pow ( b, 2 ) + s;
+	V ( 1, 0 ) = mu;
+	V ( 2, 0 ) = b;
 
-    V(0, 1) = V(1, 0);
-    V(1, 1) = 1.0;
-    V(2, 1) = 0.0;
+	V ( 0, 1 ) = V ( 1, 0 );
+	V ( 1, 1 ) = 1.0;
+	V ( 2, 1 ) = 0.0;
 
-    V(0, 2) = V(2, 0);
-    V(1, 2) = V(2, 1);
-    V(2, 2) = 1.0;
+	V ( 0, 2 ) = V ( 2, 0 );
+	V ( 1, 2 ) = V ( 2, 1 );
+	V ( 2, 2 ) = 1.0;
 
-    double nu = 20;
+	double nu = 20;
 
-    egiw E(1, nu * V, nu);    
-    CHECK_CLOSE(vec("1.1 3.0 0.142857"), E.mean(), epsilon);
-    CHECK_CLOSE(7.36731, E.lognc(), epsilon);
+	egiw E ( 1, nu * V, nu );
+	CHECK_CLOSE ( vec ( "1.1 3.0 0.142857" ), E.mean(), epsilon );
+	CHECK_CLOSE ( 7.36731, E.lognc(), epsilon );
 
-    int n = 100;
-    vec rgr(3);
+	int n = 100;
+	vec rgr ( 3 );
 
-    mat Tmp(2 * n, n);
+	mat Tmp ( 2 * n, n );
 
-    double summ = 0.0;
-    for (int k = 0; k < n; k++) { // ALL b
-	rgr(1) = 1 + k * (1.0 / n) * 4.0;
-	for (int i = 0; i < 2*n; i++) { //ALL mu
-	    rgr(0) = -2 + i * (1.0 / n) * 3.0;
-	    for (int j = 0; j < n; j++) { // All sigma
-	        rgr(2) = (j + 1) * (1.0 / n) * 2.0;
+	double summ = 0.0;
+	for ( int k = 0; k < n; k++ ) { // ALL b
+		rgr ( 1 ) = 1 + k * ( 1.0 / n ) * 4.0;
+		for ( int i = 0; i < 2*n; i++ ) { //ALL mu
+			rgr ( 0 ) = -2 + i * ( 1.0 / n ) * 3.0;
+			for ( int j = 0; j < n; j++ ) { // All sigma
+				rgr ( 2 ) = ( j + 1 ) * ( 1.0 / n ) * 2.0;
 
-		Tmp(i, j) = E.evallog(rgr);
-	    }
+				Tmp ( i, j ) = E.evallog ( rgr );
+			}
+		}
+		summ += sumsum ( exp ( Tmp ) ) / n / n / n * 3.0 * 2.0 * 4.0;
 	}
-	summ += sumsum(exp(Tmp)) / n / n / n * 3.0 * 2.0 * 4.0;
-    }
 
-    CHECK_CLOSE(1.0, summ, 0.1);
+	CHECK_CLOSE ( 1.0, summ, 0.1 );
 }
 
Index: library/tests/test_shared_ptr.cpp
===================================================================
--- library/tests/test_shared_ptr.cpp (revision 421)
+++ library/tests/test_shared_ptr.cpp (revision 477)
@@ -3,48 +3,50 @@
 #include <vector>
 
-class Foo
-{ 
+class Foo {
 private:
-    int x;
+	int x;
 
 public:
-    Foo(int x):x(x) { }
+	Foo ( int x ) : x ( x ) { }
 
-    int get_x() const { return x; }
+	int get_x() const {
+		return x;
+	}
 
-    void set_x(int nx) { x = nx; }
+	void set_x ( int nx ) {
+		x = nx;
+	}
 };
 
 typedef std::vector<bdm::shared_ptr<Foo> > TFooVector;
 
-TEST(test_shared_ptr)
-{
-    TFooVector v;
+TEST ( test_shared_ptr ) {
+	TFooVector v;
 
-    bdm::shared_ptr<Foo> zero;
-    CHECK_EQUAL(0l, zero.use_count());
-    bdm::shared_ptr<Foo> z2(zero);
-    CHECK_EQUAL(0l, z2.use_count());
+	bdm::shared_ptr<Foo> zero;
+	CHECK_EQUAL ( 0l, zero.use_count() );
+	bdm::shared_ptr<Foo> z2 ( zero );
+	CHECK_EQUAL ( 0l, z2.use_count() );
 
-    bdm::shared_ptr<Foo> one(new Foo(1));
-    v.push_back(one);
-    CHECK(!one.unique());
+	bdm::shared_ptr<Foo> one ( new Foo ( 1 ) );
+	v.push_back ( one );
+	CHECK ( !one.unique() );
 
-    v.push_back(one);
-    v.push_back(bdm::shared_ptr<Foo>(new Foo(2)));
-    CHECK_EQUAL(static_cast<TFooVector::size_type>(3), v.size());
+	v.push_back ( one );
+	v.push_back ( bdm::shared_ptr<Foo> ( new Foo ( 2 ) ) );
+	CHECK_EQUAL ( static_cast<TFooVector::size_type> ( 3 ), v.size() );
 
-    CHECK(v[0] == v[1]);
-    CHECK(v[1] != v[2]);
+	CHECK ( v[0] == v[1] );
+	CHECK ( v[1] != v[2] );
 
-    Foo c(*(v[0]));
-    CHECK_EQUAL(1, c.get_x());
-    
-    Foo *p = v[1].get();
-    CHECK_EQUAL(1, p->get_x());
-    p->set_x(12);
-    CHECK_EQUAL(12, one->get_x());
+	Foo c ( * ( v[0] ) );
+	CHECK_EQUAL ( 1, c.get_x() );
 
-    CHECK(v[2].unique());
-    CHECK_EQUAL(2, v[2]->get_x());
+	Foo *p = v[1].get();
+	CHECK_EQUAL ( 1, p->get_x() );
+	p->set_x ( 12 );
+	CHECK_EQUAL ( 12, one->get_x() );
+
+	CHECK ( v[2].unique() );
+	CHECK_EQUAL ( 2, v[2]->get_x() );
 }
Index: library/tests/dirent.h
===================================================================
--- library/tests/dirent.h (revision 469)
+++ library/tests/dirent.h (revision 477)
@@ -9,38 +9,36 @@
     History: Created March 1997. Updated June 2003.
     Rights:  See end of file.
-    
+
 */
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
-typedef struct DIR DIR;
+	typedef struct DIR DIR;
 
-struct dirent
-{
-    char *d_name;
-};
+	struct dirent {
+		char *d_name;
+	};
 
-DIR           *opendir(const char *);
-int           closedir(DIR *);
-struct dirent *readdir(DIR *);
-void          rewinddir(DIR *);
+	DIR           *opendir ( const char * );
+	int           closedir ( DIR * );
+	struct dirent *readdir ( DIR * );
+	void          rewinddir ( DIR * );
 
-/*
+	/*
 
-    Copyright Kevlin Henney, 1997, 2003. All rights reserved.
+	    Copyright Kevlin Henney, 1997, 2003. All rights reserved.
 
-    Permission to use, copy, modify, and distribute this software and its
-    documentation for any purpose is hereby granted without fee, provided
-    that this copyright and permissions notice appear in all copies and
-    derivatives.
-    
-    This software is supplied "as is" without express or implied warranty.
+	    Permission to use, copy, modify, and distribute this software and its
+	    documentation for any purpose is hereby granted without fee, provided
+	    that this copyright and permissions notice appear in all copies and
+	    derivatives.
 
-    But that said, if there are any problems please get in touch.
+	    This software is supplied "as is" without express or implied warranty.
 
-*/
+	    But that said, if there are any problems please get in touch.
+
+	*/
 
 #ifdef __cplusplus
Index: library/tests/generator.h
===================================================================
--- library/tests/generator.h (revision 467)
+++ library/tests/generator.h (revision 477)
@@ -19,12 +19,11 @@
 /*! An input iterator over IT++ matrices.
  */
-class generator : public bdm::root
-{
+class generator : public bdm::root {
 public:
-    generator();
+	generator();
 
-    //! Generates a matrix. Returned matrices should become
-    //! progressively more complicated.
-    virtual itpp::mat next() = 0;
+	//! Generates a matrix. Returned matrices should become
+	//! progressively more complicated.
+	virtual itpp::mat next() = 0;
 };
 
Index: library/tests/test_particle.cpp
===================================================================
--- library/tests/test_particle.cpp (revision 386)
+++ library/tests/test_particle.cpp (revision 477)
@@ -12,29 +12,33 @@
 int main() {
 
-	RV x("1");
-	RV xm=x; xm.t(-1);const
-	RV y("2");
-	
+	RV x ( "1" );
+	RV xm = x;
+	xm.t ( -1 );
+	const
+	RV y ( "2" );
+
 	mat A = "1";
 	vec vR = "1";
-	ldmat R(vR);
-		
+	ldmat R ( vR );
+
 	eEmp emp;
 	euni eun;
-	eun.set_parameters("0","1");
-	emp.set_statistics(ones(10),&eun);
-	vec &v=emp._w();
-	Array<vec> &S=emp._samples();
-	
-	for (int i=0;i<10;i++){	v(i) = exp(-0.5*sum(pow(S(i)-1,2.0))*10);}
-	v/=sum(v);
-	
+	eun.set_parameters ( "0", "1" );
+	emp.set_statistics ( ones ( 10 ), &eun );
+	vec &v = emp._w();
+	Array<vec> &S = emp._samples();
+
+	for ( int i = 0; i < 10; i++ ) {
+		v ( i ) = exp ( -0.5 * sum ( pow ( S ( i ) - 1, 2.0 ) ) * 10 );
+	}
+	v /= sum ( v );
+
 	cout << "p:" << S << endl;
 	cout << "w:" << v << endl;
-	
+
 	ivec ind = emp.resample();
-	
+
 	cout << ind << endl;
-	
+
 	//Exit program:
 	return 0;
Index: library/tests/test_kalman.cpp
===================================================================
--- library/tests/test_kalman.cpp (revision 386)
+++ library/tests/test_kalman.cpp (revision 477)
@@ -10,39 +10,44 @@
 int main() {
 	// Kalman filter
-	mat A, B,C,D,R,Q,P0;
+	mat A, B, C, D, R, Q, P0;
 	vec mu0;
 	mat Mu0;;
 	// input from Matlab
-	it_file fin( "testKF.it" );
+	it_file fin ( "testKF.it" );
 
 	mat Dt;
 	int Ndat;
 
-	bool xxx= fin.seek( "d" );
-	if (!xxx){ it_error("testKF.it not found");}
-	fin >>Dt;
-	fin.seek( "A" ); 
+	bool xxx = fin.seek ( "d" );
+	if ( !xxx ) {
+		it_error ( "testKF.it not found" );
+	}
+	fin >> Dt;
+	fin.seek ( "A" );
 	fin >> A;
-	fin.seek( "B" ); 
+	fin.seek ( "B" );
 	fin >> B;
-	fin.seek( "C" ); 
+	fin.seek ( "C" );
 	fin >> C;
-	fin.seek( "D" ); 
+	fin.seek ( "D" );
 	fin >> D;
-	fin.seek( "R" ); 
+	fin.seek ( "R" );
 	fin >> R;
-	fin.seek( "Q" ); fin >> Q;
-	fin.seek( "P0" ); fin >> P0;
-	fin.seek( "mu0" ); fin >> Mu0; 
-	mu0=Mu0.get_col(0);
-	
+	fin.seek ( "Q" );
+	fin >> Q;
+	fin.seek ( "P0" );
+	fin >> P0;
+	fin.seek ( "mu0" );
+	fin >> Mu0;
+	mu0 = Mu0.get_col ( 0 );
+
 	Ndat = 10;//Dt.cols();
 	int dimx = A.rows();
-	
+
 	// Prepare for Kalman filters in BDM:
-	RV rx("{x }",vec_1(A.cols()));
-	RV ru("{u }",vec_1(B.cols()));
-	RV ry("{y }",vec_1(C.rows()));
-	
+	RV rx ( "{x }", vec_1 ( A.cols() ) );
+	RV ru ( "{u }", vec_1 ( B.cols() ) );
+	RV ry ( "{y }", vec_1 ( C.rows() ) );
+
 // 	// LDMAT
 // 	Kalman<ldmat> KF(rx,ry,ru);
@@ -50,79 +55,79 @@
 // 	KF.set_est(mu0,ldmat(P0) );
 // 	epdf& KFep = KF.posterior();
-// 	mat Xt(2,Ndat);	
+// 	mat Xt(2,Ndat);
 // 	Xt.set_col( 0,KFep.mean() );
 
 	//Chol
 	KalmanCh KF;
-	KF.set_parameters(A,B,C,D,chmat(R),chmat(Q));
-	KF.set_est(mu0,chmat(P0) ); //prediction!
+	KF.set_parameters ( A, B, C, D, chmat ( R ), chmat ( Q ) );
+	KF.set_est ( mu0, chmat ( P0 ) ); //prediction!
 	const epdf& KFep = KF.posterior();
- 	mat Xt(dimx,Ndat);	
- 	Xt.set_col( 0,KFep.mean() );
-	
-	//	
+	mat Xt ( dimx, Ndat );
+	Xt.set_col ( 0, KFep.mean() );
+
+	//
 	// FSQMAT
 	Kalman<ldmat> KFf;
-	KFf.set_parameters(A,B,C,D,ldmat(R),ldmat(Q));
-	KFf.set_est(mu0,ldmat(P0) );
+	KFf.set_parameters ( A, B, C, D, ldmat ( R ), ldmat ( Q ) );
+	KFf.set_est ( mu0, ldmat ( P0 ) );
 	const	epdf& KFfep = KFf.posterior();
-	mat Xtf(dimx,Ndat);	
-	Xtf.set_col( 0,KFfep.mean() );
-	
+	mat Xtf ( dimx, Ndat );
+	Xtf.set_col ( 0, KFfep.mean() );
+
 	// FULL
-	KalmanFull KF2( A,B,C,D,R,Q,P0,mu0 );
-	mat Xt2(dimx,Ndat);	
-	Xt2.set_col( 0,mu0);
+	KalmanFull KF2 ( A, B, C, D, R, Q, P0, mu0 );
+	mat Xt2 ( dimx, Ndat );
+	Xt2.set_col ( 0, mu0 );
 
-	
+
 	// EKF
-	bilinfn fxu(A,B);
-	bilinfn hxu(C,D);
+	bilinfn fxu ( A, B );
+	bilinfn hxu ( C, D );
 	EKFCh KFE;
-	KFE.set_parameters(&fxu,&hxu,Q,R);
-	KFE.set_est(mu0,chmat(P0));
+	KFE.set_parameters ( &fxu, &hxu, Q, R );
+	KFE.set_est ( mu0, chmat ( P0 ) );
 	const epdf& KFEep = KFE.posterior();
-	mat XtE(dimx,Ndat);	
-	XtE.set_col( 0,KFEep.mean() );
+	mat XtE ( dimx, Ndat );
+	XtE.set_col ( 0, KFEep.mean() );
 
 	//test performance of each filter
 	Real_Timer tt;
-	vec exec_times(4); // KF, KFf KF2, KFE
-	
-	tt.tic();
-	for ( int t=1;t<Ndat;t++ ) {
-		KF.bayes( Dt.get_col( t ));
-		Xt.set_col( t,KFep.mean() );
-	}
-	exec_times(0) = tt.toc();
-	
-	tt.tic();
-	for ( int t=1;t<Ndat;t++ ) {
-		KFf.bayes( Dt.get_col( t ));
-		Xtf.set_col( t,KFfep.mean() );
-	}
-	exec_times(1) = tt.toc();
+	vec exec_times ( 4 ); // KF, KFf KF2, KFE
 
 	tt.tic();
-	for ( int t=1;t<Ndat;t++ ) {
-		KF2.bayes( Dt.get_col( t ));
-		Xt2.set_col( t,KF2.mu);
+	for ( int t = 1; t < Ndat; t++ ) {
+		KF.bayes ( Dt.get_col ( t ) );
+		Xt.set_col ( t, KFep.mean() );
 	}
-	exec_times(2) = tt.toc();
+	exec_times ( 0 ) = tt.toc();
 
 	tt.tic();
-	for ( int t=1;t<Ndat;t++ ) {
-		KFE.bayes( Dt.get_col( t ));
-		XtE.set_col( t,KFEep.mean() );
+	for ( int t = 1; t < Ndat; t++ ) {
+		KFf.bayes ( Dt.get_col ( t ) );
+		Xtf.set_col ( t, KFfep.mean() );
 	}
-	exec_times(3) = tt.toc();
+	exec_times ( 1 ) = tt.toc();
+
+	tt.tic();
+	for ( int t = 1; t < Ndat; t++ ) {
+		KF2.bayes ( Dt.get_col ( t ) );
+		Xt2.set_col ( t, KF2.mu );
+	}
+	exec_times ( 2 ) = tt.toc();
+
+	tt.tic();
+	for ( int t = 1; t < Ndat; t++ ) {
+		KFE.bayes ( Dt.get_col ( t ) );
+		XtE.set_col ( t, KFEep.mean() );
+	}
+	exec_times ( 3 ) = tt.toc();
 
 
-	it_file fou( "testKF_res.it" );
-	fou << Name("xth") << Xt;
-	fou << Name("xthf") << Xtf;
-	fou << Name("xth2") << Xt2;
-	fou << Name("xthE") << XtE;
-	fou << Name("exec_times") << exec_times;
+	it_file fou ( "testKF_res.it" );
+	fou << Name ( "xth" ) << Xt;
+	fou << Name ( "xthf" ) << Xtf;
+	fou << Name ( "xth2" ) << Xt2;
+	fou << Name ( "xthE" ) << XtE;
+	fou << Name ( "exec_times" ) << exec_times;
 	//Exit program:
 	return 0;
Index: library/tests/test_kalman_QR.cpp
===================================================================
--- library/tests/test_kalman_QR.cpp (revision 461)
+++ library/tests/test_kalman_QR.cpp (revision 477)
@@ -11,74 +11,79 @@
 int main() {
 	// Klaman filter
-	mat A, B,C,D,R,Q,P0;
+	mat A, B, C, D, R, Q, P0;
 	vec mu0;
 	mat Mu0;// read from matlab
 	// input from Matlab
-	it_file fin( "testKF.it" );
+	it_file fin ( "testKF.it" );
 
-	mat Dt, XQRt,eR,eQ;
+	mat Dt, XQRt, eR, eQ;
 	int Ndat;
 
-	bool xxx= fin.seek( "d" );
-	if (!xxx){ it_error("testKF.it not found");}
-	fin >>Dt;
-	fin.seek( "A" ); 
+	bool xxx = fin.seek ( "d" );
+	if ( !xxx ) {
+		it_error ( "testKF.it not found" );
+	}
+	fin >> Dt;
+	fin.seek ( "A" );
 	fin >> A;
-	fin.seek( "B" ); 
+	fin.seek ( "B" );
 	fin >> B;
-	fin.seek( "C" ); 
+	fin.seek ( "C" );
 	fin >> C;
-	fin.seek( "D" ); 
+	fin.seek ( "D" );
 	fin >> D;
-	fin.seek( "R" ); 
+	fin.seek ( "R" );
 	fin >> R;
-	fin.seek( "Q" ); fin >> Q;
-	fin.seek( "P0" ); fin >> P0;
-	fin.seek( "mu0" ); fin >> Mu0; 
-	mu0=Mu0.get_col(0);
-	
+	fin.seek ( "Q" );
+	fin >> Q;
+	fin.seek ( "P0" );
+	fin >> P0;
+	fin.seek ( "mu0" );
+	fin >> Mu0;
+	mu0 = Mu0.get_col ( 0 );
+
 	Ndat = Dt.cols();
-	XQRt=zeros( 5,Ndat );
-	mat Xt=zeros( 2,Ndat );
+	XQRt = zeros ( 5, Ndat );
+	mat Xt = zeros ( 2, Ndat );
 
 //	cout << KF;
-	RV rx("{x }","2");
-	RV ru("{u }","1");
-	RV ry("{y }","1");
-	RV rQR("{Q,R }","3");
+	RV rx ( "{x }", "2" );
+	RV ru ( "{u }", "1" );
+	RV ry ( "{y }", "1" );
+	RV rQR ( "{Q,R }", "3" );
 	//
 	KFcondQR KF;
 	// KF with R unknown
-	KF.set_parameters(A,B,C,D,ldmat(R),ldmat(Q));
-	KF.set_est(mu0,ldmat(P0) );
+	KF.set_parameters ( A, B, C, D, ldmat ( R ), ldmat ( Q ) );
+	KF.set_est ( mu0, ldmat ( P0 ) );
 	//
 	Kalman<ldmat> KFtr;
 	// KF with R unknown
-	KFtr.set_parameters(A,B,C,D,ldmat(R),ldmat(Q));
-	KFtr.set_est(mu0,ldmat(P0) );
-		
+	KFtr.set_parameters ( A, B, C, D, ldmat ( R ), ldmat ( Q ) );
+	KFtr.set_est ( mu0, ldmat ( P0 ) );
+
 	mgamma evolQR;
-	evolQR.set_parameters(10.0,"1 1 1"); //sigma = 1/10 mu
-	
+	evolQR.set_parameters ( 10.0, "1 1 1" ); //sigma = 1/10 mu
+
 	MPF<KFcondQR> KF_QR;
-	KF_QR.set_parameters(&evolQR,&evolQR,100);
-	evolQR.condition("1 1 1");
-	KF_QR.set_statistics(evolQR.e(), &KF);
-	const epdf& mpost=KF_QR.posterior();
-	const epdf& mposttr=KFtr.posterior();
+	KF_QR.set_parameters ( &evolQR, &evolQR, 100 );
+	evolQR.condition ( "1 1 1" );
+	KF_QR.set_statistics ( evolQR.e(), &KF );
+	const epdf& mpost = KF_QR.posterior();
+	const epdf& mposttr = KFtr.posterior();
 
-	XQRt.set_col( 0,mpost.mean());
-	Xt.set_col( 0,mposttr.mean());
-	for ( int t=1;t<Ndat;t++ ) {
-		KF_QR.bayes( Dt.get_col( t ));
-		KFtr.bayes( Dt.get_col( t ));
-		
-		XQRt.set_col(t,mpost.mean());
-		Xt.set_col(t,mposttr.mean());
+	XQRt.set_col ( 0, mpost.mean() );
+	Xt.set_col ( 0, mposttr.mean() );
+	for ( int t = 1; t < Ndat; t++ ) {
+		KF_QR.bayes ( Dt.get_col ( t ) );
+		KFtr.bayes ( Dt.get_col ( t ) );
+
+		XQRt.set_col ( t, mpost.mean() );
+		Xt.set_col ( t, mposttr.mean() );
 	}
-	
-	it_file fou( "testKF_QR_res.it" );
-	fou << Name("xqrth") << XQRt;
-	fou << Name("xth") << Xt;
+
+	it_file fou ( "testKF_QR_res.it" );
+	fou << Name ( "xqrth" ) << XQRt;
+	fou << Name ( "xth" ) << Xt;
 	//Exit program:
 	return 0;
Index: library/tests/square_mat_stress.cpp
===================================================================
--- library/tests/square_mat_stress.cpp (revision 468)
+++ library/tests/square_mat_stress.cpp (revision 477)
@@ -22,238 +22,237 @@
 
 namespace bdm {
-UIREGISTER(square_mat_point);
-}
-
-namespace UnitTest
-{
+UIREGISTER ( square_mat_point );
+}
+
+namespace UnitTest {
 
 // can't include mat_checks.h because CheckClose is different in this file
-extern bool AreClose(const itpp::vec &expected, const itpp::vec &actual,
-		     double tolerance);
-
-extern bool AreClose(const itpp::mat &expected, const itpp::mat &actual,
-		     double tolerance);
-
-void CheckClose(TestResults &results, const itpp::mat &expected,
-		const itpp::mat &actual, double tolerance,
-		TestDetails const& details) {
-    if (!AreClose(expected, actual, tolerance)) { 
-        MemoryOutStream stream;
-        stream << "failed at " << expected.rows()
-	       << " x " << expected.cols();
-
-        results.OnTestFailure(details, stream.GetText());
-    }
-}
-
-}
-
-typedef void (*FTestMatrix)(int, square_mat_point *);
+extern bool AreClose ( const itpp::vec &expected, const itpp::vec &actual,
+                       double tolerance );
+
+extern bool AreClose ( const itpp::mat &expected, const itpp::mat &actual,
+                       double tolerance );
+
+void CheckClose ( TestResults &results, const itpp::mat &expected,
+                  const itpp::mat &actual, double tolerance,
+                  TestDetails const& details ) {
+	if ( !AreClose ( expected, actual, tolerance ) ) {
+		MemoryOutStream stream;
+		stream << "failed at " << expected.rows()
+		<< " x " << expected.cols();
+
+		results.OnTestFailure ( details, stream.GetText() );
+	}
+}
+
+}
+
+typedef void ( *FTestMatrix ) ( int, square_mat_point * );
 
 template<typename TMatrix>
-void test_matrix(int index, square_mat_point *point) {
-    Real_Timer tt;
-	
-    cout << "agenda[" << index << "]:" << endl;
-    mat A = point->get_matrix();
-    int sz = A.rows();
-    CHECK_EQUAL(A.cols(), sz);
-
-    tt.tic();
-    TMatrix sqmat(A);
-    double elapsed = tt.toc();
-    cout << "ctor(" << sz << " x " << sz << "): " << elapsed << " s" << endl;
-
-    tt.tic();
-    mat res = sqmat.to_mat();
-    elapsed = tt.toc();
-
-    if (!fast) {
-        CHECK_CLOSE(A, res, epsilon);
-    }
-
-    cout << "to_mat: " << elapsed << " s" << endl;
-
-    vec v = point->get_vector();
-    double w = point->get_scalar();
-    TMatrix sqmat2 = sqmat;
-	
-    tt.tic();
-    sqmat2.opupdt(v, w);
-    elapsed = tt.toc();
-
-    if (!fast) {
-        mat expA = A + w * outer_product(v, v);
-	CHECK_CLOSE(expA, sqmat2.to_mat(), epsilon);
-    }
-
-    cout << "opupdt: " << elapsed << " s" << endl;
-
-    TMatrix invmat(sz);
-
-    tt.tic();
-    sqmat.inv(invmat);
-    elapsed = tt.toc();
-
-    mat invA;
-    if (!fast) {
-        invA = inv(A);
-	CHECK_CLOSE(invA, invmat.to_mat(), epsilon);
-    }
-
-    cout << "inv: " << elapsed << " s" << endl;
-
-    tt.tic();
-    double ld = sqmat.logdet();
-    elapsed = tt.toc();
-
-    if (!fast) {
-        double d = det(A);
-	CHECK_CLOSE(log(d), ld, epsilon);
-    }
-
-    cout << "logdet: " << elapsed << " s" << endl;
-
-    tt.tic();
-    double q = sqmat.qform(ones(sz));
-    elapsed = tt.toc();
-
-    if (!fast) {
-        CHECK_CLOSE(sumsum(A), q, epsilon);
-    }
-
-    cout << "qform(1): " << elapsed << " s" << endl;
-
-    tt.tic();
-    q = sqmat.qform(v);
-    elapsed = tt.toc();
-
-    if (!fast) {
-        double r = (A * v) * v;
-        CHECK_CLOSE(r, q, epsilon);
-    }
-
-    cout << "qform(v): " << elapsed << " s" << endl;
-
-    tt.tic();
-    q = sqmat.invqform(v);
-    elapsed = tt.toc();
-
-    if (!fast) {
-        double r = (invA * v) * v;
-	CHECK_CLOSE(r, q, epsilon);
-    }
-
-    cout << "invqform: " << elapsed << " s" << endl;
-
-    TMatrix twice = sqmat;
-
-    tt.tic();
-    twice += sqmat;
-    elapsed = tt.toc();
-
-    if (!fast) {
-        res = 2 * A;
-	CHECK_CLOSE(res, twice.to_mat(), epsilon);
-    }
-
-    cout << "+=: " << elapsed << " s" << endl;
-
-    sqmat2 = sqmat;
-
-    tt.tic();
-    sqmat2.mult_sym(A);
-    elapsed = tt.toc();
-
-    if (!fast) {
-        res = (A * A) * A.T();
-	CHECK_CLOSE(res, sqmat2.to_mat(), epsilon);
-    }
-
-    cout << "^2: " << elapsed << " s" << endl;
-}
-
-void test_agenda(FTestMatrix test) {
-    UIFile fag(agenda_file_name);
-    Array<square_mat_point *> mag;
-    UI::get(mag, fag, "agenda");
-    int sz = mag.size();
-    CHECK(sz > 0);
-    for (int i = 0; i < sz; ++i) {
-        test(i, mag(i));
-    }
-
-    for (int i = 0; i < sz; ++i) {
-        square_mat_point *p = mag(i);
-	mag(i) = 0;
-	delete p;
-    }
-}
-
-SUITE(ldmat) {
-    TEST(agenda) {
-        test_agenda(test_matrix<ldmat>);
-    }
-}
-
-SUITE(fsqmat) {
-    TEST(agenda) {
-        test_agenda(test_matrix<fsqmat>);
-    }
-}
-
-SUITE(chmat) {
-    TEST(agenda) {
-        test_agenda(test_matrix<chmat>);
-    }
-}
-
-int main(int argc, char const *argv[]) {
-    bool unknown = false;
-    int update_next = 0; // 1 suite, 2 epsilon, 3 agenda file
-    const char *suite = "ldmat";
-    const char **param = argv + 1;
-    while (*param && !unknown) {
-        if (update_next) {
-	    if (update_next == 1) {
-	        suite = *param;
-	    } else if (update_next == 2) {
-	        double eps = atof(*param);
-		if (eps > 0) {
-		    epsilon = eps;
+void test_matrix ( int index, square_mat_point *point ) {
+	Real_Timer tt;
+
+	cout << "agenda[" << index << "]:" << endl;
+	mat A = point->get_matrix();
+	int sz = A.rows();
+	CHECK_EQUAL ( A.cols(), sz );
+
+	tt.tic();
+	TMatrix sqmat ( A );
+	double elapsed = tt.toc();
+	cout << "ctor(" << sz << " x " << sz << "): " << elapsed << " s" << endl;
+
+	tt.tic();
+	mat res = sqmat.to_mat();
+	elapsed = tt.toc();
+
+	if ( !fast ) {
+		CHECK_CLOSE ( A, res, epsilon );
+	}
+
+	cout << "to_mat: " << elapsed << " s" << endl;
+
+	vec v = point->get_vector();
+	double w = point->get_scalar();
+	TMatrix sqmat2 = sqmat;
+
+	tt.tic();
+	sqmat2.opupdt ( v, w );
+	elapsed = tt.toc();
+
+	if ( !fast ) {
+		mat expA = A + w * outer_product ( v, v );
+		CHECK_CLOSE ( expA, sqmat2.to_mat(), epsilon );
+	}
+
+	cout << "opupdt: " << elapsed << " s" << endl;
+
+	TMatrix invmat ( sz );
+
+	tt.tic();
+	sqmat.inv ( invmat );
+	elapsed = tt.toc();
+
+	mat invA;
+	if ( !fast ) {
+		invA = inv ( A );
+		CHECK_CLOSE ( invA, invmat.to_mat(), epsilon );
+	}
+
+	cout << "inv: " << elapsed << " s" << endl;
+
+	tt.tic();
+	double ld = sqmat.logdet();
+	elapsed = tt.toc();
+
+	if ( !fast ) {
+		double d = det ( A );
+		CHECK_CLOSE ( log ( d ), ld, epsilon );
+	}
+
+	cout << "logdet: " << elapsed << " s" << endl;
+
+	tt.tic();
+	double q = sqmat.qform ( ones ( sz ) );
+	elapsed = tt.toc();
+
+	if ( !fast ) {
+		CHECK_CLOSE ( sumsum ( A ), q, epsilon );
+	}
+
+	cout << "qform(1): " << elapsed << " s" << endl;
+
+	tt.tic();
+	q = sqmat.qform ( v );
+	elapsed = tt.toc();
+
+	if ( !fast ) {
+		double r = ( A * v ) * v;
+		CHECK_CLOSE ( r, q, epsilon );
+	}
+
+	cout << "qform(v): " << elapsed << " s" << endl;
+
+	tt.tic();
+	q = sqmat.invqform ( v );
+	elapsed = tt.toc();
+
+	if ( !fast ) {
+		double r = ( invA * v ) * v;
+		CHECK_CLOSE ( r, q, epsilon );
+	}
+
+	cout << "invqform: " << elapsed << " s" << endl;
+
+	TMatrix twice = sqmat;
+
+	tt.tic();
+	twice += sqmat;
+	elapsed = tt.toc();
+
+	if ( !fast ) {
+		res = 2 * A;
+		CHECK_CLOSE ( res, twice.to_mat(), epsilon );
+	}
+
+	cout << "+=: " << elapsed << " s" << endl;
+
+	sqmat2 = sqmat;
+
+	tt.tic();
+	sqmat2.mult_sym ( A );
+	elapsed = tt.toc();
+
+	if ( !fast ) {
+		res = ( A * A ) * A.T();
+		CHECK_CLOSE ( res, sqmat2.to_mat(), epsilon );
+	}
+
+	cout << "^2: " << elapsed << " s" << endl;
+}
+
+void test_agenda ( FTestMatrix test ) {
+	UIFile fag ( agenda_file_name );
+	Array<square_mat_point *> mag;
+	UI::get ( mag, fag, "agenda" );
+	int sz = mag.size();
+	CHECK ( sz > 0 );
+	for ( int i = 0; i < sz; ++i ) {
+		test ( i, mag ( i ) );
+	}
+
+	for ( int i = 0; i < sz; ++i ) {
+		square_mat_point *p = mag ( i );
+		mag ( i ) = 0;
+		delete p;
+	}
+}
+
+SUITE ( ldmat ) {
+	TEST ( agenda ) {
+		test_agenda ( test_matrix<ldmat> );
+	}
+}
+
+SUITE ( fsqmat ) {
+	TEST ( agenda ) {
+		test_agenda ( test_matrix<fsqmat> );
+	}
+}
+
+SUITE ( chmat ) {
+	TEST ( agenda ) {
+		test_agenda ( test_matrix<chmat> );
+	}
+}
+
+int main ( int argc, char const *argv[] ) {
+	bool unknown = false;
+	int update_next = 0; // 1 suite, 2 epsilon, 3 agenda file
+	const char *suite = "ldmat";
+	const char **param = argv + 1;
+	while ( *param && !unknown ) {
+		if ( update_next ) {
+			if ( update_next == 1 ) {
+				suite = *param;
+			} else if ( update_next == 2 ) {
+				double eps = atof ( *param );
+				if ( eps > 0 ) {
+					epsilon = eps;
+				} else {
+					cerr << "invalid epsilon value ignored" << endl;
+				}
+			} else {
+				agenda_file_name = *param;
+			}
+
+			update_next = 0;
 		} else {
-		    cerr << "invalid epsilon value ignored" << endl;
+			if ( !strcmp ( *param, "-a" ) ) {
+				update_next = 3;
+			} else if ( !strcmp ( *param, "-c" ) ) {
+				update_next = 1;
+			} else if ( !strcmp ( *param, "-e" ) ) {
+				update_next = 2;
+			} else if ( !strcmp ( *param, "-f" ) ) {
+				fast = true;
+			} else {
+				unknown = true;
+			}
 		}
-	    } else {
-	        agenda_file_name = *param;
-	    }
-
-	    update_next = 0;
+
+		++param;
+	}
+
+	if ( unknown || update_next ) {
+		cerr << "usage: " << argv[0] << " [ -f ] [ -e epsilon ] [ -a agenda_input.cfg ] [ -c class ]" << endl;
 	} else {
-	    if (!strcmp(*param, "-a")) {
-	        update_next = 3;
-	    } else if (!strcmp(*param, "-c")) {
-	        update_next = 1;
-	    } else if (!strcmp(*param, "-e")) {
-	        update_next = 2;
-	    } else if (!strcmp(*param, "-f")) {
-		fast = true;
-	    } else {
-	        unknown = true;
-	    }
-	}
-
-	++param;
-    }
-
-    if (unknown || update_next) {
-        cerr << "usage: " << argv[0] << " [ -f ] [ -e epsilon ] [ -a agenda_input.cfg ] [ -c class ]" << endl;
-    } else {
-	UnitTest::TestReporterStdout reporter;
-	UnitTest::TestRunner runner(reporter);
-	return runner.RunTestsIf(UnitTest::Test::GetTestList(),
-	    suite,
-	    UnitTest::True(),
-	    0);
-    }
-}
+		UnitTest::TestReporterStdout reporter;
+		UnitTest::TestRunner runner ( reporter );
+		return runner.RunTestsIf ( UnitTest::Test::GetTestList(),
+		                           suite,
+		                           UnitTest::True(),
+		                           0 );
+	}
+}
Index: library/tests/mat_checks.h
===================================================================
--- library/tests/mat_checks.h (revision 465)
+++ library/tests/mat_checks.h (revision 477)
@@ -17,36 +17,35 @@
 #include "UnitTest++.h"
 
-namespace UnitTest
-{
+namespace UnitTest {
 
-bool AreClose(const itpp::vec &expected, const itpp::vec &actual,
-	      double tolerance);
+bool AreClose ( const itpp::vec &expected, const itpp::vec &actual,
+                double tolerance );
 
-bool AreClose(const itpp::vec &expected, const itpp::vec &actual,
-	      const itpp::vec &tolerance);
+bool AreClose ( const itpp::vec &expected, const itpp::vec &actual,
+                const itpp::vec &tolerance );
 
-bool AreClose(const itpp::mat &expected, const itpp::mat &actual,
-	      double tolerance);
+bool AreClose ( const itpp::mat &expected, const itpp::mat &actual,
+                double tolerance );
 
-inline void CheckClose(TestResults &results, const itpp::vec &expected,
-		       const itpp::vec &actual, double tolerance,
-		       TestDetails const &details) {
-    if (!AreClose(expected, actual, tolerance)) { 
-	MemoryOutStream stream;
-	stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
+inline void CheckClose ( TestResults &results, const itpp::vec &expected,
+                         const itpp::vec &actual, double tolerance,
+                         TestDetails const &details ) {
+	if ( !AreClose ( expected, actual, tolerance ) ) {
+		MemoryOutStream stream;
+		stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
 
-	results.OnTestFailure(details, stream.GetText());
-    }
+		results.OnTestFailure ( details, stream.GetText() );
+	}
 }
 
-inline void CheckClose(TestResults &results, const itpp::mat &expected,
-		       const itpp::mat &actual, double tolerance,
-		       TestDetails const &details) {
-    if (!AreClose(expected, actual, tolerance)) { 
-        MemoryOutStream stream;
-        stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
+inline void CheckClose ( TestResults &results, const itpp::mat &expected,
+                         const itpp::mat &actual, double tolerance,
+                         TestDetails const &details ) {
+	if ( !AreClose ( expected, actual, tolerance ) ) {
+		MemoryOutStream stream;
+		stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
 
-        results.OnTestFailure(details, stream.GetText());
-    }
+		results.OnTestFailure ( details, stream.GetText() );
+	}
 }
 
@@ -56,41 +55,40 @@
   blocks having an instance of this class (which sets the globals for
   error reporting). */
-class CurrentContext
-{
+class CurrentContext {
 private:
-    static const char *config_name;
-    static int index;
+	static const char *config_name;
+	static int index;
 
 public:
-    // the pointer must stay valid for the lifetime of the object
-    CurrentContext(const char *name, int idx);
-    ~CurrentContext();
+	// the pointer must stay valid for the lifetime of the object
+	CurrentContext ( const char *name, int idx );
+	~CurrentContext();
 
-    template<typename Expected, typename Actual>
-    static void CheckEqualEx(UnitTest::TestResults& results,
-			     Expected const& expected,
-			     Actual const& actual,
-			     UnitTest::TestDetails const& details) {
-	if (!(expected == actual)) {
-	    UnitTest::MemoryOutStream stream;
-	    stream << "error at " << config_name << '[' << index << "]: expected " << expected << " but was " << actual;
+	template<typename Expected, typename Actual>
+	static void CheckEqualEx ( UnitTest::TestResults& results,
+	                           Expected const& expected,
+	                           Actual const& actual,
+	                           UnitTest::TestDetails const& details ) {
+		if ( ! ( expected == actual ) ) {
+			UnitTest::MemoryOutStream stream;
+			stream << "error at " << config_name << '[' << index << "]: expected " << expected << " but was " << actual;
 
-	    results.OnTestFailure(details, stream.GetText());
+			results.OnTestFailure ( details, stream.GetText() );
+		}
 	}
-    }
 
-    template<typename Expected, typename Actual, typename Tolerance>
-    static void CheckCloseEx(UnitTest::TestResults& results,
-			     Expected const& expected,
-			     Actual const& actual,
-			     Tolerance const& tolerance,
-			     UnitTest::TestDetails const& details) {
-        if (!UnitTest::AreClose(expected, actual, tolerance)) { 
-	    UnitTest::MemoryOutStream stream;
-	    stream << "error at " << config_name << '[' << index << "]: expected " << expected << " +/- " << tolerance << " but was " << actual;
+	template<typename Expected, typename Actual, typename Tolerance>
+	static void CheckCloseEx ( UnitTest::TestResults& results,
+	                           Expected const& expected,
+	                           Actual const& actual,
+	                           Tolerance const& tolerance,
+	                           UnitTest::TestDetails const& details ) {
+		if ( !UnitTest::AreClose ( expected, actual, tolerance ) ) {
+			UnitTest::MemoryOutStream stream;
+			stream << "error at " << config_name << '[' << index << "]: expected " << expected << " +/- " << tolerance << " but was " << actual;
 
-	    results.OnTestFailure(details, stream.GetText());
+			results.OnTestFailure ( details, stream.GetText() );
+		}
 	}
-    }
 };
 
Index: library/tests/unittest-cpp/TestSuite.h
===================================================================
--- library/tests/unittest-cpp/TestSuite.h (revision 418)
+++ library/tests/unittest-cpp/TestSuite.h (revision 477)
@@ -2,10 +2,8 @@
 #define UNITTEST_TESTSUITE_H
 
-namespace UnitTestSuite 
-{
-    inline char const* GetSuiteName ()
-    {
-        return "DefaultSuite";
-    }
+namespace UnitTestSuite {
+inline char const* GetSuiteName () {
+	return "DefaultSuite";
+}
 }
 
Index: library/tests/unittest-cpp/ReportAssert.h
===================================================================
--- library/tests/unittest-cpp/ReportAssert.h (revision 418)
+++ library/tests/unittest-cpp/ReportAssert.h (revision 477)
@@ -4,6 +4,6 @@
 namespace UnitTest {
 
-void ReportAssert(char const* description, char const* filename, int lineNumber);
-    
+void ReportAssert ( char const* description, char const* filename, int lineNumber );
+
 }
 
Index: library/tests/unittest-cpp/TimeConstraint.cpp
===================================================================
--- library/tests/unittest-cpp/TimeConstraint.cpp (revision 418)
+++ library/tests/unittest-cpp/TimeConstraint.cpp (revision 477)
@@ -7,22 +7,19 @@
 
 
-TimeConstraint::TimeConstraint(int ms, TestDetails const& details)
-	: m_details(details)
-    , m_maxMs(ms)
-{
-    m_timer.Start();
+TimeConstraint::TimeConstraint ( int ms, TestDetails const& details )
+		: m_details ( details )
+		, m_maxMs ( ms ) {
+	m_timer.Start();
 }
 
-TimeConstraint::~TimeConstraint()
-{
-    double const totalTimeInMs = m_timer.GetTimeInMs();
-    if (totalTimeInMs > m_maxMs)
-    {
-        MemoryOutStream stream;
-        stream << "Time constraint failed. Expected to run test under " << m_maxMs <<
-                  "ms but took " << totalTimeInMs << "ms.";
+TimeConstraint::~TimeConstraint() {
+	double const totalTimeInMs = m_timer.GetTimeInMs();
+	if ( totalTimeInMs > m_maxMs ) {
+		MemoryOutStream stream;
+		stream << "Time constraint failed. Expected to run test under " << m_maxMs <<
+		"ms but took " << totalTimeInMs << "ms.";
 
-		UnitTest::CurrentTest::Results()->OnTestFailure(m_details, stream.GetText());
-    }
+		UnitTest::CurrentTest::Results()->OnTestFailure ( m_details, stream.GetText() );
+	}
 }
 
Index: library/tests/unittest-cpp/Checks.h
===================================================================
--- library/tests/unittest-cpp/Checks.h (revision 418)
+++ library/tests/unittest-cpp/Checks.h (revision 477)
@@ -10,146 +10,131 @@
 
 template< typename Value >
-bool Check(Value const value)
-{
-    return !!value; // doing double negative to avoid silly VS warnings
+bool Check ( Value const value ) {
+	return !!value; // doing double negative to avoid silly VS warnings
 }
 
 
 template< typename Expected, typename Actual >
-void CheckEqual(TestResults& results, Expected const& expected, Actual const& actual, TestDetails const& details)
-{
-    if (!(expected == actual))
-    {
-        UnitTest::MemoryOutStream stream;
-        stream << "Expected " << expected << " but was " << actual;
+void CheckEqual ( TestResults& results, Expected const& expected, Actual const& actual, TestDetails const& details ) {
+	if ( ! ( expected == actual ) ) {
+		UnitTest::MemoryOutStream stream;
+		stream << "Expected " << expected << " but was " << actual;
 
-        results.OnTestFailure(details, stream.GetText());
-    }
+		results.OnTestFailure ( details, stream.GetText() );
+	}
 }
 
-void CheckEqual(TestResults& results, char const* expected, char const* actual, TestDetails const& details);
+void CheckEqual ( TestResults& results, char const* expected, char const* actual, TestDetails const& details );
 
-void CheckEqual(TestResults& results, char* expected, char* actual, TestDetails const& details);
+void CheckEqual ( TestResults& results, char* expected, char* actual, TestDetails const& details );
 
-void CheckEqual(TestResults& results, char* expected, char const* actual, TestDetails const& details);
+void CheckEqual ( TestResults& results, char* expected, char const* actual, TestDetails const& details );
 
-void CheckEqual(TestResults& results, char const* expected, char* actual, TestDetails const& details);
+void CheckEqual ( TestResults& results, char const* expected, char* actual, TestDetails const& details );
 
 template< typename Expected, typename Actual, typename Tolerance >
-bool AreClose(Expected const& expected, Actual const& actual, Tolerance const& tolerance)
-{
-    return (actual >= (expected - tolerance)) && (actual <= (expected + tolerance));
+bool AreClose ( Expected const& expected, Actual const& actual, Tolerance const& tolerance ) {
+	return ( actual >= ( expected - tolerance ) ) && ( actual <= ( expected + tolerance ) );
 }
 
 template< typename Expected, typename Actual, typename Tolerance >
-void CheckClose(TestResults& results, Expected const& expected, Actual const& actual, Tolerance const& tolerance,
-                TestDetails const& details)
-{
-    if (!AreClose(expected, actual, tolerance))
-    { 
-        UnitTest::MemoryOutStream stream;
-        stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
+void CheckClose ( TestResults& results, Expected const& expected, Actual const& actual, Tolerance const& tolerance,
+                  TestDetails const& details ) {
+	if ( !AreClose ( expected, actual, tolerance ) ) {
+		UnitTest::MemoryOutStream stream;
+		stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual;
 
-        results.OnTestFailure(details, stream.GetText());
-    }
+		results.OnTestFailure ( details, stream.GetText() );
+	}
 }
 
 
 template< typename Expected, typename Actual >
-void CheckArrayEqual(TestResults& results, Expected const& expected, Actual const& actual,
-                int const count, TestDetails const& details)
-{
-    bool equal = true;
-    for (int i = 0; i < count; ++i)
-        equal &= (expected[i] == actual[i]);
+void CheckArrayEqual ( TestResults& results, Expected const& expected, Actual const& actual,
+                       int const count, TestDetails const& details ) {
+	bool equal = true;
+	for ( int i = 0; i < count; ++i )
+		equal &= ( expected[i] == actual[i] );
 
-    if (!equal)
-    {
-        UnitTest::MemoryOutStream stream;
+	if ( !equal ) {
+		UnitTest::MemoryOutStream stream;
 
 		stream << "Expected [ ";
 
-		for (int expectedIndex = 0; expectedIndex < count; ++expectedIndex)
-            stream << expected[expectedIndex] << " ";
+		for ( int expectedIndex = 0; expectedIndex < count; ++expectedIndex )
+			stream << expected[expectedIndex] << " ";
 
 		stream << "] but was [ ";
 
-		for (int actualIndex = 0; actualIndex < count; ++actualIndex)
-            stream << actual[actualIndex] << " ";
+		for ( int actualIndex = 0; actualIndex < count; ++actualIndex )
+			stream << actual[actualIndex] << " ";
 
 		stream << "]";
 
-        results.OnTestFailure(details, stream.GetText());
-    }
+		results.OnTestFailure ( details, stream.GetText() );
+	}
 }
 
 template< typename Expected, typename Actual, typename Tolerance >
-bool ArrayAreClose(Expected const& expected, Actual const& actual, int const count, Tolerance const& tolerance)
-{
-    bool equal = true;
-    for (int i = 0; i < count; ++i)
-        equal &= AreClose(expected[i], actual[i], tolerance);
-    return equal;
+bool ArrayAreClose ( Expected const& expected, Actual const& actual, int const count, Tolerance const& tolerance ) {
+	bool equal = true;
+	for ( int i = 0; i < count; ++i )
+		equal &= AreClose ( expected[i], actual[i], tolerance );
+	return equal;
 }
 
 template< typename Expected, typename Actual, typename Tolerance >
-void CheckArrayClose(TestResults& results, Expected const& expected, Actual const& actual,
-                   int const count, Tolerance const& tolerance, TestDetails const& details)
-{
-    bool equal = ArrayAreClose(expected, actual, count, tolerance);
+void CheckArrayClose ( TestResults& results, Expected const& expected, Actual const& actual,
+                       int const count, Tolerance const& tolerance, TestDetails const& details ) {
+	bool equal = ArrayAreClose ( expected, actual, count, tolerance );
 
-    if (!equal)
-    {
-        UnitTest::MemoryOutStream stream;
+	if ( !equal ) {
+		UnitTest::MemoryOutStream stream;
 
-        stream << "Expected [ ";
-        for (int expectedIndex = 0; expectedIndex < count; ++expectedIndex)
-            stream << expected[expectedIndex] << " ";
-        stream << "] +/- " << tolerance << " but was [ ";
+		stream << "Expected [ ";
+		for ( int expectedIndex = 0; expectedIndex < count; ++expectedIndex )
+			stream << expected[expectedIndex] << " ";
+		stream << "] +/- " << tolerance << " but was [ ";
 
-		for (int actualIndex = 0; actualIndex < count; ++actualIndex)
-            stream << actual[actualIndex] << " ";
-        stream << "]";
+		for ( int actualIndex = 0; actualIndex < count; ++actualIndex )
+			stream << actual[actualIndex] << " ";
+		stream << "]";
 
-        results.OnTestFailure(details, stream.GetText());
-    }
+		results.OnTestFailure ( details, stream.GetText() );
+	}
 }
 
 template< typename Expected, typename Actual, typename Tolerance >
-void CheckArray2DClose(TestResults& results, Expected const& expected, Actual const& actual,
-                   int const rows, int const columns, Tolerance const& tolerance, TestDetails const& details)
-{
-    bool equal = true;
-    for (int i = 0; i < rows; ++i)
-        equal &= ArrayAreClose(expected[i], actual[i], columns, tolerance);
+void CheckArray2DClose ( TestResults& results, Expected const& expected, Actual const& actual,
+                         int const rows, int const columns, Tolerance const& tolerance, TestDetails const& details ) {
+	bool equal = true;
+	for ( int i = 0; i < rows; ++i )
+		equal &= ArrayAreClose ( expected[i], actual[i], columns, tolerance );
 
-    if (!equal)
-    {
-        UnitTest::MemoryOutStream stream;
+	if ( !equal ) {
+		UnitTest::MemoryOutStream stream;
 
-        stream << "Expected [ ";    
+		stream << "Expected [ ";
 
-		for (int expectedRow = 0; expectedRow < rows; ++expectedRow)
-        {
-            stream << "[ ";
-            for (int expectedColumn = 0; expectedColumn < columns; ++expectedColumn)
-                stream << expected[expectedRow][expectedColumn] << " ";
-            stream << "] ";
-        }
+		for ( int expectedRow = 0; expectedRow < rows; ++expectedRow ) {
+			stream << "[ ";
+			for ( int expectedColumn = 0; expectedColumn < columns; ++expectedColumn )
+				stream << expected[expectedRow][expectedColumn] << " ";
+			stream << "] ";
+		}
 
 		stream << "] +/- " << tolerance << " but was [ ";
 
-		for (int actualRow = 0; actualRow < rows; ++actualRow)
-        {
-            stream << "[ ";
-            for (int actualColumn = 0; actualColumn < columns; ++actualColumn)
-                stream << actual[actualRow][actualColumn] << " ";
-            stream << "] ";
-        }
+		for ( int actualRow = 0; actualRow < rows; ++actualRow ) {
+			stream << "[ ";
+			for ( int actualColumn = 0; actualColumn < columns; ++actualColumn )
+				stream << actual[actualRow][actualColumn] << " ";
+			stream << "] ";
+		}
 
 		stream << "]";
 
-        results.OnTestFailure(details, stream.GetText());
-    }
+		results.OnTestFailure ( details, stream.GetText() );
+	}
 }
 
Index: library/tests/unittest-cpp/TestResults.h
===================================================================
--- library/tests/unittest-cpp/TestResults.h (revision 418)
+++ library/tests/unittest-cpp/TestResults.h (revision 477)
@@ -7,27 +7,26 @@
 class TestDetails;
 
-class TestResults
-{
+class TestResults {
 public:
-    explicit TestResults(TestReporter* reporter = 0);
+	explicit TestResults ( TestReporter* reporter = 0 );
 
-    void OnTestStart(TestDetails const& test);
-    void OnTestFailure(TestDetails const& test, char const* failure);
-    void OnTestFinish(TestDetails const& test, float secondsElapsed);
+	void OnTestStart ( TestDetails const& test );
+	void OnTestFailure ( TestDetails const& test, char const* failure );
+	void OnTestFinish ( TestDetails const& test, float secondsElapsed );
 
-    int GetTotalTestCount() const;
-    int GetFailedTestCount() const;
-    int GetFailureCount() const;
+	int GetTotalTestCount() const;
+	int GetFailedTestCount() const;
+	int GetFailureCount() const;
 
 private:
-    TestReporter* m_testReporter;
-    int m_totalTestCount;
-    int m_failedTestCount;
-    int m_failureCount;
+	TestReporter* m_testReporter;
+	int m_totalTestCount;
+	int m_failedTestCount;
+	int m_failureCount;
 
-    bool m_currentTestFailed;
+	bool m_currentTestFailed;
 
-    TestResults(TestResults const&);
-    TestResults& operator =(TestResults const&);
+	TestResults ( TestResults const& );
+	TestResults& operator = ( TestResults const& );
 };
 
Index: library/tests/unittest-cpp/TestReporter.h
===================================================================
--- library/tests/unittest-cpp/TestReporter.h (revision 418)
+++ library/tests/unittest-cpp/TestReporter.h (revision 477)
@@ -6,13 +6,12 @@
 class TestDetails;
 
-class TestReporter
-{
+class TestReporter {
 public:
-    virtual ~TestReporter();
+	virtual ~TestReporter();
 
-    virtual void ReportTestStart(TestDetails const& test) = 0;
-    virtual void ReportFailure(TestDetails const& test, char const* failure) = 0;
-    virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed) = 0;
-    virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) = 0;
+	virtual void ReportTestStart ( TestDetails const& test ) = 0;
+	virtual void ReportFailure ( TestDetails const& test, char const* failure ) = 0;
+	virtual void ReportTestFinish ( TestDetails const& test, float secondsElapsed ) = 0;
+	virtual void ReportSummary ( int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed ) = 0;
 };
 
Index: library/tests/unittest-cpp/ExecuteTest.h
===================================================================
--- library/tests/unittest-cpp/ExecuteTest.h (revision 418)
+++ library/tests/unittest-cpp/ExecuteTest.h (revision 477)
@@ -8,5 +8,5 @@
 
 #ifdef UNITTEST_POSIX
-	#include "Posix/SignalTranslator.h"
+#include "Posix/SignalTranslator.h"
 #endif
 
@@ -14,29 +14,21 @@
 
 template< typename T >
-void ExecuteTest(T& testObject, TestDetails const& details)
-{
+void ExecuteTest ( T& testObject, TestDetails const& details ) {
 	CurrentTest::Details() = &details;
 
-	try
-	{
+	try {
 #ifdef UNITTEST_POSIX
 		UNITTEST_THROW_SIGNALS
 #endif
 		testObject.RunImpl();
-	}
-	catch (AssertException const& e)
-	{
-		CurrentTest::Results()->OnTestFailure(
-			TestDetails(details.testName, details.suiteName, e.Filename(), e.LineNumber()), e.what());
-	}
-	catch (std::exception const& e)
-	{
+	} catch ( AssertException const& e ) {
+		CurrentTest::Results()->OnTestFailure (
+		    TestDetails ( details.testName, details.suiteName, e.Filename(), e.LineNumber() ), e.what() );
+	} catch ( std::exception const& e ) {
 		MemoryOutStream stream;
 		stream << "Unhandled exception: " << e.what();
-		CurrentTest::Results()->OnTestFailure(details, stream.GetText());
-	}
-	catch (...)
-	{
-		CurrentTest::Results()->OnTestFailure(details, "Unhandled exception: Crash!");
+		CurrentTest::Results()->OnTestFailure ( details, stream.GetText() );
+	} catch ( ... ) {
+		CurrentTest::Results()->OnTestFailure ( details, "Unhandled exception: Crash!" );
 	}
 }
Index: library/tests/unittest-cpp/DeferredTestReporter.h
===================================================================
--- library/tests/unittest-cpp/DeferredTestReporter.h (revision 418)
+++ library/tests/unittest-cpp/DeferredTestReporter.h (revision 477)
@@ -8,19 +8,17 @@
 #include <vector>
 
-namespace UnitTest
-{
+namespace UnitTest {
 
-class DeferredTestReporter : public TestReporter
-{
+class DeferredTestReporter : public TestReporter {
 public:
-    virtual void ReportTestStart(TestDetails const& details);
-    virtual void ReportFailure(TestDetails const& details, char const* failure);
-    virtual void ReportTestFinish(TestDetails const& details, float secondsElapsed);
+	virtual void ReportTestStart ( TestDetails const& details );
+	virtual void ReportFailure ( TestDetails const& details, char const* failure );
+	virtual void ReportTestFinish ( TestDetails const& details, float secondsElapsed );
 
-    typedef std::vector< DeferredTestResult > DeferredTestResultList;
-    DeferredTestResultList& GetResults();
+	typedef std::vector< DeferredTestResult > DeferredTestResultList;
+	DeferredTestResultList& GetResults();
 
 private:
-    DeferredTestResultList m_results;
+	DeferredTestResultList m_results;
 };
 
Index: library/tests/unittest-cpp/TestRunner.cpp
===================================================================
--- library/tests/unittest-cpp/TestRunner.cpp (revision 418)
+++ library/tests/unittest-cpp/TestRunner.cpp (revision 477)
@@ -11,45 +11,39 @@
 namespace UnitTest {
 
-int RunAllTests()
-{
+int RunAllTests() {
 	TestReporterStdout reporter;
-	TestRunner runner(reporter);
-	return runner.RunTestsIf(Test::GetTestList(), NULL, True(), 0);
+	TestRunner runner ( reporter );
+	return runner.RunTestsIf ( Test::GetTestList(), NULL, True(), 0 );
 }
 
 
-TestRunner::TestRunner(TestReporter& reporter)
-	: m_reporter(&reporter)
-	, m_result(new TestResults(&reporter))
-	, m_timer(new Timer)
-{
+TestRunner::TestRunner ( TestReporter& reporter )
+		: m_reporter ( &reporter )
+		, m_result ( new TestResults ( &reporter ) )
+		, m_timer ( new Timer ) {
 	m_timer->Start();
 }
 
-TestRunner::~TestRunner()
-{
+TestRunner::~TestRunner() {
 	delete m_result;
 	delete m_timer;
 }
 
-int TestRunner::Finish() const
-{
-    float const secondsElapsed = static_cast<float>(m_timer->GetTimeInMs() / 1000.0);
-    m_reporter->ReportSummary(m_result->GetTotalTestCount(), 
-							  m_result->GetFailedTestCount(), 
-							  m_result->GetFailureCount(), 
-							  secondsElapsed);
-    
+int TestRunner::Finish() const {
+	float const secondsElapsed = static_cast<float> ( m_timer->GetTimeInMs() / 1000.0 );
+	m_reporter->ReportSummary ( m_result->GetTotalTestCount(),
+	                            m_result->GetFailedTestCount(),
+	                            m_result->GetFailureCount(),
+	                            secondsElapsed );
+
 	return m_result->GetFailureCount();
 }
 
-bool TestRunner::IsTestInSuite(const Test* const curTest, char const* suiteName) const
-{
+bool TestRunner::IsTestInSuite ( const Test* const curTest, char const* suiteName ) const {
 	using namespace std;
-	return (suiteName == NULL) || !strcmp(curTest->m_details.suiteName, suiteName);
+	return ( suiteName == NULL ) || !strcmp ( curTest->m_details.suiteName, suiteName );
 }
 
-void TestRunner::RunTest(TestResults* const result, Test* const curTest, int const maxTestTimeInMs) const
-{
+void TestRunner::RunTest ( TestResults* const result, Test* const curTest, int const maxTestTimeInMs ) const {
 	CurrentTest::Results() = result;
 
@@ -57,19 +51,18 @@
 	testTimer.Start();
 
-	result->OnTestStart(curTest->m_details);
+	result->OnTestStart ( curTest->m_details );
 
 	curTest->Run();
 
 	double const testTimeInMs = testTimer.GetTimeInMs();
-	if (maxTestTimeInMs > 0 && testTimeInMs > maxTestTimeInMs && !curTest->m_timeConstraintExempt)
-	{
-	    MemoryOutStream stream;
-	    stream << "Global time constraint failed. Expected under " << maxTestTimeInMs <<
-	            "ms but took " << testTimeInMs << "ms.";
+	if ( maxTestTimeInMs > 0 && testTimeInMs > maxTestTimeInMs && !curTest->m_timeConstraintExempt ) {
+		MemoryOutStream stream;
+		stream << "Global time constraint failed. Expected under " << maxTestTimeInMs <<
+		"ms but took " << testTimeInMs << "ms.";
 
-	    result->OnTestFailure(curTest->m_details, stream.GetText());
+		result->OnTestFailure ( curTest->m_details, stream.GetText() );
 	}
 
-	result->OnTestFinish(curTest->m_details, static_cast<float>(testTimeInMs/1000.0));
+	result->OnTestFinish ( curTest->m_details, static_cast<float> ( testTimeInMs / 1000.0 ) );
 }
 
Index: library/tests/unittest-cpp/TestReporterStdout.h
===================================================================
--- library/tests/unittest-cpp/TestReporterStdout.h (revision 418)
+++ library/tests/unittest-cpp/TestReporterStdout.h (revision 477)
@@ -6,14 +6,13 @@
 namespace UnitTest {
 
-class TestReporterStdout : public TestReporter
-{
+class TestReporterStdout : public TestReporter {
 private:
-    virtual void ReportTestStart(TestDetails const& test);
-    virtual void ReportFailure(TestDetails const& test, char const* failure);
-    virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed);
-    virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
+	virtual void ReportTestStart ( TestDetails const& test );
+	virtual void ReportFailure ( TestDetails const& test, char const* failure );
+	virtual void ReportTestFinish ( TestDetails const& test, float secondsElapsed );
+	virtual void ReportSummary ( int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed );
 };
 
 }
 
-#endif 
+#endif
Index: library/tests/unittest-cpp/MemoryOutStream.cpp
===================================================================
--- library/tests/unittest-cpp/MemoryOutStream.cpp (revision 418)
+++ library/tests/unittest-cpp/MemoryOutStream.cpp (revision 477)
@@ -6,8 +6,7 @@
 namespace UnitTest {
 
-char const* MemoryOutStream::GetText() const
-{
-    m_text = this->str();
-    return m_text.c_str();
+char const* MemoryOutStream::GetText() const {
+	m_text = this->str();
+	return m_text.c_str();
 }
 
@@ -27,16 +26,14 @@
 
 template<typename ValueType>
-void FormatToStream(MemoryOutStream& stream, char const* format, ValueType const& value)
-{
+void FormatToStream ( MemoryOutStream& stream, char const* format, ValueType const& value ) {
 	using namespace std;
 
-    char txt[32];
-    sprintf(txt, format, value);
-    stream << txt;
+	char txt[32];
+	sprintf ( txt, format, value );
+	stream << txt;
 }
 
-int RoundUpToMultipleOfPow2Number (int n, int pow2Number)
-{
-    return (n + (pow2Number - 1)) & ~(pow2Number - 1);
+int RoundUpToMultipleOfPow2Number ( int n, int pow2Number ) {
+	return ( n + ( pow2Number - 1 ) ) & ~ ( pow2Number - 1 );
 }
 
@@ -44,102 +41,89 @@
 
 
-MemoryOutStream::MemoryOutStream(int const size)
-    : m_capacity (0)
-    , m_buffer (0)
+MemoryOutStream::MemoryOutStream ( int const size )
+		: m_capacity ( 0 )
+		, m_buffer ( 0 )
 
 {
-    GrowBuffer(size);
+	GrowBuffer ( size );
 }
 
-MemoryOutStream::~MemoryOutStream()
-{
-    delete [] m_buffer;
+MemoryOutStream::~MemoryOutStream() {
+	delete [] m_buffer;
 }
 
-char const* MemoryOutStream::GetText() const
-{
-    return m_buffer;
+char const* MemoryOutStream::GetText() const {
+	return m_buffer;
 }
 
-MemoryOutStream& MemoryOutStream::operator << (char const* txt)
-{
+MemoryOutStream& MemoryOutStream::operator << ( char const* txt ) {
 	using namespace std;
 
-    int const bytesLeft = m_capacity - (int)strlen(m_buffer);
-    int const bytesRequired = (int)strlen(txt) + 1;
+	int const bytesLeft = m_capacity - ( int ) strlen ( m_buffer );
+	int const bytesRequired = ( int ) strlen ( txt ) + 1;
 
-    if (bytesRequired > bytesLeft)
-    {
-        int const requiredCapacity = bytesRequired + m_capacity - bytesLeft;
-        GrowBuffer(requiredCapacity);
-    }
+	if ( bytesRequired > bytesLeft ) {
+		int const requiredCapacity = bytesRequired + m_capacity - bytesLeft;
+		GrowBuffer ( requiredCapacity );
+	}
 
-    strcat(m_buffer, txt);
-    return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (int const n)
-{
-    FormatToStream(*this, "%i", n);
-    return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (long const n)
-{
-    FormatToStream(*this, "%li", n);
-    return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (unsigned long const n)
-{
-    FormatToStream(*this, "%lu", n);
-    return *this;
-}
-
-MemoryOutStream& MemoryOutStream::operator << (float const f)
-{
-    FormatToStream(*this, "%ff", f);
-    return *this;    
-}
-
-MemoryOutStream& MemoryOutStream::operator << (void const* p)
-{
-    FormatToStream(*this, "%p", p);
-    return *this;    
-}
-
-MemoryOutStream& MemoryOutStream::operator << (unsigned int const s)
-{
-    FormatToStream(*this, "%u", s);
-    return *this;    
-}
-
-MemoryOutStream& MemoryOutStream::operator <<(double const d)
-{
-	FormatToStream(*this, "%f", d);
+	strcat ( m_buffer, txt );
 	return *this;
 }
 
-int MemoryOutStream::GetCapacity() const
-{
-    return m_capacity;
+MemoryOutStream& MemoryOutStream::operator << ( int const n ) {
+	FormatToStream ( *this, "%i", n );
+	return *this;
+}
+
+MemoryOutStream& MemoryOutStream::operator << ( long const n ) {
+	FormatToStream ( *this, "%li", n );
+	return *this;
+}
+
+MemoryOutStream& MemoryOutStream::operator << ( unsigned long const n ) {
+	FormatToStream ( *this, "%lu", n );
+	return *this;
+}
+
+MemoryOutStream& MemoryOutStream::operator << ( float const f ) {
+	FormatToStream ( *this, "%ff", f );
+	return *this;
+}
+
+MemoryOutStream& MemoryOutStream::operator << ( void const* p ) {
+	FormatToStream ( *this, "%p", p );
+	return *this;
+}
+
+MemoryOutStream& MemoryOutStream::operator << ( unsigned int const s ) {
+	FormatToStream ( *this, "%u", s );
+	return *this;
+}
+
+MemoryOutStream& MemoryOutStream::operator << ( double const d ) {
+	FormatToStream ( *this, "%f", d );
+	return *this;
+}
+
+int MemoryOutStream::GetCapacity() const {
+	return m_capacity;
 }
 
 
-void MemoryOutStream::GrowBuffer(int const desiredCapacity)
-{
-    int const newCapacity = RoundUpToMultipleOfPow2Number(desiredCapacity, GROW_CHUNK_SIZE);
+void MemoryOutStream::GrowBuffer ( int const desiredCapacity ) {
+	int const newCapacity = RoundUpToMultipleOfPow2Number ( desiredCapacity, GROW_CHUNK_SIZE );
 
 	using namespace std;
 
-    char* buffer = new char[newCapacity];
-    if (m_buffer)
-        strcpy(buffer, m_buffer);
-    else
-        strcpy(buffer, "");
+	char* buffer = new char[newCapacity];
+	if ( m_buffer )
+		strcpy ( buffer, m_buffer );
+	else
+		strcpy ( buffer, "" );
 
-    delete [] m_buffer;
-    m_buffer = buffer;
-    m_capacity = newCapacity;
+	delete [] m_buffer;
+	m_buffer = buffer;
+	m_capacity = newCapacity;
 }
 
Index: library/tests/unittest-cpp/DeferredTestResult.cpp
===================================================================
--- library/tests/unittest-cpp/DeferredTestResult.cpp (revision 418)
+++ library/tests/unittest-cpp/DeferredTestResult.cpp (revision 477)
@@ -2,27 +2,23 @@
 #include "Config.h"
 
-namespace UnitTest
-{
+namespace UnitTest {
 
 DeferredTestResult::DeferredTestResult()
-	: suiteName("")
-	, testName("")
-	, failureFile("")
-	, timeElapsed(0.0f)
-	, failed(false)
-{
+		: suiteName ( "" )
+		, testName ( "" )
+		, failureFile ( "" )
+		, timeElapsed ( 0.0f )
+		, failed ( false ) {
 }
 
-DeferredTestResult::DeferredTestResult(char const* suite, char const* test)
-	: suiteName(suite)
-	, testName(test)
-	, failureFile("")
-	, timeElapsed(0.0f)
-	, failed(false)
-{
+DeferredTestResult::DeferredTestResult ( char const* suite, char const* test )
+		: suiteName ( suite )
+		, testName ( test )
+		, failureFile ( "" )
+		, timeElapsed ( 0.0f )
+		, failed ( false ) {
 }
 
-DeferredTestResult::~DeferredTestResult()
-{
+DeferredTestResult::~DeferredTestResult() {
 }
 
Index: library/tests/unittest-cpp/TestList.h
===================================================================
--- library/tests/unittest-cpp/TestList.h (revision 418)
+++ library/tests/unittest-cpp/TestList.h (revision 477)
@@ -7,22 +7,20 @@
 class Test;
 
-class TestList
-{
+class TestList {
 public:
-    TestList();
-    void Add (Test* test);
+	TestList();
+	void Add ( Test* test );
 
-    Test* GetHead() const;
+	Test* GetHead() const;
 
 private:
-    Test* m_head;
-    Test* m_tail;
+	Test* m_head;
+	Test* m_tail;
 };
 
 
-class ListAdder
-{
+class ListAdder {
 public:
-    ListAdder(TestList& list, Test* test);
+	ListAdder ( TestList& list, Test* test );
 };
 
Index: library/tests/unittest-cpp/AssertException.cpp
===================================================================
--- library/tests/unittest-cpp/AssertException.cpp (revision 418)
+++ library/tests/unittest-cpp/AssertException.cpp (revision 477)
@@ -4,30 +4,25 @@
 namespace UnitTest {
 
-AssertException::AssertException(char const* description, char const* filename, int lineNumber)
-    : m_lineNumber(lineNumber)
-{
+AssertException::AssertException ( char const* description, char const* filename, int lineNumber )
+		: m_lineNumber ( lineNumber ) {
 	using namespace std;
 
-    strcpy(m_description, description);
-    strcpy(m_filename, filename);
+	strcpy ( m_description, description );
+	strcpy ( m_filename, filename );
 }
 
-AssertException::~AssertException() throw()
-{
+AssertException::~AssertException() throw() {
 }
 
-char const* AssertException::what() const throw()
-{
-    return m_description;
+char const* AssertException::what() const throw() {
+	return m_description;
 }
 
-char const* AssertException::Filename() const
-{
-    return m_filename;
+char const* AssertException::Filename() const {
+	return m_filename;
 }
 
-int AssertException::LineNumber() const
-{
-    return m_lineNumber;
+int AssertException::LineNumber() const {
+	return m_lineNumber;
 }
 
Index: library/tests/unittest-cpp/Posix/TimeHelpers.cpp
===================================================================
--- library/tests/unittest-cpp/Posix/TimeHelpers.cpp (revision 418)
+++ library/tests/unittest-cpp/Posix/TimeHelpers.cpp (revision 477)
@@ -4,29 +4,25 @@
 namespace UnitTest {
 
-Timer::Timer()
-{
-    m_startTime.tv_sec = 0;
-    m_startTime.tv_usec = 0;
+Timer::Timer() {
+	m_startTime.tv_sec = 0;
+	m_startTime.tv_usec = 0;
 }
 
-void Timer::Start()
-{
-    gettimeofday(&m_startTime, 0);
+void Timer::Start() {
+	gettimeofday ( &m_startTime, 0 );
 }
 
-double Timer::GetTimeInMs() const
-{
-    struct timeval currentTime;
-    gettimeofday(&currentTime, 0);
+double Timer::GetTimeInMs() const {
+	struct timeval currentTime;
+	gettimeofday ( &currentTime, 0 );
 
 	double const dsecs = currentTime.tv_sec - m_startTime.tv_sec;
-    double const dus = currentTime.tv_usec - m_startTime.tv_usec;
+	double const dus = currentTime.tv_usec - m_startTime.tv_usec;
 
-	return (dsecs * 1000.0) + (dus / 1000.0);
+	return ( dsecs * 1000.0 ) + ( dus / 1000.0 );
 }
 
-void TimeHelpers::SleepMs(int ms)
-{
-    usleep(ms * 1000);
+void TimeHelpers::SleepMs ( int ms ) {
+	usleep ( ms * 1000 );
 }
 
Index: library/tests/unittest-cpp/Posix/TimeHelpers.h
===================================================================
--- library/tests/unittest-cpp/Posix/TimeHelpers.h (revision 418)
+++ library/tests/unittest-cpp/Posix/TimeHelpers.h (revision 477)
@@ -6,19 +6,17 @@
 namespace UnitTest {
 
-class Timer
-{
+class Timer {
 public:
-    Timer();
-    void Start();
-    double GetTimeInMs() const;    
+	Timer();
+	void Start();
+	double GetTimeInMs() const;
 
 private:
-    struct timeval m_startTime;    
+	struct timeval m_startTime;
 };
 
 
-namespace TimeHelpers
-{
-void SleepMs (int ms);
+namespace TimeHelpers {
+void SleepMs ( int ms );
 }
 
Index: library/tests/unittest-cpp/Posix/SignalTranslator.cpp
===================================================================
--- library/tests/unittest-cpp/Posix/SignalTranslator.cpp (revision 418)
+++ library/tests/unittest-cpp/Posix/SignalTranslator.cpp (revision 477)
@@ -7,7 +7,6 @@
 namespace {
 
-void SignalHandler(int sig)
-{
-    siglongjmp(*SignalTranslator::s_jumpTarget, sig );
+void SignalHandler ( int sig ) {
+	siglongjmp ( *SignalTranslator::s_jumpTarget, sig );
 }
 
@@ -15,30 +14,28 @@
 
 
-SignalTranslator::SignalTranslator()
-{
-    m_oldJumpTarget = s_jumpTarget;
-    s_jumpTarget = &m_currentJumpTarget;
+SignalTranslator::SignalTranslator() {
+	m_oldJumpTarget = s_jumpTarget;
+	s_jumpTarget = &m_currentJumpTarget;
 
-    struct sigaction action;
-    action.sa_flags = 0;
-    action.sa_handler = SignalHandler;
-    sigemptyset( &action.sa_mask );
+	struct sigaction action;
+	action.sa_flags = 0;
+	action.sa_handler = SignalHandler;
+	sigemptyset ( &action.sa_mask );
 
-    sigaction( SIGSEGV, &action, &m_old_SIGSEGV_action );
-    sigaction( SIGFPE , &action, &m_old_SIGFPE_action  );
-    sigaction( SIGTRAP, &action, &m_old_SIGTRAP_action );
-    sigaction( SIGBUS , &action, &m_old_SIGBUS_action  );
-    sigaction( SIGILL , &action, &m_old_SIGBUS_action  );
+	sigaction ( SIGSEGV, &action, &m_old_SIGSEGV_action );
+	sigaction ( SIGFPE , &action, &m_old_SIGFPE_action );
+	sigaction ( SIGTRAP, &action, &m_old_SIGTRAP_action );
+	sigaction ( SIGBUS , &action, &m_old_SIGBUS_action );
+	sigaction ( SIGILL , &action, &m_old_SIGBUS_action );
 }
 
-SignalTranslator::~SignalTranslator()
-{
-    sigaction( SIGILL , &m_old_SIGBUS_action , 0 );
-    sigaction( SIGBUS , &m_old_SIGBUS_action , 0 );
-    sigaction( SIGTRAP, &m_old_SIGTRAP_action, 0 );
-    sigaction( SIGFPE , &m_old_SIGFPE_action , 0 );
-    sigaction( SIGSEGV, &m_old_SIGSEGV_action, 0 );
+SignalTranslator::~SignalTranslator() {
+	sigaction ( SIGILL , &m_old_SIGBUS_action , 0 );
+	sigaction ( SIGBUS , &m_old_SIGBUS_action , 0 );
+	sigaction ( SIGTRAP, &m_old_SIGTRAP_action, 0 );
+	sigaction ( SIGFPE , &m_old_SIGFPE_action , 0 );
+	sigaction ( SIGSEGV, &m_old_SIGSEGV_action, 0 );
 
-    s_jumpTarget = m_oldJumpTarget;
+	s_jumpTarget = m_oldJumpTarget;
 }
 
Index: library/tests/unittest-cpp/Posix/SignalTranslator.h
===================================================================
--- library/tests/unittest-cpp/Posix/SignalTranslator.h (revision 418)
+++ library/tests/unittest-cpp/Posix/SignalTranslator.h (revision 477)
@@ -7,28 +7,27 @@
 namespace UnitTest {
 
-class SignalTranslator
-{
+class SignalTranslator {
 public:
-    SignalTranslator();
-    ~SignalTranslator();
+	SignalTranslator();
+	~SignalTranslator();
 
-    static sigjmp_buf* s_jumpTarget;
+	static sigjmp_buf* s_jumpTarget;
 
 private:
-    sigjmp_buf m_currentJumpTarget;
-    sigjmp_buf* m_oldJumpTarget;
+	sigjmp_buf m_currentJumpTarget;
+	sigjmp_buf* m_oldJumpTarget;
 
-    struct sigaction m_old_SIGFPE_action;
-    struct sigaction m_old_SIGTRAP_action;
-    struct sigaction m_old_SIGSEGV_action;
-    struct sigaction m_old_SIGBUS_action;
-    struct sigaction m_old_SIGABRT_action;
-    struct sigaction m_old_SIGALRM_action;
+	struct sigaction m_old_SIGFPE_action;
+	struct sigaction m_old_SIGTRAP_action;
+	struct sigaction m_old_SIGSEGV_action;
+	struct sigaction m_old_SIGBUS_action;
+	struct sigaction m_old_SIGABRT_action;
+	struct sigaction m_old_SIGALRM_action;
 };
 
 #if !defined (__GNUC__)
-    #define UNITTEST_EXTENSION
+#define UNITTEST_EXTENSION
 #else
-    #define UNITTEST_EXTENSION __extension__
+#define UNITTEST_EXTENSION __extension__
 #endif
 
@@ -36,5 +35,5 @@
 	UnitTest::SignalTranslator sig; \
 	if (UNITTEST_EXTENSION sigsetjmp(*UnitTest::SignalTranslator::s_jumpTarget, 1) != 0) \
-        throw ("Unhandled system exception"); 
+        throw ("Unhandled system exception");
 
 }
Index: library/tests/unittest-cpp/Win32/TimeHelpers.cpp
===================================================================
--- library/tests/unittest-cpp/Win32/TimeHelpers.cpp (revision 418)
+++ library/tests/unittest-cpp/Win32/TimeHelpers.cpp (revision 477)
@@ -5,7 +5,6 @@
 
 Timer::Timer()
-	: m_threadHandle(::GetCurrentThread())
-	, m_startTime(0)
-{
+		: m_threadHandle ( ::GetCurrentThread() )
+		, m_startTime ( 0 ) {
 #if defined(_MSC_VER) && (_MSC_VER == 1200) // VC6 doesn't have DWORD_PTR?
 	typedef unsigned long DWORD_PTR;
@@ -13,34 +12,30 @@
 
 	DWORD_PTR systemMask;
-	::GetProcessAffinityMask(GetCurrentProcess(), &m_processAffinityMask, &systemMask);
-	::SetThreadAffinityMask(m_threadHandle, 1);
-	::QueryPerformanceFrequency(reinterpret_cast< LARGE_INTEGER* >(&m_frequency));
-	::SetThreadAffinityMask(m_threadHandle, m_processAffinityMask);
+	::GetProcessAffinityMask ( GetCurrentProcess(), &m_processAffinityMask, &systemMask );
+	::SetThreadAffinityMask ( m_threadHandle, 1 );
+	::QueryPerformanceFrequency ( reinterpret_cast< LARGE_INTEGER* > ( &m_frequency ) );
+	::SetThreadAffinityMask ( m_threadHandle, m_processAffinityMask );
 }
 
-void Timer::Start()
-{
+void Timer::Start() {
 	m_startTime = GetTime();
 }
 
-double Timer::GetTimeInMs() const
-{
+double Timer::GetTimeInMs() const {
 	__int64 const elapsedTime = GetTime() - m_startTime;
-	double const seconds = double(elapsedTime) / double(m_frequency);
+	double const seconds = double ( elapsedTime ) / double ( m_frequency );
 	return seconds * 1000.0;
 }
 
-__int64 Timer::GetTime() const
-{
+__int64 Timer::GetTime() const {
 	LARGE_INTEGER curTime;
-	::SetThreadAffinityMask(m_threadHandle, 1);
-	::QueryPerformanceCounter(&curTime);
-	::SetThreadAffinityMask(m_threadHandle, m_processAffinityMask);
+	::SetThreadAffinityMask ( m_threadHandle, 1 );
+	::QueryPerformanceCounter ( &curTime );
+	::SetThreadAffinityMask ( m_threadHandle, m_processAffinityMask );
 	return curTime.QuadPart;
 }
 
-void TimeHelpers::SleepMs(int const ms)
-{
-	::Sleep(ms);
+void TimeHelpers::SleepMs ( int const ms ) {
+	::Sleep ( ms );
 }
 
Index: library/tests/unittest-cpp/Win32/TimeHelpers.h
===================================================================
--- library/tests/unittest-cpp/Win32/TimeHelpers.h (revision 418)
+++ library/tests/unittest-cpp/Win32/TimeHelpers.h (revision 477)
@@ -6,27 +6,26 @@
 
 #ifdef UNITTEST_MINGW
-    #ifndef __int64
-        #define __int64 long long
-    #endif
+#ifndef __int64
+#define __int64 long long
+#endif
 #endif
 
 namespace UnitTest {
 
-class Timer
-{
+class Timer {
 public:
-    Timer();
+	Timer();
 	void Start();
-	double GetTimeInMs() const;    
+	double GetTimeInMs() const;
 
 private:
-    __int64 GetTime() const;
+	__int64 GetTime() const;
 
-    void* m_threadHandle;
+	void* m_threadHandle;
 
 #if defined(_WIN64)
-    unsigned __int64 m_processAffinityMask;
+	unsigned __int64 m_processAffinityMask;
 #else
-    unsigned long m_processAffinityMask;
+	unsigned long m_processAffinityMask;
 #endif
 
@@ -36,7 +35,6 @@
 
 
-namespace TimeHelpers
-{
-void SleepMs (int ms);
+namespace TimeHelpers {
+void SleepMs ( int ms );
 }
 
Index: library/tests/unittest-cpp/Test.h
===================================================================
--- library/tests/unittest-cpp/Test.h (revision 418)
+++ library/tests/unittest-cpp/Test.h (revision 477)
@@ -9,22 +9,21 @@
 class TestList;
 
-class Test
-{
+class Test {
 public:
-    explicit Test(char const* testName, char const* suiteName = "DefaultSuite", char const* filename = "", int lineNumber = 0);
-    virtual ~Test();
-    void Run();
+	explicit Test ( char const* testName, char const* suiteName = "DefaultSuite", char const* filename = "", int lineNumber = 0 );
+	virtual ~Test();
+	void Run();
 
-    TestDetails const m_details;
-    Test* next;
-    mutable bool m_timeConstraintExempt;
+	TestDetails const m_details;
+	Test* next;
+	mutable bool m_timeConstraintExempt;
 
-    static TestList& GetTestList();
+	static TestList& GetTestList();
 
-    virtual void RunImpl() const;
+	virtual void RunImpl() const;
 
 private:
-	Test(Test const&);
-    Test& operator =(Test const&);
+	Test ( Test const& );
+	Test& operator = ( Test const& );
 };
 
Index: library/tests/unittest-cpp/TimeHelpers.h
===================================================================
--- library/tests/unittest-cpp/TimeHelpers.h (revision 418)
+++ library/tests/unittest-cpp/TimeHelpers.h (revision 477)
@@ -2,6 +2,6 @@
 
 #if defined UNITTEST_POSIX
-    #include "Posix/TimeHelpers.h"
+#include "Posix/TimeHelpers.h"
 #else
-    #include "Win32/TimeHelpers.h"
+#include "Win32/TimeHelpers.h"
 #endif
Index: library/tests/unittest-cpp/CurrentTest.h
===================================================================
--- library/tests/unittest-cpp/CurrentTest.h (revision 418)
+++ library/tests/unittest-cpp/CurrentTest.h (revision 477)
@@ -7,8 +7,7 @@
 class TestDetails;
 
-namespace CurrentTest
-{
-	TestResults*& Results();
-	const TestDetails*& Details();
+namespace CurrentTest {
+TestResults*& Results();
+const TestDetails*& Details();
 }
 
Index: library/tests/unittest-cpp/CheckMacros.h
===================================================================
--- library/tests/unittest-cpp/CheckMacros.h (revision 418)
+++ library/tests/unittest-cpp/CheckMacros.h (revision 477)
@@ -1,3 +1,3 @@
-#ifndef UNITTEST_CHECKMACROS_H 
+#ifndef UNITTEST_CHECKMACROS_H
 #define UNITTEST_CHECKMACROS_H
 
@@ -9,25 +9,25 @@
 
 #ifdef CHECK
-    #error UnitTest++ redefines CHECK
+#error UnitTest++ redefines CHECK
 #endif
 
 #ifdef CHECK_EQUAL
-	#error UnitTest++ redefines CHECK_EQUAL
+#error UnitTest++ redefines CHECK_EQUAL
 #endif
 
 #ifdef CHECK_CLOSE
-	#error UnitTest++ redefines CHECK_CLOSE
+#error UnitTest++ redefines CHECK_CLOSE
 #endif
 
 #ifdef CHECK_ARRAY_EQUAL
-	#error UnitTest++ redefines CHECK_ARRAY_EQUAL
+#error UnitTest++ redefines CHECK_ARRAY_EQUAL
 #endif
 
 #ifdef CHECK_ARRAY_CLOSE
-	#error UnitTest++ redefines CHECK_ARRAY_CLOSE
+#error UnitTest++ redefines CHECK_ARRAY_CLOSE
 #endif
 
 #ifdef CHECK_ARRAY2D_CLOSE
-	#error UnitTest++ redefines CHECK_ARRAY2D_CLOSE
+#error UnitTest++ redefines CHECK_ARRAY2D_CLOSE
 #endif
 
Index: library/tests/unittest-cpp/XmlTestReporter.h
===================================================================
--- library/tests/unittest-cpp/XmlTestReporter.h (revision 418)
+++ library/tests/unittest-cpp/XmlTestReporter.h (revision 477)
@@ -6,26 +6,24 @@
 #include <iosfwd>
 
-namespace UnitTest
-{
+namespace UnitTest {
 
-class XmlTestReporter : public DeferredTestReporter
-{
+class XmlTestReporter : public DeferredTestReporter {
 public:
-    explicit XmlTestReporter(std::ostream& ostream);
+	explicit XmlTestReporter ( std::ostream& ostream );
 
-    virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
+	virtual void ReportSummary ( int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed );
 
 private:
-    XmlTestReporter(XmlTestReporter const&);
-    XmlTestReporter& operator=(XmlTestReporter const&);
+	XmlTestReporter ( XmlTestReporter const& );
+	XmlTestReporter& operator= ( XmlTestReporter const& );
 
-    void AddXmlElement(std::ostream& os, char const* encoding);
-    void BeginResults(std::ostream& os, int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
-    void EndResults(std::ostream& os);
-    void BeginTest(std::ostream& os, DeferredTestResult const& result);
-    void AddFailure(std::ostream& os, DeferredTestResult const& result);
-    void EndTest(std::ostream& os, DeferredTestResult const& result);
+	void AddXmlElement ( std::ostream& os, char const* encoding );
+	void BeginResults ( std::ostream& os, int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed );
+	void EndResults ( std::ostream& os );
+	void BeginTest ( std::ostream& os, DeferredTestResult const& result );
+	void AddFailure ( std::ostream& os, DeferredTestResult const& result );
+	void EndTest ( std::ostream& os, DeferredTestResult const& result );
 
-    std::ostream& m_ostream;
+	std::ostream& m_ostream;
 };
 
Index: library/tests/unittest-cpp/TestMacros.h
===================================================================
--- library/tests/unittest-cpp/TestMacros.h (revision 418)
+++ library/tests/unittest-cpp/TestMacros.h (revision 477)
@@ -9,19 +9,19 @@
 
 #ifndef UNITTEST_POSIX
-	#define UNITTEST_THROW_SIGNALS
+#define UNITTEST_THROW_SIGNALS
 #else
-	#include "Posix/SignalTranslator.h"
+#include "Posix/SignalTranslator.h"
 #endif
 
 #ifdef TEST
-    #error UnitTest++ redefines TEST
+#error UnitTest++ redefines TEST
 #endif
 
 #ifdef TEST_EX
-	#error UnitTest++ redefines TEST_EX
+#error UnitTest++ redefines TEST_EX
 #endif
 
 #ifdef TEST_FIXTURE_EX
-	#error UnitTest++ redefines TEST_FIXTURE_EX
+#error UnitTest++ redefines TEST_FIXTURE_EX
 #endif
 
Index: library/tests/unittest-cpp/TestDetails.h
===================================================================
--- library/tests/unittest-cpp/TestDetails.h (revision 456)
+++ library/tests/unittest-cpp/TestDetails.h (revision 477)
@@ -4,19 +4,18 @@
 namespace UnitTest {
 
-class TestDetails
-{
+class TestDetails {
 public:
-    TestDetails(char const* testName, char const* suiteName, char const* filename, int lineNumber, bool useFilename = true);
-    TestDetails(const TestDetails& details, int lineNumber, bool useFilename = true);
+	TestDetails ( char const* testName, char const* suiteName, char const* filename, int lineNumber, bool useFilename = true );
+	TestDetails ( const TestDetails& details, int lineNumber, bool useFilename = true );
 
-    char const* const suiteName;
-    char const* const testName;
-    char const* const filename;
-    int const lineNumber;
-    bool const useFilename;
+	char const* const suiteName;
+	char const* const testName;
+	char const* const filename;
+	int const lineNumber;
+	bool const useFilename;
 
-    TestDetails(TestDetails const&); // Why is it public? --> http://gcc.gnu.org/bugs.html#cxx_rvalbind
+	TestDetails ( TestDetails const& ); // Why is it public? --> http://gcc.gnu.org/bugs.html#cxx_rvalbind
 private:
-    TestDetails& operator=(TestDetails const&);
+	TestDetails& operator= ( TestDetails const& );
 };
 
Index: library/tests/unittest-cpp/ReportAssert.cpp
===================================================================
--- library/tests/unittest-cpp/ReportAssert.cpp (revision 418)
+++ library/tests/unittest-cpp/ReportAssert.cpp (revision 477)
@@ -4,7 +4,6 @@
 namespace UnitTest {
 
-void ReportAssert(char const* description, char const* filename, int lineNumber)
-{
-    throw AssertException(description, filename, lineNumber);
+void ReportAssert ( char const* description, char const* filename, int lineNumber ) {
+	throw AssertException ( description, filename, lineNumber );
 }
 
Index: library/tests/unittest-cpp/Checks.cpp
===================================================================
--- library/tests/unittest-cpp/Checks.cpp (revision 418)
+++ library/tests/unittest-cpp/Checks.cpp (revision 477)
@@ -6,16 +6,14 @@
 namespace {
 
-void CheckStringsEqual(TestResults& results, char const* expected, char const* actual, 
-                       TestDetails const& details)
-{
+void CheckStringsEqual ( TestResults& results, char const* expected, char const* actual,
+                         TestDetails const& details ) {
 	using namespace std;
 
-    if (strcmp(expected, actual))
-    {
-        UnitTest::MemoryOutStream stream;
-        stream << "Expected " << expected << " but was " << actual;
+	if ( strcmp ( expected, actual ) ) {
+		UnitTest::MemoryOutStream stream;
+		stream << "Expected " << expected << " but was " << actual;
 
-        results.OnTestFailure(details, stream.GetText());
-    }
+		results.OnTestFailure ( details, stream.GetText() );
+	}
 }
 
@@ -23,26 +21,22 @@
 
 
-void CheckEqual(TestResults& results, char const* expected, char const* actual,
-                TestDetails const& details)
-{
-    CheckStringsEqual(results, expected, actual, details);
+void CheckEqual ( TestResults& results, char const* expected, char const* actual,
+                  TestDetails const& details ) {
+	CheckStringsEqual ( results, expected, actual, details );
 }
 
-void CheckEqual(TestResults& results, char* expected, char* actual,
-                TestDetails const& details)
-{
-    CheckStringsEqual(results, expected, actual, details);
+void CheckEqual ( TestResults& results, char* expected, char* actual,
+                  TestDetails const& details ) {
+	CheckStringsEqual ( results, expected, actual, details );
 }
 
-void CheckEqual(TestResults& results, char* expected, char const* actual,
-                TestDetails const& details)
-{
-    CheckStringsEqual(results, expected, actual, details);
+void CheckEqual ( TestResults& results, char* expected, char const* actual,
+                  TestDetails const& details ) {
+	CheckStringsEqual ( results, expected, actual, details );
 }
 
-void CheckEqual(TestResults& results, char const* expected, char* actual,
-                TestDetails const& details)
-{
-    CheckStringsEqual(results, expected, actual, details);
+void CheckEqual ( TestResults& results, char const* expected, char* actual,
+                  TestDetails const& details ) {
+	CheckStringsEqual ( results, expected, actual, details );
 }
 
Index: library/tests/unittest-cpp/TestResults.cpp
===================================================================
--- library/tests/unittest-cpp/TestResults.cpp (revision 418)
+++ library/tests/unittest-cpp/TestResults.cpp (revision 477)
@@ -6,53 +6,45 @@
 namespace UnitTest {
 
-TestResults::TestResults(TestReporter* testReporter)
-    : m_testReporter(testReporter)
-    , m_totalTestCount(0)
-    , m_failedTestCount(0)
-    , m_failureCount(0)
-    , m_currentTestFailed(false)
-{
+TestResults::TestResults ( TestReporter* testReporter )
+		: m_testReporter ( testReporter )
+		, m_totalTestCount ( 0 )
+		, m_failedTestCount ( 0 )
+		, m_failureCount ( 0 )
+		, m_currentTestFailed ( false ) {
 }
 
-void TestResults::OnTestStart(TestDetails const& test)
-{
-    ++m_totalTestCount;
-    m_currentTestFailed = false;
-    if (m_testReporter)
-        m_testReporter->ReportTestStart(test);
+void TestResults::OnTestStart ( TestDetails const& test ) {
+	++m_totalTestCount;
+	m_currentTestFailed = false;
+	if ( m_testReporter )
+		m_testReporter->ReportTestStart ( test );
 }
 
-void TestResults::OnTestFailure(TestDetails const& test, char const* failure)
-{
-    ++m_failureCount;
-    if (!m_currentTestFailed)
-    {
-        ++m_failedTestCount;
-        m_currentTestFailed = true;
-    }
+void TestResults::OnTestFailure ( TestDetails const& test, char const* failure ) {
+	++m_failureCount;
+	if ( !m_currentTestFailed ) {
+		++m_failedTestCount;
+		m_currentTestFailed = true;
+	}
 
-    if (m_testReporter)
-        m_testReporter->ReportFailure(test, failure);
+	if ( m_testReporter )
+		m_testReporter->ReportFailure ( test, failure );
 }
 
-void TestResults::OnTestFinish(TestDetails const& test, float secondsElapsed)
-{
-    if (m_testReporter)
-        m_testReporter->ReportTestFinish(test, secondsElapsed);
+void TestResults::OnTestFinish ( TestDetails const& test, float secondsElapsed ) {
+	if ( m_testReporter )
+		m_testReporter->ReportTestFinish ( test, secondsElapsed );
 }
 
-int TestResults::GetTotalTestCount() const
-{
-    return m_totalTestCount;
+int TestResults::GetTotalTestCount() const {
+	return m_totalTestCount;
 }
 
-int TestResults::GetFailedTestCount() const
-{
-    return m_failedTestCount;
+int TestResults::GetFailedTestCount() const {
+	return m_failedTestCount;
 }
 
-int TestResults::GetFailureCount() const
-{
-    return m_failureCount;
+int TestResults::GetFailureCount() const {
+	return m_failureCount;
 }
 
Index: library/tests/unittest-cpp/TestReporter.cpp
===================================================================
--- library/tests/unittest-cpp/TestReporter.cpp (revision 418)
+++ library/tests/unittest-cpp/TestReporter.cpp (revision 477)
@@ -4,6 +4,5 @@
 
 
-TestReporter::~TestReporter()
-{
+TestReporter::~TestReporter() {
 }
 
Index: library/tests/unittest-cpp/DeferredTestReporter.cpp
===================================================================
--- library/tests/unittest-cpp/DeferredTestReporter.cpp (revision 418)
+++ library/tests/unittest-cpp/DeferredTestReporter.cpp (revision 477)
@@ -4,25 +4,21 @@
 using namespace UnitTest;
 
-void DeferredTestReporter::ReportTestStart(TestDetails const& details)
-{
-    m_results.push_back(DeferredTestResult(details.suiteName, details.testName));
+void DeferredTestReporter::ReportTestStart ( TestDetails const& details ) {
+	m_results.push_back ( DeferredTestResult ( details.suiteName, details.testName ) );
 }
 
-void DeferredTestReporter::ReportFailure(TestDetails const& details, char const* failure)
-{
-    DeferredTestResult& r = m_results.back();
-    r.failed = true;
-    r.failures.push_back(DeferredTestResult::Failure(details.lineNumber, failure));
-    r.failureFile = details.filename;
+void DeferredTestReporter::ReportFailure ( TestDetails const& details, char const* failure ) {
+	DeferredTestResult& r = m_results.back();
+	r.failed = true;
+	r.failures.push_back ( DeferredTestResult::Failure ( details.lineNumber, failure ) );
+	r.failureFile = details.filename;
 }
 
-void DeferredTestReporter::ReportTestFinish(TestDetails const&, float secondsElapsed)
-{
-    DeferredTestResult& r = m_results.back();
-    r.timeElapsed = secondsElapsed;
+void DeferredTestReporter::ReportTestFinish ( TestDetails const&, float secondsElapsed ) {
+	DeferredTestResult& r = m_results.back();
+	r.timeElapsed = secondsElapsed;
 }
 
-DeferredTestReporter::DeferredTestResultList& DeferredTestReporter::GetResults()
-{
-    return m_results;
+DeferredTestReporter::DeferredTestResultList& DeferredTestReporter::GetResults() {
+	return m_results;
 }
Index: library/tests/unittest-cpp/TestReporterStdout.cpp
===================================================================
--- library/tests/unittest-cpp/TestReporterStdout.cpp (revision 456)
+++ library/tests/unittest-cpp/TestReporterStdout.cpp (revision 477)
@@ -6,48 +6,44 @@
 // cstdio doesn't pull in namespace std on VC6, so we do it here.
 #if defined(_MSC_VER) && (_MSC_VER == 1200)
-	namespace std {}
+namespace std {}
 #endif
 
 namespace UnitTest {
 
-void TestReporterStdout::ReportFailure(TestDetails const& details, char const* failure)
-{
+void TestReporterStdout::ReportFailure ( TestDetails const& details, char const* failure ) {
 #if defined(__APPLE__) || defined(__GNUG__)
-    char const* const errorFormat = "%s:%d: error: Failure in %s: %s\n";
+	char const* const errorFormat = "%s:%d: error: Failure in %s: %s\n";
 #else
-    char const* const errorFormat = "%s(%d): error: Failure in %s: %s\n";
+	char const* const errorFormat = "%s(%d): error: Failure in %s: %s\n";
 #endif
 
-    using namespace std;
+	using namespace std;
 
-    if (details.useFilename) {
-        // standard way
-	printf(errorFormat, details.filename, details.lineNumber, details.testName, failure);
-    } else { 
-        // extended for BDM - the failure string already includes
-	// (custom) test location info
-	printf("%s\n", failure);
-    }
+	if ( details.useFilename ) {
+		// standard way
+		printf ( errorFormat, details.filename, details.lineNumber, details.testName, failure );
+	} else {
+		// extended for BDM - the failure string already includes
+		// (custom) test location info
+		printf ( "%s\n", failure );
+	}
 }
 
-void TestReporterStdout::ReportTestStart(TestDetails const& /*test*/)
-{
+void TestReporterStdout::ReportTestStart ( TestDetails const& /*test*/ ) {
 }
 
-void TestReporterStdout::ReportTestFinish(TestDetails const& /*test*/, float)
-{
+void TestReporterStdout::ReportTestFinish ( TestDetails const& /*test*/, float ) {
 }
 
-void TestReporterStdout::ReportSummary(int const totalTestCount, int const failedTestCount,
-                                       int const failureCount, float secondsElapsed)
-{
+void TestReporterStdout::ReportSummary ( int const totalTestCount, int const failedTestCount,
+        int const failureCount, float secondsElapsed ) {
 	using namespace std;
 
-    if (failureCount > 0)
-        printf("FAILURE: %d out of %d tests failed (%d failures).\n", failedTestCount, totalTestCount, failureCount);
-    else
-        printf("Success: %d tests passed.\n", totalTestCount);
+	if ( failureCount > 0 )
+		printf ( "FAILURE: %d out of %d tests failed (%d failures).\n", failedTestCount, totalTestCount, failureCount );
+	else
+		printf ( "Success: %d tests passed.\n", totalTestCount );
 
-    printf("Test time: %.2f seconds.\n", secondsElapsed);
+	printf ( "Test time: %.2f seconds.\n", secondsElapsed );
 }
 
Index: library/tests/unittest-cpp/TimeConstraint.h
===================================================================
--- library/tests/unittest-cpp/TimeConstraint.h (revision 418)
+++ library/tests/unittest-cpp/TimeConstraint.h (revision 477)
@@ -9,16 +9,15 @@
 class TestDetails;
 
-class TimeConstraint
-{
+class TimeConstraint {
 public:
-    TimeConstraint(int ms, TestDetails const& details);
-    ~TimeConstraint();
+	TimeConstraint ( int ms, TestDetails const& details );
+	~TimeConstraint();
 
 private:
-    void operator=(TimeConstraint const&); 
-	TimeConstraint(TimeConstraint const&);
+	void operator= ( TimeConstraint const& );
+	TimeConstraint ( TimeConstraint const& );
 
 	Timer m_timer;
-    TestDetails const& m_details;
+	TestDetails const& m_details;
 	int const m_maxMs;
 };
Index: library/tests/unittest-cpp/Config.h
===================================================================
--- library/tests/unittest-cpp/Config.h (revision 418)
+++ library/tests/unittest-cpp/Config.h (revision 477)
@@ -5,21 +5,21 @@
 
 #if defined(_MSC_VER)
-    #pragma warning(disable:4127) // conditional expression is constant
-	#pragma warning(disable:4702) // unreachable code
-	#pragma warning(disable:4722) // destructor never returns, potential memory leak
+#pragma warning(disable:4127) // conditional expression is constant
+#pragma warning(disable:4702) // unreachable code
+#pragma warning(disable:4722) // destructor never returns, potential memory leak
 
-	#if (_MSC_VER == 1200)  // VC6
-		#pragma warning(disable:4786)
-		#pragma warning(disable:4290)
-	#endif
+#if (_MSC_VER == 1200)  // VC6
+#pragma warning(disable:4786)
+#pragma warning(disable:4290)
+#endif
 #endif
 
 #if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \
-    defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)        
-    #define UNITTEST_POSIX
+    defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#define UNITTEST_POSIX
 #endif
 
 #if defined(__MINGW32__)
-    #define UNITTEST_MINGW
+#define UNITTEST_MINGW
 #endif
 
Index: library/tests/unittest-cpp/TestList.cpp
===================================================================
--- library/tests/unittest-cpp/TestList.cpp (revision 418)
+++ library/tests/unittest-cpp/TestList.cpp (revision 477)
@@ -6,33 +6,26 @@
 namespace UnitTest {
 
-TestList::TestList() 
-    : m_head(0)
-    , m_tail(0)
-{
+TestList::TestList()
+		: m_head ( 0 )
+		, m_tail ( 0 ) {
 }
 
-void TestList::Add(Test* test)
-{
-    if (m_tail == 0)
-    {
-        assert(m_head == 0);
-        m_head = test;
-        m_tail = test;
-    }
-    else
-    {
-        m_tail->next = test;
-        m_tail = test;
-    }
+void TestList::Add ( Test* test ) {
+	if ( m_tail == 0 ) {
+		assert ( m_head == 0 );
+		m_head = test;
+		m_tail = test;
+	} else {
+		m_tail->next = test;
+		m_tail = test;
+	}
 }
 
-Test* TestList::GetHead() const
-{
-    return m_head;
+Test* TestList::GetHead() const {
+	return m_head;
 }
 
-ListAdder::ListAdder(TestList& list, Test* test)
-{
-    list.Add(test);
+ListAdder::ListAdder ( TestList& list, Test* test ) {
+	list.Add ( test );
 }
 
Index: library/tests/unittest-cpp/TestRunner.h
===================================================================
--- library/tests/unittest-cpp/TestRunner.h (revision 418)
+++ library/tests/unittest-cpp/TestRunner.h (revision 477)
@@ -14,34 +14,29 @@
 int RunAllTests();
 
-struct True
-{
-	bool operator()(const Test* const) const
-	{
-		return true;	
+struct True {
+	bool operator() ( const Test* const ) const {
+		return true;
 	}
 };
 
-class TestRunner
-{
+class TestRunner {
 public:
-	explicit TestRunner(TestReporter& reporter);
+	explicit TestRunner ( TestReporter& reporter );
 	~TestRunner();
 
 	template <class Predicate>
-	int RunTestsIf(TestList const& list, char const* suiteName, 
-				   const Predicate& predicate, int maxTestTimeInMs) const
-	{
-	    Test* curTest = list.GetHead();
+	int RunTestsIf ( TestList const& list, char const* suiteName,
+	                 const Predicate& predicate, int maxTestTimeInMs ) const {
+		Test* curTest = list.GetHead();
 
-	    while (curTest != 0)
-	    {
-		    if (IsTestInSuite(curTest, suiteName) && predicate(curTest))
-				RunTest(m_result, curTest, maxTestTimeInMs);
+		while ( curTest != 0 ) {
+			if ( IsTestInSuite ( curTest, suiteName ) && predicate ( curTest ) )
+				RunTest ( m_result, curTest, maxTestTimeInMs );
 
 			curTest = curTest->next;
-	    }
+		}
 
-	    return Finish();
-	}	
+		return Finish();
+	}
 
 private:
@@ -51,6 +46,6 @@
 
 	int Finish() const;
-	bool IsTestInSuite(const Test* const curTest, char const* suiteName) const;
-	void RunTest(TestResults* const result, Test* const curTest, int const maxTestTimeInMs) const;
+	bool IsTestInSuite ( const Test* const curTest, char const* suiteName ) const;
+	void RunTest ( TestResults* const result, Test* const curTest, int const maxTestTimeInMs ) const;
 };
 
Index: library/tests/unittest-cpp/Test.cpp
===================================================================
--- library/tests/unittest-cpp/Test.cpp (revision 435)
+++ library/tests/unittest-cpp/Test.cpp (revision 477)
@@ -9,37 +9,32 @@
 
 #ifdef UNITTEST_POSIX
-    #include "Posix/SignalTranslator.h"
+#include "Posix/SignalTranslator.h"
 #endif
 
 namespace UnitTest {
 
-TestList& Test::GetTestList()
-{
-    static TestList s_list;
-    return s_list;
+TestList& Test::GetTestList() {
+	static TestList s_list;
+	return s_list;
 }
 
-Test::Test(char const* testName, char const* suiteName, char const* filename, int lineNumber)
-    : m_details(testName, suiteName, filename, lineNumber)
-    , next(0)
-    , m_timeConstraintExempt(false)
-{
+Test::Test ( char const* testName, char const* suiteName, char const* filename, int lineNumber )
+		: m_details ( testName, suiteName, filename, lineNumber )
+		, next ( 0 )
+		, m_timeConstraintExempt ( false ) {
 }
 
-Test::~Test()
-{
+Test::~Test() {
 }
 
-void Test::Run()
-{
+void Test::Run() {
 	// made more chatty; presumes the only used test reporter is
 	// TestReporterStdout
-	std::printf("running %s...\n", m_details.testName);
+	std::printf ( "running %s...\n", m_details.testName );
 
-	ExecuteTest(*this, m_details);
+	ExecuteTest ( *this, m_details );
 }
 
-void Test::RunImpl() const
-{
+void Test::RunImpl() const {
 }
 
Index: library/tests/unittest-cpp/MemoryOutStream.h
===================================================================
--- library/tests/unittest-cpp/MemoryOutStream.h (revision 418)
+++ library/tests/unittest-cpp/MemoryOutStream.h (revision 477)
@@ -8,19 +8,17 @@
 #include <sstream>
 
-namespace UnitTest
-{
+namespace UnitTest {
 
-class MemoryOutStream : public std::ostringstream
-{
+class MemoryOutStream : public std::ostringstream {
 public:
-    MemoryOutStream() {}
-    ~MemoryOutStream() {}
-    char const* GetText() const;
+	MemoryOutStream() {}
+	~MemoryOutStream() {}
+	char const* GetText() const;
 
 private:
-    MemoryOutStream(MemoryOutStream const&);
-    void operator =(MemoryOutStream const&);
+	MemoryOutStream ( MemoryOutStream const& );
+	void operator = ( MemoryOutStream const& );
 
-    mutable std::string m_text;
+	mutable std::string m_text;
 };
 
@@ -31,33 +29,31 @@
 #include <cstddef>
 
-namespace UnitTest
-{
+namespace UnitTest {
 
-class MemoryOutStream
-{
+class MemoryOutStream {
 public:
-    explicit MemoryOutStream(int const size = 256);
-    ~MemoryOutStream();
+	explicit MemoryOutStream ( int const size = 256 );
+	~MemoryOutStream();
 
-    char const* GetText() const;
+	char const* GetText() const;
 
-    MemoryOutStream& operator << (char const* txt);
-    MemoryOutStream& operator << (int n);
-    MemoryOutStream& operator << (long n);
-    MemoryOutStream& operator << (unsigned long n);
-    MemoryOutStream& operator << (float f);
-    MemoryOutStream& operator << (double d);
-    MemoryOutStream& operator << (void const* p);
-    MemoryOutStream& operator << (unsigned int s);
+	MemoryOutStream& operator << ( char const* txt );
+	MemoryOutStream& operator << ( int n );
+	MemoryOutStream& operator << ( long n );
+	MemoryOutStream& operator << ( unsigned long n );
+	MemoryOutStream& operator << ( float f );
+	MemoryOutStream& operator << ( double d );
+	MemoryOutStream& operator << ( void const* p );
+	MemoryOutStream& operator << ( unsigned int s );
 
-    enum { GROW_CHUNK_SIZE = 32 };
-    int GetCapacity() const;
+	enum { GROW_CHUNK_SIZE = 32 };
+	int GetCapacity() const;
 
 private:
-    void operator= (MemoryOutStream const&);
-    void GrowBuffer(int capacity);
+	void operator= ( MemoryOutStream const& );
+	void GrowBuffer ( int capacity );
 
-    int m_capacity;
-    char* m_buffer;
+	int m_capacity;
+	char* m_buffer;
 };
 
Index: library/tests/unittest-cpp/CurrentTest.cpp
===================================================================
--- library/tests/unittest-cpp/CurrentTest.cpp (revision 418)
+++ library/tests/unittest-cpp/CurrentTest.cpp (revision 477)
@@ -4,12 +4,10 @@
 namespace UnitTest {
 
-TestResults*& CurrentTest::Results()
-{
+TestResults*& CurrentTest::Results() {
 	static TestResults* testResults = NULL;
 	return testResults;
 }
 
-const TestDetails*& CurrentTest::Details()
-{
+const TestDetails*& CurrentTest::Details() {
 	static const TestDetails* testDetails = NULL;
 	return testDetails;
Index: library/tests/unittest-cpp/XmlTestReporter.cpp
===================================================================
--- library/tests/unittest-cpp/XmlTestReporter.cpp (revision 418)
+++ library/tests/unittest-cpp/XmlTestReporter.cpp (revision 477)
@@ -12,28 +12,25 @@
 namespace {
 
-void ReplaceChar(string& str, char c, string const& replacement)
-{
-    for (size_t pos = str.find(c); pos != string::npos; pos = str.find(c, pos + 1))
-        str.replace(pos, 1, replacement);
+void ReplaceChar ( string& str, char c, string const& replacement ) {
+	for ( size_t pos = str.find ( c ); pos != string::npos; pos = str.find ( c, pos + 1 ) )
+		str.replace ( pos, 1, replacement );
 }
 
-string XmlEscape(string const& value)
-{
-    string escaped = value;
+string XmlEscape ( string const& value ) {
+	string escaped = value;
 
-    ReplaceChar(escaped, '&', "&amp;");
-    ReplaceChar(escaped, '<', "&lt;");
-    ReplaceChar(escaped, '>', "&gt;");
-    ReplaceChar(escaped, '\'', "&apos;");
-    ReplaceChar(escaped, '\"', "&quot;");
- 
-    return escaped;
+	ReplaceChar ( escaped, '&', "&amp;" );
+	ReplaceChar ( escaped, '<', "&lt;" );
+	ReplaceChar ( escaped, '>', "&gt;" );
+	ReplaceChar ( escaped, '\'', "&apos;" );
+	ReplaceChar ( escaped, '\"', "&quot;" );
+
+	return escaped;
 }
 
-string BuildFailureMessage(string const& file, int line, string const& message)
-{
-    ostringstream failureMessage;
-    failureMessage << file << "(" << line << ") : " << message;
-    return failureMessage.str();
+string BuildFailureMessage ( string const& file, int line, string const& message ) {
+	ostringstream failureMessage;
+	failureMessage << file << "(" << line << ") : " << message;
+	return failureMessage.str();
 }
 
@@ -42,85 +39,75 @@
 namespace UnitTest {
 
-XmlTestReporter::XmlTestReporter(ostream& ostream)
-    : m_ostream(ostream)
-{
+XmlTestReporter::XmlTestReporter ( ostream& ostream )
+		: m_ostream ( ostream ) {
 }
 
-void XmlTestReporter::ReportSummary(int totalTestCount, int failedTestCount,
-                                    int failureCount, float secondsElapsed)
-{
-    AddXmlElement(m_ostream, NULL);
+void XmlTestReporter::ReportSummary ( int totalTestCount, int failedTestCount,
+                                      int failureCount, float secondsElapsed ) {
+	AddXmlElement ( m_ostream, NULL );
 
-    BeginResults(m_ostream, totalTestCount, failedTestCount, failureCount, secondsElapsed);
+	BeginResults ( m_ostream, totalTestCount, failedTestCount, failureCount, secondsElapsed );
 
-    DeferredTestResultList const& results = GetResults();
-    for (DeferredTestResultList::const_iterator i = results.begin(); i != results.end(); ++i)
-    {
-        BeginTest(m_ostream, *i);
+	DeferredTestResultList const& results = GetResults();
+	for ( DeferredTestResultList::const_iterator i = results.begin(); i != results.end(); ++i ) {
+		BeginTest ( m_ostream, *i );
 
-        if (i->failed)
-            AddFailure(m_ostream, *i);
+		if ( i->failed )
+			AddFailure ( m_ostream, *i );
 
-        EndTest(m_ostream, *i);
-    }
+		EndTest ( m_ostream, *i );
+	}
 
-    EndResults(m_ostream);
+	EndResults ( m_ostream );
 }
 
-void XmlTestReporter::AddXmlElement(ostream& os, char const* encoding)
-{
-    os << "<?xml version=\"1.0\"";
+void XmlTestReporter::AddXmlElement ( ostream& os, char const* encoding ) {
+	os << "<?xml version=\"1.0\"";
 
-    if (encoding != NULL)
-        os << " encoding=\"" << encoding << "\"";
+	if ( encoding != NULL )
+		os << " encoding=\"" << encoding << "\"";
 
-    os << "?>";
+	os << "?>";
 }
 
-void XmlTestReporter::BeginResults(std::ostream& os, int totalTestCount, int failedTestCount, 
-                                   int failureCount, float secondsElapsed)
-{
-   os << "<unittest-results"
-       << " tests=\"" << totalTestCount << "\"" 
-       << " failedtests=\"" << failedTestCount << "\"" 
-       << " failures=\"" << failureCount << "\"" 
-       << " time=\"" << secondsElapsed << "\""
-       << ">";
+void XmlTestReporter::BeginResults ( std::ostream& os, int totalTestCount, int failedTestCount,
+                                     int failureCount, float secondsElapsed ) {
+	os << "<unittest-results"
+	<< " tests=\"" << totalTestCount << "\""
+	<< " failedtests=\"" << failedTestCount << "\""
+	<< " failures=\"" << failureCount << "\""
+	<< " time=\"" << secondsElapsed << "\""
+	<< ">";
 }
 
-void XmlTestReporter::EndResults(std::ostream& os)
-{
-    os << "</unittest-results>";
+void XmlTestReporter::EndResults ( std::ostream& os ) {
+	os << "</unittest-results>";
 }
 
-void XmlTestReporter::BeginTest(std::ostream& os, DeferredTestResult const& result)
-{
-    os << "<test"
-        << " suite=\"" << result.suiteName << "\"" 
-        << " name=\"" << result.testName << "\""
-        << " time=\"" << result.timeElapsed << "\"";
+void XmlTestReporter::BeginTest ( std::ostream& os, DeferredTestResult const& result ) {
+	os << "<test"
+	<< " suite=\"" << result.suiteName << "\""
+	<< " name=\"" << result.testName << "\""
+	<< " time=\"" << result.timeElapsed << "\"";
 }
 
-void XmlTestReporter::EndTest(std::ostream& os, DeferredTestResult const& result)
-{
-    if (result.failed)
-        os << "</test>";
-    else
-        os << "/>";
+void XmlTestReporter::EndTest ( std::ostream& os, DeferredTestResult const& result ) {
+	if ( result.failed )
+		os << "</test>";
+	else
+		os << "/>";
 }
 
-void XmlTestReporter::AddFailure(std::ostream& os, DeferredTestResult const& result)
-{
-    os << ">"; // close <test> element
+void XmlTestReporter::AddFailure ( std::ostream& os, DeferredTestResult const& result ) {
+	os << ">"; // close <test> element
 
-    for (DeferredTestResult::FailureVec::const_iterator it = result.failures.begin(); 
-         it != result.failures.end(); 
-         ++it)
-    {
-        string const escapedMessage = XmlEscape(it->second);
-        string const message = BuildFailureMessage(result.failureFile, it->first, escapedMessage);
+	for ( DeferredTestResult::FailureVec::const_iterator it = result.failures.begin();
+	        it != result.failures.end();
+	        ++it ) {
+		string const escapedMessage = XmlEscape ( it->second );
+		string const message = BuildFailureMessage ( result.failureFile, it->first, escapedMessage );
 
-        os << "<failure" << " message=\"" << message << "\"" << "/>";
-    }
+		os << "<failure" << " message=\"" << message << "\"" << "/>";
+	}
 }
 
Index: library/tests/unittest-cpp/DeferredTestResult.h
===================================================================
--- library/tests/unittest-cpp/DeferredTestResult.h (revision 418)
+++ library/tests/unittest-cpp/DeferredTestResult.h (revision 477)
@@ -7,22 +7,20 @@
 #include <vector>
 
-namespace UnitTest
-{
+namespace UnitTest {
 
-struct DeferredTestResult
-{
+struct DeferredTestResult {
 	DeferredTestResult();
-    DeferredTestResult(char const* suite, char const* test);
-    ~DeferredTestResult();
-    
-    std::string suiteName;
-    std::string testName;
-    std::string failureFile;
-    
-    typedef std::pair< int, std::string > Failure;
-    typedef std::vector< Failure > FailureVec;
-    FailureVec failures;
-    
-    float timeElapsed;
+	DeferredTestResult ( char const* suite, char const* test );
+	~DeferredTestResult();
+
+	std::string suiteName;
+	std::string testName;
+	std::string failureFile;
+
+	typedef std::pair< int, std::string > Failure;
+	typedef std::vector< Failure > FailureVec;
+	FailureVec failures;
+
+	float timeElapsed;
 	bool failed;
 };
Index: library/tests/unittest-cpp/TestDetails.cpp
===================================================================
--- library/tests/unittest-cpp/TestDetails.cpp (revision 456)
+++ library/tests/unittest-cpp/TestDetails.cpp (revision 477)
@@ -3,20 +3,18 @@
 namespace UnitTest {
 
-TestDetails::TestDetails(char const* testName_, char const* suiteName_, char const* filename_, int lineNumber_, bool useFilename_)
-    : suiteName(suiteName_)
-    , testName(testName_)
-    , filename(filename_)
-    , lineNumber(lineNumber_)
-    , useFilename(useFilename_)
-{
+TestDetails::TestDetails ( char const* testName_, char const* suiteName_, char const* filename_, int lineNumber_, bool useFilename_ )
+		: suiteName ( suiteName_ )
+		, testName ( testName_ )
+		, filename ( filename_ )
+		, lineNumber ( lineNumber_ )
+		, useFilename ( useFilename_ ) {
 }
 
-TestDetails::TestDetails(const TestDetails& details, int lineNumber_, bool useFilename_)
-    : suiteName(details.suiteName)
-    , testName(details.testName)
-    , filename(details.filename)
-    , lineNumber(lineNumber_)
-    , useFilename(useFilename_)
-{
+TestDetails::TestDetails ( const TestDetails& details, int lineNumber_, bool useFilename_ )
+		: suiteName ( details.suiteName )
+		, testName ( details.testName )
+		, filename ( details.filename )
+		, lineNumber ( lineNumber_ )
+		, useFilename ( useFilename_ ) {
 }
 
Index: library/tests/unittest-cpp/AssertException.h
===================================================================
--- library/tests/unittest-cpp/AssertException.h (revision 418)
+++ library/tests/unittest-cpp/AssertException.h (revision 477)
@@ -7,19 +7,18 @@
 namespace UnitTest {
 
-class AssertException : public std::exception
-{
+class AssertException : public std::exception {
 public:
-    AssertException(char const* description, char const* filename, int lineNumber);
-    virtual ~AssertException() throw();
+	AssertException ( char const* description, char const* filename, int lineNumber );
+	virtual ~AssertException() throw();
 
-    virtual char const* what() const throw();
+	virtual char const* what() const throw();
 
-    char const* Filename() const;
-    int LineNumber() const;
+	char const* Filename() const;
+	int LineNumber() const;
 
 private:
-    char m_description[512];
-    char m_filename[256];
-    int m_lineNumber;
+	char m_description[512];
+	char m_filename[256];
+	int m_lineNumber;
 };
 
Index: library/tests/merger_test.cpp
===================================================================
--- library/tests/merger_test.cpp (revision 386)
+++ library/tests/merger_test.cpp (revision 477)
@@ -13,36 +13,39 @@
 	RNG_randomize();
 
-	RV x ( "{x }","1" );
+	RV x ( "{x }", "1" );
 
 	RV z ( x );
 
-	enorm<fsqmat> f1; f1.set_rv ( x );
-	enorm<fsqmat> f2; f2.set_rv ( x );
+	enorm<fsqmat> f1;
+	f1.set_rv ( x );
+	enorm<fsqmat> f2;
+	f2.set_rv ( x );
 
-	f1.set_parameters ( "-5",mat ( "2" ) );
-	f2.set_parameters ( "5",mat ( "10" ) );
+	f1.set_parameters ( "-5", mat ( "2" ) );
+	f2.set_parameters ( "5", mat ( "10" ) );
 
 	Array<mpdf* > A ( 2 );
 	mepdf A1 ( &f1 );
 	mepdf A2 ( &f2 );
-	A ( 0 ) =&A1;
-	A ( 1 ) =&A2;
+	A ( 0 ) = &A1;
+	A ( 1 ) = &A2;
 
-	int Npoints=100;
-	mat x_grid ( 1,Npoints );
-	x_grid.set_row ( 0,linspace ( -10.0, 10.0 ) );
+	int Npoints = 100;
+	mat x_grid ( 1, Npoints );
+	x_grid.set_row ( 0, linspace ( -10.0, 10.0 ) );
 
-	vec l_f1=f1.evallog_m ( x_grid );
-	vec l_f2=f2.evallog_m ( x_grid );
-	mat lW ( 2,Npoints );
+	vec l_f1 = f1.evallog_m ( x_grid );
+	vec l_f2 = f2.evallog_m ( x_grid );
+	mat lW ( 2, Npoints );
 	lW.set_row ( 0, l_f1 );
 	lW.set_row ( 1, l_f2 );
 
 	merger_base M ( A );
-	enorm<fsqmat> g0; g0.set_rv ( x );
-	g0.set_parameters ( vec ( "0.0" ),mat ( "100.0" ) );
+	enorm<fsqmat> g0;
+	g0.set_rv ( x );
+	g0.set_parameters ( vec ( "0.0" ), mat ( "100.0" ) );
 
-	M.set_method (  LOGNORMAL, 1.2 );
-	M.set_support(g0,200);
+	M.set_method ( LOGNORMAL, 1.2 );
+	M.set_support ( g0, 200 );
 	M.merge ();
 
Index: library/tests/datalink_test.cpp
===================================================================
--- library/tests/datalink_test.cpp (revision 424)
+++ library/tests/datalink_test.cpp (revision 477)
@@ -5,75 +5,75 @@
 using namespace bdm;
 
-TEST(test_datalink) {
-    // RV names are global, and a, b and c are already taken by a
-    // different test...
-    RV a = RV("{dla }", "2");
-    RV b = RV("{dlb }");
-    RV c = RV("{dlc }");
+TEST ( test_datalink ) {
+	// RV names are global, and a, b and c are already taken by a
+	// different test...
+	RV a = RV ( "{dla }", "2" );
+	RV b = RV ( "{dlb }" );
+	RV c = RV ( "{dlc }" );
 
-    RV ab = a;
-    ab.add(b);
+	RV ab = a;
+	ab.add ( b );
 
-    RV abc = ab;
-    abc.add(c);
+	RV abc = ab;
+	abc.add ( c );
 
-    datalink dl(ab, abc);
-    vec total("0 37 42 66");
-    vec filtered = dl.pushdown(total);
-    int exp_f[] = { 0, 37, 42 };
-    int exp_sz = sizeof(exp_f) / sizeof(exp_f[0]);
-    CHECK_EQUAL(exp_sz, filtered.size());
-    for (int i = 0; i < exp_sz; ++i) {
-        CHECK_EQUAL(exp_f[i], filtered(i));
-    }
+	datalink dl ( ab, abc );
+	vec total ( "0 37 42 66" );
+	vec filtered = dl.pushdown ( total );
+	int exp_f[] = { 0, 37, 42 };
+	int exp_sz = sizeof ( exp_f ) / sizeof ( exp_f[0] );
+	CHECK_EQUAL ( exp_sz, filtered.size() );
+	for ( int i = 0; i < exp_sz; ++i ) {
+		CHECK_EQUAL ( exp_f[i], filtered ( i ) );
+	}
 }
 
-TEST(test_datalink_m2e) {
-    RV a = RV("{dla }", "2");
-    RV b = RV("{dlb }");
-    RV c = RV("{dlc }");
+TEST ( test_datalink_m2e ) {
+	RV a = RV ( "{dla }", "2" );
+	RV b = RV ( "{dlb }" );
+	RV c = RV ( "{dlc }" );
 
-    RV ab = a;
-    ab.add(b);
+	RV ab = a;
+	ab.add ( b );
 
-    RV ba = a;
-    ba.add(b);
+	RV ba = a;
+	ba.add ( b );
 
-    RV abc = ab;
-    abc.add(c);
+	RV abc = ab;
+	abc.add ( c );
 
-    datalink_m2e dl;
-    dl.set_connection(ba, c, abc);
-    vec total("0 37 42 66");
-    vec cond = dl.get_cond(total);
-    CHECK_EQUAL(1, cond.size());
-    CHECK_EQUAL(66, cond(0));
+	datalink_m2e dl;
+	dl.set_connection ( ba, c, abc );
+	vec total ( "0 37 42 66" );
+	vec cond = dl.get_cond ( total );
+	CHECK_EQUAL ( 1, cond.size() );
+	CHECK_EQUAL ( 66, cond ( 0 ) );
 }
 
-TEST(test_datalink_m2m) {
-    RV a = RV("{dla }", "2");
-    RV b = RV("{dlb }");
-    RV c = RV("{dlc }");
+TEST ( test_datalink_m2m ) {
+	RV a = RV ( "{dla }", "2" );
+	RV b = RV ( "{dlb }" );
+	RV c = RV ( "{dlc }" );
 
-    datalink_m2m dl;
-    dl.set_connection(a, concat(b, c), concat(a, b), c);
+	datalink_m2m dl;
+	dl.set_connection ( a, concat ( b, c ), concat ( a, b ), c );
 
-    vec val("1 1.5 2");
-    vec cond("3");
+	vec val ( "1 1.5 2" );
+	vec cond ( "3" );
 
-    vec p = dl.pushdown(val);
-    double exp_p[] = { 1.0, 1.5 };
-    int exp_sz = sizeof(exp_p) / sizeof(exp_p[0]);
-    CHECK_EQUAL(exp_sz, p.size());
-    for (int i = 0; i < exp_sz; ++i) {
-        CHECK_EQUAL(exp_p[i], p(i));
-    }
+	vec p = dl.pushdown ( val );
+	double exp_p[] = { 1.0, 1.5 };
+	int exp_sz = sizeof ( exp_p ) / sizeof ( exp_p[0] );
+	CHECK_EQUAL ( exp_sz, p.size() );
+	for ( int i = 0; i < exp_sz; ++i ) {
+		CHECK_EQUAL ( exp_p[i], p ( i ) );
+	}
 
-    vec dlcond = dl.get_cond(val, cond);
-    int exp_c[] = { 2, 3 };
-    exp_sz = sizeof(exp_c) / sizeof(exp_c[0]);
-    CHECK_EQUAL(exp_sz, dlcond.size());
-    for (int i = 0; i < exp_sz; ++i) {
-        CHECK_EQUAL(exp_c[i], dlcond(i));
-    }
+	vec dlcond = dl.get_cond ( val, cond );
+	int exp_c[] = { 2, 3 };
+	exp_sz = sizeof ( exp_c ) / sizeof ( exp_c[0] );
+	CHECK_EQUAL ( exp_sz, dlcond.size() );
+	for ( int i = 0; i < exp_sz; ++i ) {
+		CHECK_EQUAL ( exp_c[i], dlcond ( i ) );
+	}
 }
Index: library/tests/mat_checks.cpp
===================================================================
--- library/tests/mat_checks.cpp (revision 465)
+++ library/tests/mat_checks.cpp (revision 477)
@@ -1,53 +1,52 @@
 #include "mat_checks.h"
 
-namespace UnitTest
-{
+namespace UnitTest {
 
-bool AreClose(const itpp::vec &expected, const itpp::vec &actual,
-	      double tolerance) {
-    if (expected.length() != actual.length()) {
-        return false;
-    }
+bool AreClose ( const itpp::vec &expected, const itpp::vec &actual,
+                double tolerance ) {
+	if ( expected.length() != actual.length() ) {
+		return false;
+	}
 
-    for (int i = 0; i < expected.length(); ++i) {
-        if (!AreClose(expected(i), actual(i), tolerance)) {
-	    return false;
+	for ( int i = 0; i < expected.length(); ++i ) {
+		if ( !AreClose ( expected ( i ), actual ( i ), tolerance ) ) {
+			return false;
+		}
 	}
-    }
 
-    return true;
+	return true;
 }
 
-bool AreClose(const itpp::vec &expected, const itpp::vec &actual,
-	      const itpp::vec &tolerance) {
-    if ((expected.length() != actual.length()) ||
-	(actual.length() != tolerance.length())) {
-        return false;
-    }
+bool AreClose ( const itpp::vec &expected, const itpp::vec &actual,
+                const itpp::vec &tolerance ) {
+	if ( ( expected.length() != actual.length() ) ||
+	        ( actual.length() != tolerance.length() ) ) {
+		return false;
+	}
 
-    for (int i = 0; i < expected.length(); ++i) {
-        if (!AreClose(expected(i), actual(i), tolerance(i))) {
-	    return false;
+	for ( int i = 0; i < expected.length(); ++i ) {
+		if ( !AreClose ( expected ( i ), actual ( i ), tolerance ( i ) ) ) {
+			return false;
+		}
 	}
-    }
 
-    return true;
+	return true;
 }
 
-bool AreClose(const itpp::mat &expected, const itpp::mat &actual, double tolerance) {
-    if ((expected.rows() != actual.rows()) ||
-	(expected.cols() != actual.cols())) {
-        return false;
-    }
+bool AreClose ( const itpp::mat &expected, const itpp::mat &actual, double tolerance ) {
+	if ( ( expected.rows() != actual.rows() ) ||
+	        ( expected.cols() != actual.cols() ) ) {
+		return false;
+	}
 
-    for (int i = 0; i < expected.rows(); ++i) {
-        for (int j = 0; j < expected.cols(); ++j) {
-	    if (!AreClose(expected(i, j), actual(i, j), tolerance)) {
-		return false;
-	    }
+	for ( int i = 0; i < expected.rows(); ++i ) {
+		for ( int j = 0; j < expected.cols(); ++j ) {
+			if ( !AreClose ( expected ( i, j ), actual ( i, j ), tolerance ) ) {
+				return false;
+			}
+		}
 	}
-    }
 
-    return true;
+	return true;
 }
 
@@ -58,13 +57,11 @@
 int CurrentContext::index = -1;
 
-CurrentContext::CurrentContext(const char *name, int idx)
-{
-    config_name = name;
-    index = idx;
+CurrentContext::CurrentContext ( const char *name, int idx ) {
+	config_name = name;
+	index = idx;
 }
 
-CurrentContext::~CurrentContext()
-{
-    config_name = "???";
-    index = -1;
+CurrentContext::~CurrentContext() {
+	config_name = "???";
+	index = -1;
 }
Index: library/tests/additive_generator.h
===================================================================
--- library/tests/additive_generator.h (revision 467)
+++ library/tests/additive_generator.h (revision 477)
@@ -19,24 +19,23 @@
 /*! Iteratively adds squared random vector to a random matrix.
  */
-class additive_generator : public generator
-{
+class additive_generator : public generator {
 private:
-    itpp::mat a;
-    itpp::mat v2;
-    double lambda;
+	itpp::mat a;
+	itpp::mat v2;
+	double lambda;
 
 public:
-    additive_generator():lambda(0.5) { }
+	additive_generator() : lambda ( 0.5 ) { }
 
-    itpp::mat next();
+	itpp::mat next();
 
-    //! Load from structure with elements:
-    //!  \code
-    //! { size = 7; // size (rows == cols) of the generated matrix
-    //!   lambda = 0.5; // weight of the added vector
-    //! }
-    //! \endcode
-    //! size is mandatory, lambda optional (with default as shown).
-    void from_setting(const Setting &set);
+	//! Load from structure with elements:
+	//!  \code
+	//! { size = 7; // size (rows == cols) of the generated matrix
+	//!   lambda = 0.5; // weight of the added vector
+	//! }
+	//! \endcode
+	//! size is mandatory, lambda optional (with default as shown).
+	void from_setting ( const Setting &set );
 };
 
Index: library/tests/epdf_harness.h
===================================================================
--- library/tests/epdf_harness.h (revision 462)
+++ library/tests/epdf_harness.h (revision 477)
@@ -22,33 +22,35 @@
 #include "base/user_info.h"
 
-namespace bdm
-{
+namespace bdm {
 
-class epdf_harness : public root
-{
+class epdf_harness : public root {
 private:
-    shared_ptr<epdf> hepdf;
-    vec mean;
-    vec variance;
-    mat support;
-    vec nbins;
-    int nsamples;
-    mat R;
-    shared_ptr<RV> mrv;
-    double tolerance;
+	shared_ptr<epdf> hepdf;
+	vec mean;
+	vec variance;
+	mat support;
+	vec nbins;
+	int nsamples;
+	mat R;
+	shared_ptr<RV> mrv;
+	double tolerance;
 
 public:
-    static void test_config(const char *config_file_name);
+	static void test_config ( const char *config_file_name );
 
-    epdf_harness():nsamples(1000), tolerance(0.1) { }
+	epdf_harness() : nsamples ( 1000 ), tolerance ( 0.1 ) { }
 
-    virtual void test(const char *config_name, int idx);
+	virtual void test ( const char *config_name, int idx );
 
-    void from_setting(const Setting &set);
+	void from_setting ( const Setting &set );
 
 protected:
-    epdf *get_epdf() { return hepdf.get(); }
+	epdf *get_epdf() {
+		return hepdf.get();
+	}
 
-    double get_tolerance() const { return tolerance; }
+	double get_tolerance() const {
+		return tolerance;
+	}
 };
 
Index: library/tests/testResample.cpp
===================================================================
--- library/tests/testResample.cpp (revision 386)
+++ library/tests/testResample.cpp (revision 477)
@@ -12,29 +12,33 @@
 int main() {
 
-	RV x("1");
-	RV xm=x; xm.t(-1);const
-	RV y("2");
-	
+	RV x ( "1" );
+	RV xm = x;
+	xm.t ( -1 );
+	const
+	RV y ( "2" );
+
 	mat A = "1";
 	vec vR = "1";
-	ldmat R(vR);
-		
+	ldmat R ( vR );
+
 	eEmp emp;
 	euni eun;
-	eun.set_parameters("0","1");
-	emp.set_statistics(ones(10),&eun);
-	vec &v=emp._w();
-	Array<vec> &S=emp._samples();
-	
-	for (int i=0;i<10;i++){	v(i) = exp(-0.5*sum(pow(S(i)-1,2.0))*10);}
-	v/=sum(v);
-	
+	eun.set_parameters ( "0", "1" );
+	emp.set_statistics ( ones ( 10 ), &eun );
+	vec &v = emp._w();
+	Array<vec> &S = emp._samples();
+
+	for ( int i = 0; i < 10; i++ ) {
+		v ( i ) = exp ( -0.5 * sum ( pow ( S ( i ) - 1, 2.0 ) ) * 10 );
+	}
+	v /= sum ( v );
+
 	cout << "p:" << S << endl;
 	cout << "w:" << v << endl;
-	
+
 	ivec ind = emp.resample();
-	
+
 	cout << ind << endl;
-	
+
 	//Exit program:
 	return 0;
Index: library/tests/egiw_harness.cpp
===================================================================
--- library/tests/egiw_harness.cpp (revision 475)
+++ library/tests/egiw_harness.cpp (revision 477)
@@ -7,21 +7,20 @@
 namespace bdm {
 
-void egiw_harness::from_setting(const Setting &set) {
-    epdf_harness::from_setting(set);				
-    UI::get(lognc, set, "lognc", UI::compulsory);
+void egiw_harness::from_setting ( const Setting &set ) {
+	epdf_harness::from_setting ( set );
+	UI::get ( lognc, set, "lognc", UI::compulsory );
 }
 
-void egiw_harness::test(const char *config_name, int idx)
-{
-    epdf_harness::test(config_name, idx);
+void egiw_harness::test ( const char *config_name, int idx ) {
+	epdf_harness::test ( config_name, idx );
 
-    CurrentContext cc(config_name, idx);
+	CurrentContext cc ( config_name, idx );
 
-    egiw *wide = dynamic_cast<egiw *>(get_epdf());
-    CHECK(wide);
+	egiw *wide = dynamic_cast<egiw *> ( get_epdf() );
+	CHECK ( wide );
 
-    if (wide) {
-        CHECK_CLOSE_EX(lognc, wide->lognc(), get_tolerance());
-    }
+	if ( wide ) {
+		CHECK_CLOSE_EX ( lognc, wide->lognc(), get_tolerance() );
+	}
 }
 
Index: library/tests/mpdf_harness.h
===================================================================
--- library/tests/mpdf_harness.h (revision 456)
+++ library/tests/mpdf_harness.h (revision 477)
@@ -22,28 +22,28 @@
 #include "base/user_info.h"
 
-namespace bdm
-{
+namespace bdm {
 
-class mpdf_harness : public root
-{
+class mpdf_harness : public root {
 private:
-    shared_ptr<mpdf> hmpdf;
-    vec cond;
-    vec mean;
-    int nsamples;
-    mat R;
-    double tolerance;
+	shared_ptr<mpdf> hmpdf;
+	vec cond;
+	vec mean;
+	int nsamples;
+	mat R;
+	double tolerance;
 
-public:    
-    static void test_config(const char *config_file_name);
+public:
+	static void test_config ( const char *config_file_name );
 
-    mpdf_harness():nsamples(1000), tolerance(0.1) { }
+	mpdf_harness() : nsamples ( 1000 ), tolerance ( 0.1 ) { }
 
-    virtual void test(const char *config_name, int idx);
+	virtual void test ( const char *config_name, int idx );
 
-    void from_setting(const Setting &set);
+	void from_setting ( const Setting &set );
 
 protected:
-    mpdf *get_mpdf() { return hmpdf.get(); }
+	mpdf *get_mpdf() {
+		return hmpdf.get();
+	}
 };
 
Index: library/tests/size_generator.cpp
===================================================================
--- library/tests/size_generator.cpp (revision 467)
+++ library/tests/size_generator.cpp (revision 477)
@@ -5,18 +5,18 @@
 using bdm::UI;
 
-void size_generator::from_setting(const Setting &set) {
-    if (set.exists("size")) {
-        UI::get(sz, set, "size");
-    }
+void size_generator::from_setting ( const Setting &set ) {
+	if ( set.exists ( "size" ) ) {
+		UI::get ( sz, set, "size" );
+	}
 
-    if (set.exists("step")) {
-        UI::get(step, set, "step");
-    }
+	if ( set.exists ( "step" ) ) {
+		UI::get ( step, set, "step" );
+	}
 }
 
 mat size_generator::next() {
-    mat A0 = randu(sz, sz);
-    mat A = A0 * A0.T();
-    sz *= step;
-    return A;
+	mat A0 = randu ( sz, sz );
+	mat A = A0 * A0.T();
+	sz *= step;
+	return A;
 }
Index: library/tests/tutorial/arx_simple.cpp
===================================================================
--- library/tests/tutorial/arx_simple.cpp (revision 386)
+++ library/tests/tutorial/arx_simple.cpp (revision 477)
@@ -1,15 +1,16 @@
 #include "estim/arx.h"
 using namespace bdm;
-	
+
 // estimation of AR(0) model
 int main() {
-	//prior 
-	mat V0 = 0.00001*eye(2); V0(0,0)= 0.1; //
-	ARX Ar; 
-	Ar.set_statistics(1, V0); //nu is default (set to have finite moments)
-							  // forgetting is default: 1.0
-	mat Data = concat_vertical( randn(1,100), ones(1,100) );
-	Ar.bayesB( Data); 
-			
-	cout << "Expected value of Theta is: " << Ar.posterior().mean() <<endl;
+	//prior
+	mat V0 = 0.00001 * eye ( 2 );
+	V0 ( 0, 0 ) = 0.1; //
+	ARX Ar;
+	Ar.set_statistics ( 1, V0 ); //nu is default (set to have finite moments)
+	// forgetting is default: 1.0
+	mat Data = concat_vertical ( randn ( 1, 100 ), ones ( 1, 100 ) );
+	Ar.bayesB ( Data );
+
+	cout << "Expected value of Theta is: " << Ar.posterior().mean() << endl;
 }
Index: library/tests/tutorial/kalman_simple.cpp
===================================================================
--- library/tests/tutorial/kalman_simple.cpp (revision 386)
+++ library/tests/tutorial/kalman_simple.cpp (revision 477)
@@ -1,30 +1,30 @@
 #include "estim/kalman.h"
 using namespace bdm;
-	
+
 // estimation of AR(0) model
 int main() {
 	//dimensions
-	int dx=3, dy=3, du=1;
+	int dx = 3, dy = 3, du = 1;
 	// matrices
-	mat A = eye(dx);
-	mat B = zeros(dx,du);
-	mat C = eye(dx);
-	mat D = zeros(dy,du);
-	mat Q = eye(dx);
-	mat R = 0.1*eye(dy);
+	mat A = eye ( dx );
+	mat B = zeros ( dx, du );
+	mat C = eye ( dx );
+	mat D = zeros ( dy, du );
+	mat Q = eye ( dx );
+	mat R = 0.1 * eye ( dy );
 	//prior
-	mat P0 = 100*eye(dx);
-	vec mu0 = zeros(dx);
+	mat P0 = 100 * eye ( dx );
+	vec mu0 = zeros ( dx );
 	// Estimator
 	KalmanCh KF;
-	KF.set_parameters(A,B,C,D,/*covariances*/ Q,R);
-	KF.set_statistics(mu0,P0);
+	KF.set_parameters ( A, B, C, D,/*covariances*/ Q, R );
+	KF.set_statistics ( mu0, P0 );
 	// Estimation loop
-	for (int i=0;i<100;i++){
-		KF.bayes(randn(dx+du));
+	for ( int i = 0; i < 100; i++ ) {
+		KF.bayes ( randn ( dx + du ) );
 	}
 	//print results
 	cout << "Posterior estimate of x is: "  << endl;
-	cout << "mean: "<< KF.posterior().mean()<< endl;
-	cout << "variance: "<< KF.posterior().variance()<< endl;
+	cout << "mean: " << KF.posterior().mean() << endl;
+	cout << "variance: " << KF.posterior().variance() << endl;
 }
Index: library/tests/rv_test.cpp
===================================================================
--- library/tests/rv_test.cpp (revision 431)
+++ library/tests/rv_test.cpp (revision 477)
@@ -6,113 +6,112 @@
 using namespace bdm;
 
-TEST(test_rv)
-{
-    RV a = RV("{a }", "3");
-    CHECK_EQUAL(1, a.length());
-    CHECK_EQUAL(3, a.size(0));
-    CHECK_EQUAL(std::string("a"), a.name(0));
+TEST ( test_rv ) {
+	RV a = RV ( "{a }", "3" );
+	CHECK_EQUAL ( 1, a.length() );
+	CHECK_EQUAL ( 3, a.size ( 0 ) );
+	CHECK_EQUAL ( std::string ( "a" ), a.name ( 0 ) );
 
-    RV b = RV("{b }", "2");
-    CHECK_EQUAL(0, b.mint());
+	RV b = RV ( "{b }", "2" );
+	CHECK_EQUAL ( 0, b.mint() );
 
-    RV c = RV("{c }");
-    CHECK_EQUAL(1, c.length());
-    CHECK_EQUAL(1, c.size(0));
+	RV c = RV ( "{c }" );
+	CHECK_EQUAL ( 1, c.length() );
+	CHECK_EQUAL ( 1, c.size ( 0 ) );
 
-    RV trv = RV("{e f }", "1 2", "3 4");
-    CHECK_EQUAL(2, trv.length());
-    CHECK_EQUAL(3, trv.mint());
+	RV trv = RV ( "{e f }", "1 2", "3 4" );
+	CHECK_EQUAL ( 2, trv.length() );
+	CHECK_EQUAL ( 3, trv.mint() );
 
-    // add a and b
-    RV ab = a;
-    bool added = ab.add(b);
-    CHECK(added);
-    CHECK_EQUAL(2, ab.length());
-    CHECK_EQUAL(3, ab.size(0));
-    CHECK_EQUAL(std::string("a"), ab.name(0));
-    CHECK_EQUAL(2, ab.size(1));
-    CHECK_EQUAL(std::string("b"), ab.name(1));
+	// add a and b
+	RV ab = a;
+	bool added = ab.add ( b );
+	CHECK ( added );
+	CHECK_EQUAL ( 2, ab.length() );
+	CHECK_EQUAL ( 3, ab.size ( 0 ) );
+	CHECK_EQUAL ( std::string ( "a" ), ab.name ( 0 ) );
+	CHECK_EQUAL ( 2, ab.size ( 1 ) );
+	CHECK_EQUAL ( std::string ( "b" ), ab.name ( 1 ) );
 
-    std::stringstream abss;
-    abss << ab;
-    CHECK_EQUAL(std::string("1(3)=a_{0}; 2(2)=b_{0}; "), abss.str());
+	std::stringstream abss;
+	abss << ab;
+	CHECK_EQUAL ( std::string ( "1(3)=a_{0}; 2(2)=b_{0}; " ), abss.str() );
 
-    // concat a, b and c
-    RV abc = concat(ab, c);
-    CHECK_EQUAL(3, abc.length());
-    std::stringstream abcss;
-    abcss << abc;
-    CHECK_EQUAL(std::string("1(3)=a_{0}; 2(2)=b_{0}; 3(1)=c_{0}; "), abcss.str());
+	// concat a, b and c
+	RV abc = concat ( ab, c );
+	CHECK_EQUAL ( 3, abc.length() );
+	std::stringstream abcss;
+	abcss << abc;
+	CHECK_EQUAL ( std::string ( "1(3)=a_{0}; 2(2)=b_{0}; 3(1)=c_{0}; " ), abcss.str() );
 
-    // structure of a, b, c
-    str s = abc.tostr();
-    int exp_ids[] = { 1, 1, 1, 2, 2, 3 };
-    int exp_sz = sizeof(exp_ids) / sizeof(exp_ids[0]);
-    CHECK_EQUAL(exp_sz, s.ids.size());
-    CHECK_EQUAL(exp_sz, s.times.size());
-    for (int i = 0; i < exp_sz; ++i) {
-        CHECK_EQUAL(exp_ids[i], s.ids(i));
-        CHECK_EQUAL(0, s.times(i));
-    }
+	// structure of a, b, c
+	str s = abc.tostr();
+	int exp_ids[] = { 1, 1, 1, 2, 2, 3 };
+	int exp_sz = sizeof ( exp_ids ) / sizeof ( exp_ids[0] );
+	CHECK_EQUAL ( exp_sz, s.ids.size() );
+	CHECK_EQUAL ( exp_sz, s.times.size() );
+	for ( int i = 0; i < exp_sz; ++i ) {
+		CHECK_EQUAL ( exp_ids[i], s.ids ( i ) );
+		CHECK_EQUAL ( 0, s.times ( i ) );
+	}
 
-    RV slice = abc(1, 2);
-    CHECK_EQUAL(1, slice.length());
-    CHECK_EQUAL(3, slice.size(0));
-    CHECK_EQUAL(std::string("a"), slice.name(0));
+	RV slice = abc ( 1, 2 );
+	CHECK_EQUAL ( 1, slice.length() );
+	CHECK_EQUAL ( 3, slice.size ( 0 ) );
+	CHECK_EQUAL ( std::string ( "a" ), slice.name ( 0 ) );
 
-    // find a in abc
-    ivec f = a.findself(abc);
-    CHECK_EQUAL(1, f.length());
-    CHECK_EQUAL(0, f(0));
+	// find a in abc
+	ivec f = a.findself ( abc );
+	CHECK_EQUAL ( 1, f.length() );
+	CHECK_EQUAL ( 0, f ( 0 ) );
 
-    // find abc in a
-    f = abc.findself(a);
-    int exp_indices[] = { 0, -1, -1 };
-    CHECK_EQUAL(3, f.length());
-    for (unsigned i = 0;
-	 i < sizeof(exp_indices) / sizeof(exp_indices[0]);
-	 ++i) {
-        CHECK_EQUAL(exp_indices[i], f(i));
-    }
+	// find abc in a
+	f = abc.findself ( a );
+	int exp_indices[] = { 0, -1, -1 };
+	CHECK_EQUAL ( 3, f.length() );
+	for ( unsigned i = 0;
+	        i < sizeof ( exp_indices ) / sizeof ( exp_indices[0] );
+	        ++i ) {
+		CHECK_EQUAL ( exp_indices[i], f ( i ) );
+	}
 
-    // subtract b from abc
-    RV ac = abc.subt(b);
-    std::stringstream acss;
-    acss << ac;
-    CHECK_EQUAL(std::string("1(3)=a_{0}; 3(1)=c_{0}; "), acss.str());
+	// subtract b from abc
+	RV ac = abc.subt ( b );
+	std::stringstream acss;
+	acss << ac;
+	CHECK_EQUAL ( std::string ( "1(3)=a_{0}; 3(1)=c_{0}; " ), acss.str() );
 
-    // data index of ac in abc
-    ivec di = ac.dataind(abc);
-    int exp_di[] = { 0, 1, 2, 5 };
-    exp_sz = sizeof(exp_di) / sizeof(exp_di[0]);
-    CHECK_EQUAL(exp_sz, di.size());
-    for (int i = 0; i < exp_sz; ++i) {
-        CHECK_EQUAL(exp_di[i], di(i));
-    }
+	// data index of ac in abc
+	ivec di = ac.dataind ( abc );
+	int exp_di[] = { 0, 1, 2, 5 };
+	exp_sz = sizeof ( exp_di ) / sizeof ( exp_di[0] );
+	CHECK_EQUAL ( exp_sz, di.size() );
+	for ( int i = 0; i < exp_sz; ++i ) {
+		CHECK_EQUAL ( exp_di[i], di ( i ) );
+	}
 
-    // Copy indices between ba and ab
-    RV ba = b;
-    ba.add(a);
-	
-    ivec ai;
-    ivec bi;
-    ba.dataind(ac, ai, bi);
+	// Copy indices between ba and ab
+	RV ba = b;
+	ba.add ( a );
 
-    int exp_ai[] = { 2, 3, 4 };
-    exp_sz = sizeof(exp_ai) / sizeof(exp_ai[0]);
-    CHECK_EQUAL(exp_sz, ai.size());
-    for (unsigned i = 0;
-	 i < sizeof(exp_ai) / sizeof(exp_ai[0]);
-	 ++i) {
-        CHECK_EQUAL(exp_ai[i], ai(i));
-    }
+	ivec ai;
+	ivec bi;
+	ba.dataind ( ac, ai, bi );
 
-    int exp_bi[] = { 0, 1, 2 };
-    exp_sz = sizeof(exp_bi) / sizeof(exp_bi[0]);
-    CHECK_EQUAL(exp_sz, bi.size());
-    for (unsigned i = 0;
-	 i < sizeof(exp_bi) / sizeof(exp_bi[0]);
-	 ++i) {
-        CHECK_EQUAL(exp_bi[i], bi(i));
-    }
+	int exp_ai[] = { 2, 3, 4 };
+	exp_sz = sizeof ( exp_ai ) / sizeof ( exp_ai[0] );
+	CHECK_EQUAL ( exp_sz, ai.size() );
+	for ( unsigned i = 0;
+	        i < sizeof ( exp_ai ) / sizeof ( exp_ai[0] );
+	        ++i ) {
+		CHECK_EQUAL ( exp_ai[i], ai ( i ) );
+	}
+
+	int exp_bi[] = { 0, 1, 2 };
+	exp_sz = sizeof ( exp_bi ) / sizeof ( exp_bi[0] );
+	CHECK_EQUAL ( exp_sz, bi.size() );
+	for ( unsigned i = 0;
+	        i < sizeof ( exp_bi ) / sizeof ( exp_bi[0] );
+	        ++i ) {
+		CHECK_EQUAL ( exp_bi[i], bi ( i ) );
+	}
 }
Index: library/tests/square_mat_prep.cpp
===================================================================
--- library/tests/square_mat_prep.cpp (revision 468)
+++ library/tests/square_mat_prep.cpp (revision 477)
@@ -14,7 +14,7 @@
 using namespace itpp;
 
-UIREGISTER(size_generator);
-UIREGISTER(additive_generator);
-UIREGISTER(square_mat_point);
+UIREGISTER ( size_generator );
+UIREGISTER ( additive_generator );
+UIREGISTER ( square_mat_point );
 
 const char *generator_file_name = "generator.cfg";
@@ -22,64 +22,64 @@
 int agenda_length = 10;
 
-int main(int argc, char const *argv[]) {
-    RNG_randomize();
+int main ( int argc, char const *argv[] ) {
+	RNG_randomize();
 
-    bool unknown = false;
-    int update_next = 0; // 1 generator file, 2 agenda file, 3 agenda length
-    const char **param = argv + 1;
-    while (*param && !unknown) {
-        if (update_next) {
-	    if (update_next == 1) {
-	        generator_file_name = *param;
-	    } else if (update_next == 2) {
-	        agenda_file_name = *param;
-	    } else {
-		int length = atoi(*param);
-		if (length > 0) {
-		    agenda_length = length;
+	bool unknown = false;
+	int update_next = 0; // 1 generator file, 2 agenda file, 3 agenda length
+	const char **param = argv + 1;
+	while ( *param && !unknown ) {
+		if ( update_next ) {
+			if ( update_next == 1 ) {
+				generator_file_name = *param;
+			} else if ( update_next == 2 ) {
+				agenda_file_name = *param;
+			} else {
+				int length = atoi ( *param );
+				if ( length > 0 ) {
+					agenda_length = length;
+				} else {
+					cerr << "invalid agenda length value ignored" << endl;
+				}
+			}
+
+			update_next = 0;
 		} else {
-		    cerr << "invalid agenda length value ignored" << endl;
+			if ( !strcmp ( *param, "-a" ) ) {
+				update_next = 2;
+			} else if ( !strcmp ( *param, "-g" ) ) {
+				update_next = 1;
+			} else if ( !strcmp ( *param, "-l" ) ) {
+				update_next = 3;
+			} else {
+				unknown = true;
+			}
 		}
-	    }
 
-	    update_next = 0;
-	} else {
-	    if (!strcmp(*param, "-a")) {
-	        update_next = 2;
-	    } else if (!strcmp(*param, "-g")) {
-	        update_next = 1;
-	    } else if (!strcmp(*param, "-l")) {
-	        update_next = 3;
-	    } else {
-	        unknown = true;
-	    }
+		++param;
 	}
 
-	++param;
-    }
+	if ( unknown || update_next ) {
+		cerr << "usage: " << argv[0] << " [ -g generator.cfg ] [ -a agenda_output.cfg ] [ -l agenda_length ]" << endl;
+	} else {
+		Array<square_mat_point *> mag ( agenda_length );
 
-    if (unknown || update_next) {
-        cerr << "usage: " << argv[0] << " [ -g generator.cfg ] [ -a agenda_output.cfg ] [ -l agenda_length ]" << endl;
-    } else {
-	Array<square_mat_point *> mag(agenda_length);
+		UIFile gspec ( generator_file_name );
+		auto_ptr<generator> gen ( UI::build<generator> ( gspec, "generator" ) );
+		for ( int i = 0; i < agenda_length; ++i ) {
+			mat m = gen->next();
+			square_mat_point *p = new square_mat_point();
+			p->set_parameters ( m, randu ( m.rows() ), randu() );
+			mag ( i ) = p;
+		}
 
-	UIFile gspec(generator_file_name);
-	auto_ptr<generator> gen(UI::build<generator>(gspec, "generator"));
-	for (int i = 0; i < agenda_length; ++i) {
-	    mat m = gen->next();
-	    square_mat_point *p = new square_mat_point();
-	    p->set_parameters(m, randu(m.rows()), randu());
-	    mag(i) = p;
+		UIFile fag;
+		UI::save ( mag, fag, "agenda" );
+		fag.save ( agenda_file_name );
+
+		for ( int i = 0; i < agenda_length; ++i ) {
+			square_mat_point *p = mag ( i );
+			mag ( i ) = 0;
+			delete p;
+		}
 	}
-
-	UIFile fag;
-	UI::save(mag, fag, "agenda");
-	fag.save(agenda_file_name);
-
-	for (int i = 0; i < agenda_length; ++i) {
-	    square_mat_point *p = mag(i);
-	    mag(i) = 0;
-	    delete p;
-	}
-    }
 }
Index: library/tests/arx_test.cpp
===================================================================
--- library/tests/arx_test.cpp (revision 386)
+++ library/tests/arx_test.cpp (revision 477)
@@ -1,4 +1,4 @@
 /*!
-\file 
+\file
 \brief Test of basic elements of the ARX class
 
@@ -17,13 +17,14 @@
 	// Setup model
 	vec th ( "0.8 -0.3 0.4 0.01" );
-	int ord=th.length(); //auxiliary variable
-	double sqr=0.1;
+	int ord = th.length(); //auxiliary variable
+	double sqr = 0.1;
 
 	//Test constructor
-	mat V0 = 0.00001*eye ( ord+1 ); V0 ( 0.0 ) = 1; //
-	double nu0 = ord+5.0;
+	mat V0 = 0.00001 * eye ( ord + 1 );
+	V0 ( 0.0 ) = 1; //
+	double nu0 = ord + 5.0;
 
 	ARX Ar;
-	Ar.set_statistics(1, V0, nu0 );                 // Estimator
+	Ar.set_statistics ( 1, V0, nu0 );               // Estimator
 	const epdf& f_thr = Ar.posterior();          // refrence to posterior of the estimator
 
@@ -31,18 +32,20 @@
 	int ndat = 100;                 // number of data records
 	vec Yt ( ndat );                // Store generated data
-	Yt.set_subvector ( 0,randn ( ord ) ); //initial values
+	Yt.set_subvector ( 0, randn ( ord ) ); //initial values
 	vec rgr ( ord );                // regressor
-	vec Psi ( ord+1 );              // extended regressor
+	vec Psi ( ord + 1 );            // extended regressor
 
 	//print moments of the prior distribution
-	cout << "prior mean: " << f_thr.mean() <<endl;
-	cout << "prior variance: " << f_thr.variance() <<endl;
+	cout << "prior mean: " << f_thr.mean() << endl;
+	cout << "prior variance: " << f_thr.variance() << endl;
 
 	// cycle over time:
-	for ( int t=ord; t<ndat; t++ ) {
+	for ( int t = ord; t < ndat; t++ ) {
 		//Generate regressor
-		for ( int j=0;j< ( ord );j++ ) {rgr ( j ) =Yt ( t-j-1 );}
+		for ( int j = 0; j < ( ord ); j++ ) {
+			rgr ( j ) = Yt ( t - j - 1 );
+		}
 		//model
-		Yt ( t ) = th*rgr + sqr * NorRNG();
+		Yt ( t ) = th * rgr + sqr * NorRNG();
 
 		Psi = concat ( Yt ( t ), rgr ); // Inefficient! Used for compatibility with Matlab!
@@ -53,14 +56,14 @@
 		// Test similarity of likelihoods from the Bayes rule and the predictor
 		cout << "BR log-lik: " << Ar._ll();
-		cout <<" , predictor ll: " <<  Pr->evallogcond ( vec_1 ( Yt ( t ) ),rgr )  <<endl;
+		cout << " , predictor ll: " <<  Pr->evallogcond ( vec_1 ( Yt ( t ) ), rgr )  << endl;
 		delete Pr;
 	}
 	//print posterior moments
-	cout << "posterior mean: " << f_thr.mean() <<endl;
-	cout << "posterior variance: " << f_thr.variance() <<endl;
+	cout << "posterior mean: " << f_thr.mean() << endl;
+	cout << "posterior variance: " << f_thr.variance() << endl;
 
 	// Test brute-froce structure estimation
-	
-	cout << "Structure estimation: " <<endl;
-	cout <<Ar.structure_est ( egiw ( 1,V0,nu0 ) ) <<endl;
+
+	cout << "Structure estimation: " << endl;
+	cout << Ar.structure_est ( egiw ( 1, V0, nu0 ) ) << endl;
 }
Index: library/tests/additive_generator.cpp
===================================================================
--- library/tests/additive_generator.cpp (revision 467)
+++ library/tests/additive_generator.cpp (revision 477)
@@ -5,21 +5,21 @@
 using bdm::UI;
 
-void additive_generator::from_setting(const Setting &set) {
-    int sz;
-    UI::get(sz, set, "size");
+void additive_generator::from_setting ( const Setting &set ) {
+	int sz;
+	UI::get ( sz, set, "size" );
 
-    mat a0 = randu(sz, sz);
-    a = a0 * a0.T();
-    vec v = randu(sz);
-    v2 = outer_product(v, v);
+	mat a0 = randu ( sz, sz );
+	a = a0 * a0.T();
+	vec v = randu ( sz );
+	v2 = outer_product ( v, v );
 
-    if (set.exists("lambda")) {
-        UI::get(lambda, set, "lambda");
-    }
+	if ( set.exists ( "lambda" ) ) {
+		UI::get ( lambda, set, "lambda" );
+	}
 }
 
 mat additive_generator::next() {
-    mat b = a;
-    a = (1 - lambda) * a + lambda * v2;
-    return b;
+	mat b = a;
+	a = ( 1 - lambda ) * a + lambda * v2;
+	return b;
 }
Index: library/tests/testSmp.cpp
===================================================================
--- library/tests/testSmp.cpp (revision 461)
+++ library/tests/testSmp.cpp (revision 477)
@@ -9,13 +9,13 @@
 using std::endl;
 
-void disp(const vec &tmu, const mat &tR,const mat &Smp){
+void disp ( const vec &tmu, const mat &tR, const mat &Smp ) {
 	int N = Smp.cols();
-	vec Emu = Smp*ones(N) /N ;
-	mat Er = (Smp*Smp.transpose())/N - outer_product(Emu,Emu);
-	cout << "True mu:" << tmu <<endl;
-	cout << "Emp  mu:" << Emu <<endl;
-	
-	cout << "True R:" << tR <<endl;
-	cout << "Emp  R:" << Er <<endl;
+	vec Emu = Smp * ones ( N ) / N ;
+	mat Er = ( Smp * Smp.transpose() ) / N - outer_product ( Emu, Emu );
+	cout << "True mu:" << tmu << endl;
+	cout << "Emp  mu:" << Emu << endl;
+
+	cout << "True R:" << tR << endl;
+	cout << "Emp  R:" << Er << endl;
 }
 
@@ -24,114 +24,119 @@
 	RNG_randomize();
 
-	RV x("{x }","2");
-	RV y("{y }","2");
+	RV x ( "{x }", "2" );
+	RV y ( "{y }", "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);
-	
-	cout << "====== ENorm ====== " <<endl;
+	mat V0 ( "1.2 0.3; 0.3 5" );
+	ldmat R = ldmat ( V0 );
+
+	cout << "====== ENorm ====== " << endl;
 	enorm<ldmat> eN;
-	eN.set_parameters(mu0,R);
-	mat Smp = eN.sample_m(N);
+	eN.set_parameters ( mu0, R );
+	mat Smp = eN.sample_m ( N );
 
-	disp(mu0,R.to_mat(),Smp);
+	disp ( mu0, R.to_mat(), Smp );
 
-	cout << "====== MlNorm ====== " <<endl;
-	mat I = eye(2);
+	cout << "====== MlNorm ====== " << endl;
+	mat I = eye ( 2 );
 	mlnorm<ldmat> ML;
-	ML.set_parameters(I,zeros(2),R);
-	Smp = ML.samplecond_m(mu0,N);
-	
-	disp(mu0,R.to_mat(),Smp);
+	ML.set_parameters ( I, zeros ( 2 ), R );
+	Smp = ML.samplecond_m ( mu0, N );
 
-	cout << "====== EGamma ====== " <<endl;	
+	disp ( mu0, R.to_mat(), Smp );
+
+	cout << "====== EGamma ====== " << endl;
 	vec a = "100000,10000";
-	vec b = a/10.0;
+	vec b = a / 10.0;
 	egamma eG;
-	eG.set_parameters(a,b);
-	
-	cout << eG.evallog(a)<<endl;
-	Smp = eG.sample_m(N);
+	eG.set_parameters ( a, b );
 
-	vec g_mu = elem_div(a,b);
-	vec g_var = elem_div(a,pow(b,2.0));
-	disp(g_mu,diag(g_var),Smp);
+	cout << eG.evallog ( a ) << endl;
+	Smp = eG.sample_m ( N );
 
-	cout << "====== MGamma ====== " <<endl;	
+	vec g_mu = elem_div ( a, b );
+	vec g_var = elem_div ( a, pow ( b, 2.0 ) );
+	disp ( g_mu, diag ( g_var ), Smp );
+
+	cout << "====== MGamma ====== " << endl;
 	mgamma mG;
 	double k = 10.0;
-	mG.set_parameters(k,mu0);
+	mG.set_parameters ( k, mu0 );
 
-	Smp=mG.samplecond_m(mu0,N);
-	disp(mu0,pow(mu0,2.0)/k,Smp);
-	
+	Smp = mG.samplecond_m ( mu0, N );
+	disp ( mu0, pow ( mu0, 2.0 ) / k, Smp );
+
 	cout << "======= EMix ======== " << endl;
 	emix eMix;
-	Array<epdf*> Coms(2);
-	Coms(0) = &eG;
-	Coms(1) = &eN;
-	
-	eMix.set_parameters(vec_2(0.5,0.5), Coms);
+	Array<epdf*> Coms ( 2 );
+	Coms ( 0 ) = &eG;
+	Coms ( 1 ) = &eN;
+
+	eMix.set_parameters ( vec_2 ( 0.5, 0.5 ), Coms );
 	vec smp = eMix.sample();
-	Smp = eMix.sample_m(N);
-	disp(eMix.mean(),zeros(2),Smp);
+	Smp = eMix.sample_m ( N );
+	disp ( eMix.mean(), zeros ( 2 ), Smp );
 
 	cout << "======= MEpdf ======== " << endl;
-	mepdf meMix(&eMix);
-	
-	Smp = meMix.samplecond_m(mu0,N);
-	disp(eMix.mean(),zeros(2),Smp);
+	mepdf meMix ( &eMix );
+
+	Smp = meMix.samplecond_m ( mu0, N );
+	disp ( eMix.mean(), zeros ( 2 ), Smp );
 
 	cout << "======= MMix ======== " << endl;
 	mmix mMix;
-	Array<mpdf*> mComs(2);
-	mComs(0) = &mG;
-	eN.set_mu(vec_2(0.0,0.0));
-	mepdf mEnorm(&eN);
-	mComs(1) = &mEnorm;
-	mMix.set_parameters(vec_2(0.5,0.5),mComs);
-	
-	Smp = mMix.samplecond_m(mu0,N);
-	disp(mMix.e()->mean(), zeros(2), Smp);
+	Array<mpdf*> mComs ( 2 );
+	mComs ( 0 ) = &mG;
+	eN.set_mu ( vec_2 ( 0.0, 0.0 ) );
+	mepdf mEnorm ( &eN );
+	mComs ( 1 ) = &mEnorm;
+	mMix.set_parameters ( vec_2 ( 0.5, 0.5 ), mComs );
+
+	Smp = mMix.samplecond_m ( mu0, N );
+	disp ( mMix.e()->mean(), zeros ( 2 ), Smp );
 
 	cout << "======= EProd ======== " << endl;
 	// we have to change eG.rv to y
-	eN.set_rv(x);
-	eG.set_rv(y);
-	//create array 
-	Array<mpdf*> A(2);
-	mepdf meN(&eN);
-	mepdf meG(&eG);
-	A(0) = &meN;
-	A(1) = &meG;
-	
-	mprod eP(A);
-	mat epV=zeros(4,4);
-	epV.set_submatrix(0,0,V0);
-	epV.set_submatrix(2,2,diag(g_var));
-	
-	vec v0=vec(0);
-	Smp = eP.samplecond(v0,N);
-	disp(concat(eN.mean(),eG.mean()), epV,Smp);
-	
+	eN.set_rv ( x );
+	eG.set_rv ( y );
+	//create array
+	Array<mpdf*> A ( 2 );
+	mepdf meN ( &eN );
+	mepdf meG ( &eG );
+	A ( 0 ) = &meN;
+	A ( 1 ) = &meG;
+
+	mprod eP ( A );
+	mat epV = zeros ( 4, 4 );
+	epV.set_submatrix ( 0, 0, V0 );
+	epV.set_submatrix ( 2, 2, diag ( g_var ) );
+
+	vec v0 = vec ( 0 );
+	Smp = eP.samplecond ( v0, N );
+	disp ( concat ( eN.mean(), eG.mean() ), epV, Smp );
+
 	cout << "======= eWishart ======== " << endl;
-	mat wM="1.0 0.9; 0.9 1.0";
-	eWishartCh eW; eW.set_parameters(wM/100,100);
-	mat mea=zeros(2,2);
-	mat Ch(2,2);
-	for (int i=0;i<100;i++){Ch=eW.sample_mat(); mea+=Ch.T()*Ch;}
-	cout << mea /100 <<endl;
-	
+	mat wM = "1.0 0.9; 0.9 1.0";
+	eWishartCh eW;
+	eW.set_parameters ( wM / 100, 100 );
+	mat mea = zeros ( 2, 2 );
+	mat Ch ( 2, 2 );
+	for ( int i = 0; i < 100; i++ ) {
+		Ch = eW.sample_mat();
+		mea += Ch.T() * Ch;
+	}
+	cout << mea / 100 << endl;
+
 	cout << "======= rwiWishart ======== " << endl;
-	rwiWishartCh rwW; rwW.set_parameters(2,0.1,"1 1",0.9);
-	mea=zeros(2,2);
-	mat wMch=chol(wM);
-	for (int i=0;i<100;i++){ 
-		vec tmp=rwW.samplecond(vec(wMch._data(),4));
-		 copy_vector(4,tmp._data(), Ch._data()); 
-		 mea+=Ch.T()*Ch;
+	rwiWishartCh rwW;
+	rwW.set_parameters ( 2, 0.1, "1 1", 0.9 );
+	mea = zeros ( 2, 2 );
+	mat wMch = chol ( wM );
+	for ( int i = 0; i < 100; i++ ) {
+		vec tmp = rwW.samplecond ( vec ( wMch._data(), 4 ) );
+		copy_vector ( 4, tmp._data(), Ch._data() );
+		mea += Ch.T() * Ch;
 	}
-	cout << mea /100 <<endl;
+	cout << mea / 100 << endl;
 	//Exit program:
 	return 0;
Index: library/tests/square_mat_test.cpp
===================================================================
--- library/tests/square_mat_test.cpp (revision 456)
+++ library/tests/square_mat_test.cpp (revision 477)
@@ -8,83 +8,83 @@
 
 template<typename TMatrix>
-void test_square_matrix(double epsilon) {
-    int sz = 3;
-    mat A0 = randu(sz, sz);
-    mat A = A0 * A0.T();
-	
-    TMatrix sqmat(A);
-    CHECK_EQUAL(sz, sqmat.rows());
-    CHECK_EQUAL(sz, sqmat.cols());
+void test_square_matrix ( double epsilon ) {
+	int sz = 3;
+	mat A0 = randu ( sz, sz );
+	mat A = A0 * A0.T();
 
-    mat res = sqmat.to_mat();
-    CHECK_CLOSE(A, res, epsilon);
+	TMatrix sqmat ( A );
+	CHECK_EQUAL ( sz, sqmat.rows() );
+	CHECK_EQUAL ( sz, sqmat.cols() );
 
-    vec v = randu(sz);
-    double w = randu();
-    TMatrix sqmat2 = sqmat;	
-    sqmat2.opupdt(v, w);
+	mat res = sqmat.to_mat();
+	CHECK_CLOSE ( A, res, epsilon );
 
-    res = A + w * outer_product(v, v);
-    CHECK_CLOSE(res, sqmat2.to_mat(), epsilon);
+	vec v = randu ( sz );
+	double w = randu();
+	TMatrix sqmat2 = sqmat;
+	sqmat2.opupdt ( v, w );
 
-    TMatrix invmat(sz);
-    sqmat.inv(invmat);
-    mat invA = inv(A);
-    CHECK_CLOSE(invA, invmat.to_mat(), epsilon);
+	res = A + w * outer_product ( v, v );
+	CHECK_CLOSE ( res, sqmat2.to_mat(), epsilon );
 
-    double d = det(A);
-    CHECK_CLOSE(log(d), sqmat.logdet(), epsilon);
+	TMatrix invmat ( sz );
+	sqmat.inv ( invmat );
+	mat invA = inv ( A );
+	CHECK_CLOSE ( invA, invmat.to_mat(), epsilon );
 
-    double q = sqmat.qform(ones(sz));
-    CHECK_CLOSE(sumsum(A), q, epsilon);
+	double d = det ( A );
+	CHECK_CLOSE ( log ( d ), sqmat.logdet(), epsilon );
 
-    q = sqmat.qform(v);
-    double r = (A * v) * v;
-    CHECK_CLOSE(r, q, epsilon);
+	double q = sqmat.qform ( ones ( sz ) );
+	CHECK_CLOSE ( sumsum ( A ), q, epsilon );
 
-    q = sqmat.invqform(v);
-    r = (invA * v) * v;
-    CHECK_CLOSE(r, q, epsilon);
+	q = sqmat.qform ( v );
+	double r = ( A * v ) * v;
+	CHECK_CLOSE ( r, q, epsilon );
 
-    sqmat2 = sqmat;
-    sqmat2.clear();
-    CHECK_EQUAL(0, sqmat2.qform(ones(sz)));
+	q = sqmat.invqform ( v );
+	r = ( invA * v ) * v;
+	CHECK_CLOSE ( r, q, epsilon );
 
-    TMatrix twice = sqmat;
-    twice += sqmat;
-    res = 2 * A;
-    CHECK_CLOSE(res, twice.to_mat(), epsilon);
+	sqmat2 = sqmat;
+	sqmat2.clear();
+	CHECK_EQUAL ( 0, sqmat2.qform ( ones ( sz ) ) );
 
-    twice = sqmat;
-    twice *= 2;
-    CHECK_CLOSE(res, twice.to_mat(), epsilon);
+	TMatrix twice = sqmat;
+	twice += sqmat;
+	res = 2 * A;
+	CHECK_CLOSE ( res, twice.to_mat(), epsilon );
 
-    sqmat2 = sqmat;
-    mat B = randu(sz, sz);
-    sqmat2.mult_sym(B);
-    res = (B * A) * B.T();
-    CHECK_CLOSE(res, sqmat2.to_mat(), epsilon);
+	twice = sqmat;
+	twice *= 2;
+	CHECK_CLOSE ( res, twice.to_mat(), epsilon );
 
-    mat C = randu(sz, sz-1);
-	 TMatrix CAC(sz-1);
-    sqmat.mult_sym_t(C,CAC);
-    res = (C.T() * A) * C;
-    CHECK_CLOSE(res, CAC.to_mat(), epsilon);
+	sqmat2 = sqmat;
+	mat B = randu ( sz, sz );
+	sqmat2.mult_sym ( B );
+	res = ( B * A ) * B.T();
+	CHECK_CLOSE ( res, sqmat2.to_mat(), epsilon );
 
-    sqmat2 = sqmat;
-    sqmat2.mult_sym_t(B);
-    res = (B.T() * A) * B;
-    CHECK_CLOSE(res, sqmat2.to_mat(), epsilon);
+	mat C = randu ( sz, sz - 1 );
+	TMatrix CAC ( sz - 1 );
+	sqmat.mult_sym_t ( C, CAC );
+	res = ( C.T() * A ) * C;
+	CHECK_CLOSE ( res, CAC.to_mat(), epsilon );
+
+	sqmat2 = sqmat;
+	sqmat2.mult_sym_t ( B );
+	res = ( B.T() * A ) * B;
+	CHECK_CLOSE ( res, sqmat2.to_mat(), epsilon );
 }
 
-TEST(test_ldmat) {
-    test_square_matrix<ldmat>(epsilon);
+TEST ( test_ldmat ) {
+	test_square_matrix<ldmat> ( epsilon );
 }
 
-TEST(test_fsqmat) {
-    test_square_matrix<fsqmat>(epsilon);
+TEST ( test_fsqmat ) {
+	test_square_matrix<fsqmat> ( epsilon );
 }
 
-TEST(test_chmat) {
-    test_square_matrix<chmat>(epsilon);
+TEST ( test_chmat ) {
+	test_square_matrix<chmat> ( epsilon );
 }
Index: library/tests/epdf_harness.cpp
===================================================================
--- library/tests/epdf_harness.cpp (revision 471)
+++ library/tests/epdf_harness.cpp (revision 477)
@@ -12,107 +12,106 @@
 
 template<>
-const ParticularUI<epdf_harness> &ParticularUI<epdf_harness>::factory(
-    ParticularUI<epdf_harness>("epdf_harness"));
+const ParticularUI<epdf_harness> &ParticularUI<epdf_harness>::factory (
+    ParticularUI<epdf_harness> ( "epdf_harness" ) );
 
-void epdf_harness::test_config(const char *config_file_name) {
-    RV::clear_all();
+void epdf_harness::test_config ( const char *config_file_name ) {
+	RV::clear_all();
 
-    UIFile in(config_file_name);
-    Array<epdf_harness *> input;
-    UI::get(input, in, "data");
-    int sz = input.size();
-    CHECK(sz > 0);
-    for (int i = 0; i < sz; ++i) {
-        input(i)->test(config_file_name, i);
-    }
+	UIFile in ( config_file_name );
+	Array<epdf_harness *> input;
+	UI::get ( input, in, "data" );
+	int sz = input.size();
+	CHECK ( sz > 0 );
+	for ( int i = 0; i < sz; ++i ) {
+		input ( i )->test ( config_file_name, i );
+	}
 }
 
-void epdf_harness::from_setting(const Setting &set) {
-    hepdf = UI::build<epdf>(set, "epdf", UI::compulsory);
-    UI::get(mean, set, "mean", UI::compulsory);
-    UI::get(variance, set, "variance", UI::compulsory);
+void epdf_harness::from_setting ( const Setting &set ) {
+	hepdf = UI::build<epdf> ( set, "epdf", UI::compulsory );
+	UI::get ( mean, set, "mean", UI::compulsory );
+	UI::get ( variance, set, "variance", UI::compulsory );
 
 
-	UI::get(support, set, "support");
-	UI::get(nbins, set, "nbins");
-    UI::get(nsamples, set, "nsamples");
-    UI::get(R, set, "R");
+	UI::get ( support, set, "support" );
+	UI::get ( nbins, set, "nbins" );
+	UI::get ( nsamples, set, "nsamples" );
+	UI::get ( R, set, "R" );
 
-	RV* rv = UI::build<RV>(set, "marginal_rv");
-    if (rv) 
-        mrv = shared_ptr<RV>(rv);    
+	RV* rv = UI::build<RV> ( set, "marginal_rv" );
+	if ( rv )
+		mrv = shared_ptr<RV> ( rv );
 
-	UI::get(tolerance, set, "tolerance");    
+	UI::get ( tolerance, set, "tolerance" );
 }
 
-void epdf_harness::test(const char *config_name, int idx)
-{
-    CurrentContext cc(config_name, idx);
+void epdf_harness::test ( const char *config_name, int idx ) {
+	CurrentContext cc ( config_name, idx );
 
-    CHECK_CLOSE_EX(mean, hepdf->mean(), tolerance);
-    CHECK_CLOSE_EX(variance, hepdf->variance(), tolerance);
+	CHECK_CLOSE_EX ( mean, hepdf->mean(), tolerance );
+	CHECK_CLOSE_EX ( variance, hepdf->variance(), tolerance );
 
-    if (support.rows() == 2) {
-	vec xb = support.get_row(0);
-	vec yb = support.get_row(1);
+	if ( support.rows() == 2 ) {
+		vec xb = support.get_row ( 0 );
+		vec yb = support.get_row ( 1 );
 
-	int old_size = nbins.size();
-	if (old_size < 2) {
-	    vec new_nbins("100 100");
-	    for (int i = 0; i < old_size; ++i) {
-	        new_nbins(i) = nbins(i);
-	    }
+		int old_size = nbins.size();
+		if ( old_size < 2 ) {
+			vec new_nbins ( "100 100" );
+			for ( int i = 0; i < old_size; ++i ) {
+				new_nbins ( i ) = nbins ( i );
+			}
 
-	    nbins = new_nbins;
+			nbins = new_nbins;
+		}
+
+		CHECK_CLOSE_EX ( mean, num_mean2 ( hepdf.get(), xb, yb, nbins ( 0 ), nbins ( 1 ) ), tolerance );
+		CHECK_CLOSE_EX ( 1.0, normcoef ( hepdf.get(), xb, yb, nbins ( 0 ), nbins ( 1 ) ), tolerance );
 	}
 
-	CHECK_CLOSE_EX(mean, num_mean2(hepdf.get(), xb, yb, nbins(0), nbins(1)), tolerance);
-	CHECK_CLOSE_EX(1.0, normcoef(hepdf.get(), xb, yb, nbins(0), nbins(1)), tolerance);
-    }
+	if ( R.rows() > 0 ) {
+		mat smp = hepdf->sample_m ( nsamples );
+		vec emu = smp * ones ( nsamples ) / nsamples;
+		mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu );
 
-    if (R.rows() > 0) {
-	mat smp = hepdf->sample_m(nsamples);
-	vec emu = smp * ones(nsamples) / nsamples;
-	mat er = (smp * smp.T()) / nsamples - outer_product(emu, emu);
+		// simplify overloading for Visual Studio
+		vec delta = sqrt ( variance ) / sqrt ( static_cast<double> ( nsamples ) );
+		CHECK_CLOSE_EX ( mean, emu, delta );
 
-	// simplify overloading for Visual Studio
-	vec delta = sqrt(variance) / sqrt(static_cast<double>(nsamples));
-	CHECK_CLOSE_EX(mean, emu, delta);
-
-	CHECK_CLOSE_EX(R, er, tolerance);
-    }
-
-    if (mrv.get()) {
-        RV crv = hepdf->_rv().subt(*mrv);
-	shared_ptr<epdf> m = hepdf->marginal(*mrv);
-	shared_ptr<mpdf> c = hepdf->condition(crv);
-	mepdf mm(m);
-
-	Array<mpdf *> aa(2);
-	aa(0) = c.get();
-	aa(1) = &mm;
-	mprod mEp(aa);
-
-	mat smp = mEp.samplecond(vec(0), nsamples);
-	vec emu = sum(smp, 2) / nsamples;
-
-	// simplify overloading for Visual Studio
-	vec delta = sqrt(variance) / sqrt(static_cast<double>(nsamples));
-	CHECK_CLOSE_EX(mean, emu, delta);
-
-	if (R.rows() > 0) {
-	    mat er = (smp * smp.T()) / nsamples - outer_product(emu, emu);
-	    CHECK_CLOSE_EX(R, er, tolerance);
+		CHECK_CLOSE_EX ( R, er, tolerance );
 	}
 
-	// test of pdflog at zero
-	vec zero(0);
-	vec zeron(hepdf->dimension());
-	for (int i = 0; i < zeron.size(); ++i) {
-	    zeron(i) = 0;
+	if ( mrv.get() ) {
+		RV crv = hepdf->_rv().subt ( *mrv );
+		shared_ptr<epdf> m = hepdf->marginal ( *mrv );
+		shared_ptr<mpdf> c = hepdf->condition ( crv );
+		mepdf mm ( m );
+
+		Array<mpdf *> aa ( 2 );
+		aa ( 0 ) = c.get();
+		aa ( 1 ) = &mm;
+		mprod mEp ( aa );
+
+		mat smp = mEp.samplecond ( vec ( 0 ), nsamples );
+		vec emu = sum ( smp, 2 ) / nsamples;
+
+		// simplify overloading for Visual Studio
+		vec delta = sqrt ( variance ) / sqrt ( static_cast<double> ( nsamples ) );
+		CHECK_CLOSE_EX ( mean, emu, delta );
+
+		if ( R.rows() > 0 ) {
+			mat er = ( smp * smp.T() ) / nsamples - outer_product ( emu, emu );
+			CHECK_CLOSE_EX ( R, er, tolerance );
+		}
+
+		// test of pdflog at zero
+		vec zero ( 0 );
+		vec zeron ( hepdf->dimension() );
+		for ( int i = 0; i < zeron.size(); ++i ) {
+			zeron ( i ) = 0;
+		}
+
+		CHECK_CLOSE_EX ( hepdf->evallog ( zeron ), mEp.evallogcond ( zeron, zero ), tolerance );
 	}
-
-	CHECK_CLOSE_EX(hepdf->evallog(zeron), mEp.evallogcond(zeron, zero), tolerance);
-    }
 }
 
Index: library/tests/merger_iter_test.cpp
===================================================================
--- library/tests/merger_iter_test.cpp (revision 386)
+++ library/tests/merger_iter_test.cpp (revision 477)
@@ -14,55 +14,60 @@
 
 	RNG_randomize();
-	
-	RV x ( "{x }","1" );
-	RV y ( "{y }","1" );
 
-	RV xy=x; xy.add(y);
-	
-	enorm<fsqmat> f1;f1.set_rv ( xy );
-	enorm<fsqmat> f2;f2.set_rv ( xy );
-	enorm<fsqmat> f3;f3.set_rv(y);
-		
- 	f1.set_parameters ( "4 3",mat ( "0.4 0.3; 0.3 0.4" ) );
-	f2.set_parameters ( "1 3",mat ( "0.3 -0.2; -0.2 0.3" ) );
-	f3.set_parameters ( "2",mat("0.4") );
-	
+	RV x ( "{x }", "1" );
+	RV y ( "{y }", "1" );
+
+	RV xy = x;
+	xy.add ( y );
+
+	enorm<fsqmat> f1;
+	f1.set_rv ( xy );
+	enorm<fsqmat> f2;
+	f2.set_rv ( xy );
+	enorm<fsqmat> f3;
+	f3.set_rv ( y );
+
+	f1.set_parameters ( "4 3", mat ( "0.4 0.3; 0.3 0.4" ) );
+	f2.set_parameters ( "1 3", mat ( "0.3 -0.2; -0.2 0.3" ) );
+	f3.set_parameters ( "2", mat ( "0.4" ) );
+
 	Array<mpdf* > A ( 3 );
-	mepdf A1(&f1);
-	mepdf A2(&f2);
-	mepdf A3(&f3);
-	A ( 0 ) =&A1;
-	A ( 1 ) =&A2;
-	A ( 2 ) =&A3;
-	
-	int Npoints=100;
-	mat x_grid(1,Npoints);
-	x_grid.set_row(0,linspace ( -2.0, 4.0, Npoints ));
-	mat y_grid(1,Npoints);
-	y_grid.set_row(0,linspace ( -2.0, 4.0, Npoints ));
-	
-	mat Grid (2,Npoints*Npoints);
-	Grid.set_submatrix ( 0,0, kron(x_grid,ones(1,Npoints)) );
-	Grid.set_submatrix ( 1,0, kron(ones(1,Npoints), y_grid) );
-	
+	mepdf A1 ( &f1 );
+	mepdf A2 ( &f2 );
+	mepdf A3 ( &f3 );
+	A ( 0 ) = &A1;
+	A ( 1 ) = &A2;
+	A ( 2 ) = &A3;
+
+	int Npoints = 100;
+	mat x_grid ( 1, Npoints );
+	x_grid.set_row ( 0, linspace ( -2.0, 4.0, Npoints ) );
+	mat y_grid ( 1, Npoints );
+	y_grid.set_row ( 0, linspace ( -2.0, 4.0, Npoints ) );
+
+	mat Grid ( 2, Npoints*Npoints );
+	Grid.set_submatrix ( 0, 0, kron ( x_grid, ones ( 1, Npoints ) ) );
+	Grid.set_submatrix ( 1, 0, kron ( ones ( 1, Npoints ), y_grid ) );
+
 	merger_mix M ( A );
-	enorm<fsqmat> g0; g0.set_rv(xy);
-	g0.set_parameters(vec("4 4"),mat("1 0; 0 1"));
-	
-	M.set_parameters(5);
-	M.set_method(LOGNORMAL,1.2);
-	M.set_support(g0,400);
+	enorm<fsqmat> g0;
+	g0.set_rv ( xy );
+	g0.set_parameters ( vec ( "4 4" ), mat ( "1 0; 0 1" ) );
+
+	M.set_parameters ( 5 );
+	M.set_method ( LOGNORMAL, 1.2 );
+	M.set_support ( g0, 400 );
 	M.merge();
-	
+
 	MixEF &MM = M._Mix();
 	epdf* MP = MM.epredictor();//xy
-	
-	vec Res1 = M.evallog_m(Grid);
-	mat Res2 = ((emix*)MP)->evallog_M(Grid);
-	
-	it_file it("merger_iter_test.it");
-	it << Name("Npoints") << Npoints;
-	it << Name("Grid") << Grid;
-	it << Name("Res1") << Res1;
-	it << Name("Res2") << Res2;
+
+	vec Res1 = M.evallog_m ( Grid );
+	mat Res2 = ( ( emix* ) MP )->evallog_M ( Grid );
+
+	it_file it ( "merger_iter_test.it" );
+	it << Name ( "Npoints" ) << Npoints;
+	it << Name ( "Grid" ) << Grid;
+	it << Name ( "Res1" ) << Res1;
+	it << Name ( "Res2" ) << Res2;
 }
Index: library/tests/mpdf_harness.cpp
===================================================================
--- library/tests/mpdf_harness.cpp (revision 471)
+++ library/tests/mpdf_harness.cpp (revision 477)
@@ -10,41 +10,40 @@
 
 template<>
-const ParticularUI<mpdf_harness> &ParticularUI<mpdf_harness>::factory(
-    ParticularUI<mpdf_harness>("mpdf_harness"));
+const ParticularUI<mpdf_harness> &ParticularUI<mpdf_harness>::factory (
+    ParticularUI<mpdf_harness> ( "mpdf_harness" ) );
 
-void mpdf_harness::test_config(const char *config_file_name) {
-    RV::clear_all();
+void mpdf_harness::test_config ( const char *config_file_name ) {
+	RV::clear_all();
 
-    UIFile in(config_file_name);
-    Array<mpdf_harness *> input;
-	UI::get(input, in, "data");
-    int sz = input.size();
-    CHECK(sz > 0);
-    for (int i = 0; i < sz; ++i) {
-        input(i)->test(config_file_name, i);
-    }
+	UIFile in ( config_file_name );
+	Array<mpdf_harness *> input;
+	UI::get ( input, in, "data" );
+	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(cond, set, "cond", UI::compulsory);
-    UI::get(mean, set, "mean", UI::compulsory);
+void mpdf_harness::from_setting ( const Setting &set ) {
+	hmpdf = UI::build<mpdf> ( set, "mpdf", UI::compulsory );
+	UI::get ( cond, set, "cond", UI::compulsory );
+	UI::get ( mean, set, "mean", UI::compulsory );
 
 
-	UI::get(nsamples, set, "nsamples");
-    UI::get(R, set, "R");
-	UI::get(tolerance, set, "tolerance");
+	UI::get ( nsamples, set, "nsamples" );
+	UI::get ( R, set, "R" );
+	UI::get ( tolerance, set, "tolerance" );
 }
 
-void mpdf_harness::test(const char *config_name, int idx)
-{
-    CurrentContext cc(config_name, idx);
+void mpdf_harness::test ( const char *config_name, int idx ) {
+	CurrentContext cc ( config_name, idx );
 
-    mat smp = hmpdf->samplecond_m(cond, nsamples);
-    int n = smp.cols();
-    vec emu = smp * ones(n) / n;
-    mat er = (smp * smp.T()) / n - outer_product(emu, emu);
-    CHECK_CLOSE_EX(mean, emu, tolerance);
-    CHECK_CLOSE_EX(R, er, tolerance);
+	mat smp = hmpdf->samplecond_m ( cond, nsamples );
+	int n = smp.cols();
+	vec emu = smp * ones ( n ) / n;
+	mat er = ( smp * smp.T() ) / n - outer_product ( emu, emu );
+	CHECK_CLOSE_EX ( mean, emu, tolerance );
+	CHECK_CLOSE_EX ( R, er, tolerance );
 }
 
Index: library/tests/square_mat_point.cpp
===================================================================
--- library/tests/square_mat_point.cpp (revision 468)
+++ library/tests/square_mat_point.cpp (revision 477)
@@ -4,16 +4,16 @@
 using bdm::UI;
 
-void square_mat_point::from_setting(const Setting &set) {
-    UI::get(matrix, set, "matrix");
-    UI::get(vector, set, "vector");
-    UI::get(scalar, set, "scalar");
+void square_mat_point::from_setting ( const Setting &set ) {
+	UI::get ( matrix, set, "matrix" );
+	UI::get ( vector, set, "vector" );
+	UI::get ( scalar, set, "scalar" );
 }
 
-void square_mat_point::to_setting(Setting &set) const {
-    Setting &number_setting = set.add("scalar", Setting::TypeFloat);
-    number_setting = scalar;
+void square_mat_point::to_setting ( Setting &set ) const {
+	Setting &number_setting = set.add ( "scalar", Setting::TypeFloat );
+	number_setting = scalar;
 
-    UI::save(vector, set, "vector");
-    UI::save(matrix, set, "matrix");
+	UI::save ( vector, set, "vector" );
+	UI::save ( matrix, set, "matrix" );
 }
 
Index: library/tests/test_util.cpp
===================================================================
--- library/tests/test_util.cpp (revision 469)
+++ library/tests/test_util.cpp (revision 477)
@@ -27,115 +27,114 @@
 using itpp::mat;
 
-std::string load_test_file(const char *fname)
-{
-    char buffer[8192];
-    memset(buffer, 0, sizeof(buffer));
-    std::ifstream src(fname, std::ios_base::binary);
-    src.read(buffer, sizeof(buffer) - 1);
-    return std::string(buffer);
+std::string load_test_file ( const char *fname ) {
+	char buffer[8192];
+	memset ( buffer, 0, sizeof ( buffer ) );
+	std::ifstream src ( fname, std::ios_base::binary );
+	src.read ( buffer, sizeof ( buffer ) - 1 );
+	return std::string ( buffer );
 }
 
-bool remove_all(const char *path) {
-    DIR *dir;
-    dirent *de;
+bool remove_all ( const char *path ) {
+	DIR *dir;
+	dirent *de;
 
-    bool rv = true;
-    if ((dir = opendir(path)) != 0) {
-        try {
-	    std::string top(path);
-	    top += "/";
+	bool rv = true;
+	if ( ( dir = opendir ( path ) ) != 0 ) {
+		try {
+			std::string top ( path );
+			top += "/";
 
-	    while ((de = readdir(dir)) != 0) {
-		if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
-		    std::string subpath(top);
-		    subpath += de->d_name;
-		    remove_all(subpath.c_str());
+			while ( ( de = readdir ( dir ) ) != 0 ) {
+				if ( strcmp ( de->d_name, "." ) && strcmp ( de->d_name, ".." ) ) {
+					std::string subpath ( top );
+					subpath += de->d_name;
+					remove_all ( subpath.c_str() );
+				}
+			}
+		} catch ( ... ) {
+			closedir ( dir );
+			throw;
 		}
-	    }
-	} catch (...) {
-	    closedir(dir);
-	    throw;
+
+		closedir ( dir );
+
+		if ( rmdir ( path ) ) {
+			std::string msg = "can't remove dir ";
+			msg += path;
+			throw std::runtime_error ( msg );
+		}
+	} else {
+		if ( errno == ENOTDIR ) {
+			if ( unlink ( path ) ) {
+				std::string msg = "can't remove file ";
+				msg += path;
+				throw std::runtime_error ( msg );
+			}
+		} else {
+			if ( errno != ENOENT ) {
+				std::string msg = "can't remove ";
+				msg += path;
+				throw std::runtime_error ( msg );
+			} else {
+				// it wasn't there in the first place
+				rv = false;
+			}
+		}
 	}
 
-	closedir(dir);
-
-	if (rmdir(path)) {
-	    std::string msg = "can't remove dir ";
-	    msg += path;
-	    throw std::runtime_error(msg);
-	}
-    } else { 
-        if (errno == ENOTDIR) {
-	    if (unlink(path)) {
-  	        std::string msg = "can't remove file ";
-		msg += path;
-		throw std::runtime_error(msg);
-	    }
-	} else {
-	    if (errno != ENOENT) {
-	        std::string msg = "can't remove ";
-		msg += path;
-		throw std::runtime_error(msg);
-	    } else {
-	        // it wasn't there in the first place
-	        rv = false;
-	    }
-	}
-    }
-
-    return rv;
+	return rv;
 }
 
-double normcoef(const epdf *ep, const vec &xb, const vec &yb,
-		int xn, int yn) {
-    mat Pdf(xn + 1, yn + 1);
-    vec rgr(2);
+double normcoef ( const epdf *ep, const vec &xb, const vec &yb,
+                  int xn, int yn ) {
+	mat Pdf ( xn + 1, yn + 1 );
+	vec rgr ( 2 );
 
-    double xstep = (xb(1) - xb(0)) / xn;
-    double ystep = (yb(1) - yb(0)) / yn;
+	double xstep = ( xb ( 1 ) - xb ( 0 ) ) / xn;
+	double ystep = ( yb ( 1 ) - yb ( 0 ) ) / yn;
 
-    double x = xb(0);
-    for (int i = 0; i <= xn; x += xstep, i++) {
-        rgr(0) = x;
-	double y = yb(0);
-	for (int j = 0; j <= yn; y += ystep, j++) {
-	    rgr(1) = y;
-	    Pdf(i, j) = exp(ep->evallog(rgr));
+	double x = xb ( 0 );
+	for ( int i = 0; i <= xn; x += xstep, i++ ) {
+		rgr ( 0 ) = x;
+		double y = yb ( 0 );
+		for ( int j = 0; j <= yn; y += ystep, j++ ) {
+			rgr ( 1 ) = y;
+			Pdf ( i, j ) = exp ( ep->evallog ( rgr ) );
+		}
 	}
-    }
 
-    return sumsum(Pdf) * xstep * ystep;
+	return sumsum ( Pdf ) * xstep * ystep;
 }
 
-vec num_mean2(const epdf *ep, const vec &xb, const vec &yb,
-	      int xn, int yn) {
-    mat Pdf(xn + 1, yn + 1);
-    vec rgr(2);
+vec num_mean2 ( const epdf *ep, const vec &xb, const vec &yb,
+                int xn, int yn ) {
+	mat Pdf ( xn + 1, yn + 1 );
+	vec rgr ( 2 );
 
-    double xstep = (xb(1) - xb(0)) / xn;
-    double ystep = (yb(1) - yb(0)) / yn;
+	double xstep = ( xb ( 1 ) - xb ( 0 ) ) / xn;
+	double ystep = ( yb ( 1 ) - yb ( 0 ) ) / yn;
 
-    vec Mu(xn + 1);
-    vec Si(yn + 1);
+	vec Mu ( xn + 1 );
+	vec Si ( yn + 1 );
 
-    double x = xb(0);
-    for (int i = 0; i <= xn; x += xstep, i++) {
-        Mu(i) = x;
-	rgr(0) = x;
-	double y = yb(0);
-	for (int j = 0; j <= yn; y += ystep, j++) {
-	    Si(j) = y;
-	    rgr(1) = y;
-	    Pdf(i, j) = exp(ep->evallog(rgr));
+	double x = xb ( 0 );
+	for ( int i = 0; i <= xn; x += xstep, i++ ) {
+		Mu ( i ) = x;
+		rgr ( 0 ) = x;
+		double y = yb ( 0 );
+		for ( int j = 0; j <= yn; y += ystep, j++ ) {
+			Si ( j ) = y;
+			rgr ( 1 ) = y;
+			Pdf ( i, j ) = exp ( ep->evallog ( rgr ) );
+		}
 	}
-    }
 
-    vec fm = sum(Pdf, 2);
-    double sfm = sum(fm);
-    vec fs = sum(Pdf, 1);
-    double sfs = sum(fs);
-    double vi0 = Mu * fm / sfm;
-    double vi1 = Si * fs / sfs;
-    return vec_2(vi0, vi1);
+	vec fm = sum ( Pdf, 2 );
+	double sfm = sum ( fm );
+	vec fs = sum ( Pdf, 1 );
+	double sfs = sum ( fs );
+	double vi0 = Mu * fm / sfm;
+	double vi1 = Si * fs / sfs;
+	return vec_2 ( vi0, vi1 );
 }
 
Index: library/tests/mixtures_test.cpp
===================================================================
--- library/tests/mixtures_test.cpp (revision 394)
+++ library/tests/mixtures_test.cpp (revision 477)
@@ -9,28 +9,29 @@
 
 void disp_mix2D ( const MixEF &Mi ) {
-	const eprod &ep=((const eprod&)(Mi.posterior()));
+	const eprod &ep = ( ( const eprod& ) ( Mi.posterior() ) );
 	int i;
-	mat Var ( 2,2 ),M ( 1,2 );
-	for ( i=0; i<ep._rv().length() - 1; i++ ) { // -1 => last one is the weight
-		( ( egiw* ) ep ( i ) )->mean_mat ( M,Var );
-		cout << "Mean: "<< M <<endl << "Variance: "<<endl <<Var<<endl;
+	mat Var ( 2, 2 ), M ( 1, 2 );
+	for ( i = 0; i < ep._rv().length() - 1; i++ ) { // -1 => last one is the weight
+		( ( egiw* ) ep ( i ) )->mean_mat ( M, Var );
+		cout << "Mean: " << M << endl << "Variance: " << endl << Var << endl;
 	}
-	cout <<"Weights: "<< ep ( i )->mean() <<endl;
+	cout << "Weights: " << ep ( i )->mean() << endl;
 }
 
-mat grid2D ( const MixEF &M,const vec &xb, const vec &yb, int Ngr=100 ) {
-	mat PPdf ( Ngr+1,Ngr+1 );
+mat grid2D ( const MixEF &M, const vec &xb, const vec &yb, int Ngr = 100 ) {
+	mat PPdf ( Ngr + 1, Ngr + 1 );
 	vec rgr ( 3 );
 
-	rgr ( 2 ) =1;
-	int i=0,j=0;
-	double xstep=( xb ( 1 )-xb ( 0 ) ) /Ngr;
-	double ystep=( yb ( 1 )-yb ( 0 ) ) /Ngr;
-	
-	for ( double x=xb ( 0 );x<=xb ( 1 );x+= xstep,i++ ) {
-		rgr ( 0 ) =x;j=0;
-		for ( double y=yb(0);y<=yb(1);y+=ystep,j++ ) {
-			rgr ( 1 ) =y;
-			PPdf ( i,j ) =exp ( M.logpred ( rgr ) );
+	rgr ( 2 ) = 1;
+	int i = 0, j = 0;
+	double xstep = ( xb ( 1 ) - xb ( 0 ) ) / Ngr;
+	double ystep = ( yb ( 1 ) - yb ( 0 ) ) / Ngr;
+
+	for ( double x = xb ( 0 ); x <= xb ( 1 ); x += xstep, i++ ) {
+		rgr ( 0 ) = x;
+		j = 0;
+		for ( double y = yb ( 0 ); y <= yb ( 1 ); y += ystep, j++ ) {
+			rgr ( 1 ) = y;
+			PPdf ( i, j ) = exp ( M.logpred ( rgr ) );
 		}
 	}
@@ -39,7 +40,7 @@
 
 int main() {
-	RV x ( "{x }","2" );
+	RV x ( "{x }", "2" );
 
-	
+
 	cout << "Test for estimation of a 2D Gaussian mixture" << endl;
 	///////////////////////////////////
@@ -52,19 +53,24 @@
 	fsqmat V2 ( mat ( "2 -0.1; -0.1 2" ) );
 
-	enorm<fsqmat> C1; C1.set_rv ( x );
-	C1.set_parameters ( m1,V1 );
-	enorm<fsqmat> C2; C2.set_rv ( x );
-	C2.set_parameters ( m2,V2 );
+	enorm<fsqmat> C1;
+	C1.set_rv ( x );
+	C1.set_parameters ( m1, V1 );
+	enorm<fsqmat> C2;
+	C2.set_rv ( x );
+	C2.set_parameters ( m2, V2 );
 
-	Array<epdf*> Sim ( 2 ); Sim ( 0 ) =&C1;Sim ( 1 ) =&C2;
-	emix Simul;Simul.set_rv ( x );
+	Array<epdf*> Sim ( 2 );
+	Sim ( 0 ) = &C1;
+	Sim ( 1 ) = &C2;
+	emix Simul;
+	Simul.set_rv ( x );
 	Simul.set_parameters ( "0.5 0.6", Sim, false );
 
 	// Sample parameters
 	int ndat = 100;
-	mat Smp =Simul.sample_m ( ndat );
+	mat Smp = Simul.sample_m ( ndat );
 
-	cout << "Simulated means: " << m1 <<" and " << m2 <<endl;
-	cout << "Simulated covariances: " << endl<<V1 <<" and " <<endl<< V2 <<endl;
+	cout << "Simulated means: " << m1 << " and " << m2 << endl;
+	cout << "Simulated covariances: " << endl << V1 << " and " << endl << V2 << endl;
 
 	//////////////////////////////
@@ -72,49 +78,55 @@
 
 	// Initial values of components
-	mat V0=1e-4*eye ( 3 ); V0 ( 0,0 ) *=100;V0 ( 1,1 ) *=100;
-	mat Vp="0 0 1; 0 0 1; 1 1 0";
-	Vp*=5*1e-5;
+	mat V0 = 1e-4 * eye ( 3 );
+	V0 ( 0, 0 ) *= 100;
+	V0 ( 1, 1 ) *= 100;
+	mat Vp = "0 0 1; 0 0 1; 1 1 0";
+	Vp *= 5 * 1e-5;
 
-	ARX M1;M1.set_statistics(2,V0 - Vp,8 );
-	ARX M2;M2.set_statistics (2, V0 + Vp,8 );
-	
+	ARX M1;
+	M1.set_statistics ( 2, V0 - Vp, 8 );
+	ARX M2;
+	M2.set_statistics ( 2, V0 + Vp, 8 );
+
 	// Build mixture model
-	Array<BMEF*> A ( 2 ); A ( 0 ) =&M1; A ( 1 ) =&M2;
-	MixEF Post ( A,"0.5 0.5" );
-	cout << "Initial mixture:"<<endl;
-	disp_mix2D(Post);
-	
+	Array<BMEF*> A ( 2 );
+	A ( 0 ) = &M1;
+	A ( 1 ) = &M2;
+	MixEF Post ( A, "0.5 0.5" );
+	cout << "Initial mixture:" << endl;
+	disp_mix2D ( Post );
+
 	// Add ones for constant coefficients
-	mat Data = concat_vertical ( Smp, ones ( 1,Smp.cols() ) );
+	mat Data = concat_vertical ( Smp, ones ( 1, Smp.cols() ) );
 	Post.bayes ( Data );
 
-	cout << "Posterior mixture:" <<endl;
-	disp_mix2D(Post);
+	cout << "Posterior mixture:" << endl;
+	disp_mix2D ( Post );
 
 	//TEST random initialization
 	RNG_randomize();
 	ARX Aflat;
-	Aflat.set_statistics(2,V0,7);
+	Aflat.set_statistics ( 2, V0, 7 );
 	MixEF RND;
-	RND.init(&Aflat,Data,10); // already initialized!
-	cout << endl<< "== Randomly initialized mixture ==" <<endl;
-	cout << endl<< "== INIT ==" <<endl;
-	disp_mix2D(RND);
-	mat PPdf_I=grid2D(RND, vec_2(-5.0,5.0), vec_2(-5.0,5.0));;
-	
-	RND.bayes(Data);
-	cout << endl<< "== BAYES ==" <<endl;
-	disp_mix2D(RND);
+	RND.init ( &Aflat, Data, 10 ); // already initialized!
+	cout << endl << "== Randomly initialized mixture ==" << endl;
+	cout << endl << "== INIT ==" << endl;
+	disp_mix2D ( RND );
+	mat PPdf_I = grid2D ( RND, vec_2 ( -5.0, 5.0 ), vec_2 ( -5.0, 5.0 ) );;
 
-	
-	it_file of ( "mixef_test.it",true );
-	of<< Name ( "Smp" ) <<Smp;
-	of<<Name ( "PPdf" ) <<grid2D(Post, vec_2(-5.0,5.0), vec_2(-5.0,5.0));
-	of<<Name ( "PPdf_I" ) <<PPdf_I;
-	of<<Name ( "PPdf_RND" ) <<grid2D(RND, vec_2(-5.0,5.0), vec_2(-5.0,5.0));
+	RND.bayes ( Data );
+	cout << endl << "== BAYES ==" << endl;
+	disp_mix2D ( RND );
 
-	cout << endl <<"Variables written to file mixef_test.it:"<<endl;
-	cout << "Smp  : data sampled from the simulator " <<endl;
-	cout << "PPdf : posterior density on a grid <-5,5><-5,5>"<<endl;
-	cout << "PPdf_RND : posterior density of randomly initilaized mixture on a grid <-5,5><-5,5>"<<endl;
+
+	it_file of ( "mixef_test.it", true );
+	of << Name ( "Smp" ) << Smp;
+	of << Name ( "PPdf" ) << grid2D ( Post, vec_2 ( -5.0, 5.0 ), vec_2 ( -5.0, 5.0 ) );
+	of << Name ( "PPdf_I" ) << PPdf_I;
+	of << Name ( "PPdf_RND" ) << grid2D ( RND, vec_2 ( -5.0, 5.0 ), vec_2 ( -5.0, 5.0 ) );
+
+	cout << endl << "Variables written to file mixef_test.it:" << endl;
+	cout << "Smp  : data sampled from the simulator " << endl;
+	cout << "PPdf : posterior density on a grid <-5,5><-5,5>" << endl;
+	cout << "PPdf_RND : posterior density of randomly initilaized mixture on a grid <-5,5><-5,5>" << endl;
 }
Index: library/tests/blas_test.cpp
===================================================================
--- library/tests/blas_test.cpp (revision 262)
+++ library/tests/blas_test.cpp (revision 477)
@@ -10,15 +10,15 @@
 
 mat matmul ( mat &A, mat &B ) {
-	mat C ( A.rows(),B.cols() );
-	int i,j,k;
+	mat C ( A.rows(), B.cols() );
+	int i, j, k;
 	double sum;
 
-	for ( i=0;i<A.rows();i++ ) {
-		for ( j=0;j<A.cols();j++ ) {
+	for ( i = 0; i < A.rows(); i++ ) {
+		for ( j = 0; j < A.cols(); j++ ) {
 			sum = 0.0;
-			for ( k=0;k<A.cols();k++ ) {
-				sum+=A._elem ( i,k ) *B._elem ( k,j );
+			for ( k = 0; k < A.cols(); k++ ) {
+				sum += A._elem ( i, k ) * B._elem ( k, j );
 			}
-			C ( i,j ) = sum;
+			C ( i, j ) = sum;
 		}
 	}
@@ -27,12 +27,12 @@
 
 void matmul2 ( int n,  double *A, double *B, double *C ) {
-	int i,j,k;
+	int i, j, k;
 	double sum;
 
-	for ( i=0;i<n;i++ ) {
-		for ( j=0;j<n;j++ ) {
+	for ( i = 0; i < n; i++ ) {
+		for ( j = 0; j < n; j++ ) {
 			sum = 0.0;
-			for ( k=0;k<n;k++ ) {
-				sum+=A [ i*n+k ] * B [ k*n+j ];
+			for ( k = 0; k < n; k++ ) {
+				sum += A [ i*n+k ] * B [ k*n+j ];
 			}
 			C[ i*n+j] = sum;
@@ -52,33 +52,39 @@
 	mat C;
 
-	vec vn="5 50 200 500";
+	vec vn = "5 50 200 500";
 	int n;
 
-	for ( int i=0;i<vn.length();i++ ) {
+	for ( int i = 0; i < vn.length(); i++ ) {
 		n = vn ( i );
-		A = randu ( n,n );
-		B = randu ( n,n );
+		A = randu ( n, n );
+		B = randu ( n, n );
 
 		tt.tic();
-		for ( int ii=0;ii<10;ii++ ) {C = matmul ( A,B );}
-		exec_times ( i ) =tt.toc();
+		for ( int ii = 0; ii < 10; ii++ ) {
+			C = matmul ( A, B );
+		}
+		exec_times ( i ) = tt.toc();
 
 		tt.tic();
-		for ( int ii=0;ii<10;ii++ ) {C = A*B;}
-		exec_times_b ( i ) =tt.toc();
+		for ( int ii = 0; ii < 10; ii++ ) {
+			C = A * B;
+		}
+		exec_times_b ( i ) = tt.toc();
 
-		C = zeros(n,n);
+		C = zeros ( n, n );
 		tt.tic();
-		for ( int ii=0;ii<10;ii++ ) { matmul2(n,A._data(),B._data(),C._data());}
-		exec_times_c ( i ) =tt.toc();
+		for ( int ii = 0; ii < 10; ii++ ) {
+			matmul2 ( n, A._data(), B._data(), C._data() );
+		}
+		exec_times_c ( i ) = tt.toc();
 	}
-	cout << exec_times <<endl;
-	cout << exec_times_b <<endl;
-	cout << exec_times_c <<endl;
+	cout << exec_times << endl;
+	cout << exec_times_b << endl;
+	cout << exec_times_c << endl;
 
 	it_file itf ( "blas_test.it" );
-	itf << Name ( "exec_times" ) <<exec_times;
-	itf << Name ( "exec_times_b" ) <<exec_times_b;
-	itf << Name ( "exec_times_c" ) <<exec_times_c;
+	itf << Name ( "exec_times" ) << exec_times;
+	itf << Name ( "exec_times_b" ) << exec_times_b;
+	itf << Name ( "exec_times_c" ) << exec_times_c;
 
 	return 0;
Index: library/tests/egiw_harness.h
===================================================================
--- library/tests/egiw_harness.h (revision 456)
+++ library/tests/egiw_harness.h (revision 477)
@@ -16,18 +16,16 @@
 #include "epdf_harness.h"
 
-namespace bdm
-{
+namespace bdm {
 
-class egiw_harness : public epdf_harness
-{
+class egiw_harness : public epdf_harness {
 private:
-    double lognc;
+	double lognc;
 
 public:
-    egiw_harness():lognc(0) { }
+	egiw_harness() : lognc ( 0 ) { }
 
-    void test(const char *config_name, int idx);
+	void test ( const char *config_name, int idx );
 
-    void from_setting(const Setting &set);
+	void from_setting ( const Setting &set );
 };
 
Index: library/tests/size_generator.h
===================================================================
--- library/tests/size_generator.h (revision 467)
+++ library/tests/size_generator.h (revision 477)
@@ -19,23 +19,22 @@
 /*! Generates progressively larger random matrices.
  */
-class size_generator : public generator
-{
+class size_generator : public generator {
 private:
-    int step;
-    int sz;
+	int step;
+	int sz;
 
 public:
-    size_generator():step(7), sz(step) { }
+	size_generator() : step ( 7 ), sz ( step ) { }
 
-    itpp::mat next();
+	itpp::mat next();
 
-    //! Load from structure with elements:
-    //!  \code
-    //! { size = 7; // size (rows == cols) of the first generated matrix
-    //!   step = 7; // how many times to increase the generated matrix in every iteration
-    //! }
-    //! \endcode
-    //! Both elements are optional, with defaults as shown.
-    void from_setting(const Setting &set);
+	//! Load from structure with elements:
+	//!  \code
+	//! { size = 7; // size (rows == cols) of the first generated matrix
+	//!   step = 7; // how many times to increase the generated matrix in every iteration
+	//! }
+	//! \endcode
+	//! Both elements are optional, with defaults as shown.
+	void from_setting ( const Setting &set );
 };
 
Index: library/tests/arx_elem_test.cpp
===================================================================
--- library/tests/arx_elem_test.cpp (revision 386)
+++ library/tests/arx_elem_test.cpp (revision 477)
@@ -3,43 +3,45 @@
 
 int main() {
-	// Setup model : ARX for 1D Gaussian	
+	// Setup model : ARX for 1D Gaussian
 	//Test constructor
-	mat V0 = 0.00001*eye(2); V0(0,0)= 0.1; //
-	ARX Ar; Ar.set_statistics(1, V0, -1.0);
-				
-	mat mu(1,1);
-	mat R(1,1);
-	Ar._e()->mean_mat(mu,R);
-	cout << "Prior moments: mu="<< mu << ", R=" << R <<endl; 
-	
+	mat V0 = 0.00001 * eye ( 2 );
+	V0 ( 0, 0 ) = 0.1; //
+	ARX Ar;
+	Ar.set_statistics ( 1, V0, -1.0 );
+
+	mat mu ( 1, 1 );
+	mat R ( 1, 1 );
+	Ar._e()->mean_mat ( mu, R );
+	cout << "Prior moments: mu=" << mu << ", R=" << R << endl;
+
 	int ndat = 200;
-	vec smp=randn(ndat);
+	vec smp = randn ( ndat );
 	//
-	mat Smp=ones(2,ndat);
-	Smp.set_row(0,smp);
+	mat Smp = ones ( 2, ndat );
+	Smp.set_row ( 0, smp );
 	//
-	Ar.bayesB(Smp);
+	Ar.bayesB ( Smp );
 	// Ar is now filled with estimates of N(0,1);
-	cout << "Empirical moments: mu=" << sum(smp)/ndat << ", R=" << sum_sqr(smp)/ndat - pow(sum(smp)/ndat,2) << endl;
-	Ar._e()->mean_mat(mu,R);
-	cout << "Posterior moments: mu="<< mu << ", R=" << R <<endl; 
-	
+	cout << "Empirical moments: mu=" << sum ( smp ) / ndat << ", R=" << sum_sqr ( smp ) / ndat - pow ( sum ( smp ) / ndat, 2 ) << endl;
+	Ar._e()->mean_mat ( mu, R );
+	cout << "Posterior moments: mu=" << mu << ", R=" << R << endl;
+
 	//////// TEST prediction
-	vec x=linspace(-3.0,3.0,100);
-	double xstep = 6.0/100.0;
-	mat X(1,100);
-	mat X2(2,100);
-	X.set_row(0,x);
-	X2.set_row(0,x);
-	
+	vec x = linspace ( -3.0, 3.0, 100 );
+	double xstep = 6.0 / 100.0;
+	mat X ( 1, 100 );
+	mat X2 ( 2, 100 );
+	X.set_row ( 0, x );
+	X2.set_row ( 0, x );
+
 	mlstudent* Ap = Ar.predictor_student();
-	vec Ap_x=Ap->evallogcond_m(X,vec_1(1.0));
-	vec ll_x = Ar.logpred_m(X2);
-	
-	cout << "normalize : " << xstep*sum(exp(Ap_x)) << endl;
-	cout << "normalize : " << xstep*sum(exp(ll_x)) << endl;
-	
-	it_file it("arx_elem_test.it");
-	it << Name("Ap_x") << Ap_x;
-	it << Name("ll_x") << ll_x;
+	vec Ap_x = Ap->evallogcond_m ( X, vec_1 ( 1.0 ) );
+	vec ll_x = Ar.logpred_m ( X2 );
+
+	cout << "normalize : " << xstep*sum ( exp ( Ap_x ) ) << endl;
+	cout << "normalize : " << xstep*sum ( exp ( ll_x ) ) << endl;
+
+	it_file it ( "arx_elem_test.it" );
+	it << Name ( "Ap_x" ) << Ap_x;
+	it << Name ( "ll_x" ) << ll_x;
 }
