Index: library/bdm/base/datasources.h
===================================================================
--- library/bdm/base/datasources.h (revision 618)
+++ library/bdm/base/datasources.h (revision 660)
@@ -40,11 +40,11 @@
 		void getdata ( vec &dt );
 		void getdata ( vec &dt, const ivec &indeces );
-		void set_rvs ( RV &drv, RV &urv );
-
-		void write ( vec &ut ) {
+		void set_drv (const RV &drv,const  RV &urv );
+
+		void write ( const vec &ut ) {
 			bdm_error ( "MemDS::write is not supported" );
 		}
 
-		void write ( vec &ut, ivec &indices ) {
+		void write ( const vec &ut, const ivec &indices ) {
 			bdm_error ( "MemDS::write is not supported" );
 		}
@@ -53,4 +53,5 @@
 		//!Default constructor
 		MemDS () {};
+		//! Convenience constructor
 		MemDS ( mat &Dat, ivec &rowid0);
 		/*! Create object from the following structure
@@ -114,5 +115,5 @@
 			dt_out = dt ( ids );
 		}
-		const RV& _drv() {
+		const RV& _drv() const {
 			return iepdf->_rv();
 		}
@@ -262,4 +263,5 @@
 
 	public:
+		//! Convenience constructor
 		ITppFileDS ( const string &fname, const string &varname ) : FileDS() {
 			it_file it ( fname );
@@ -298,147 +300,7 @@
 
 
-/*!
-\brief Generator of ARX data
-
-*/
-class ArxDS : public DS {
-	protected:
-		//! Rv of the regressor
-		RV Rrv;
-		//! History, ordered as \f$[y_t, u_t, y_{t-1 }, u_{t-1}, \ldots]\f$
-		vec H;
-		//! (future) input
-		vec U;
-		//! temporary variable for regressor
-		vec rgr;
-		//! data link: H -> rgr
-		datalink rgrlnk;
-		//! model of Y - linear Gaussian
-		mlnorm<chmat> model;
-		//! options
-		bool opt_L_theta;
-		//! loggers
-		int L_theta;
-		int L_R;
-		int dt_size;
-	public:
-		void getdata ( vec &dt ) {
-			dt = H;
-		}
-
-		void getdata ( vec &dt, const ivec &indices ) {
-			dt = H ( indices );
-		}
-
-		void write ( vec &ut ) {
-			U = ut;
-		}
-
-		void write ( vec &ut, const ivec &indices ) {
-			bdm_assert_debug ( ut.length() == indices.length(), "ArxDS" );
-			set_subvector ( U, indices, ut );
-		}
-
-		void step();
-
-		//!Default constructor
-		ArxDS ( ) {};
-		//! Set parameters of the internal model, H is maximum time delay
-		void set_parameters ( const mat &Th0, const vec mu0, const chmat &sqR0 ) {
-			model.set_parameters ( Th0, mu0, sqR0 );
-		};
-		//! Set
-		void set_drv ( const RV &yrv, const RV &urv, const RV &rrv ) {
-			Rrv = rrv;
-			Urv = urv;
-			dt_size = yrv._dsize() + urv._dsize();
-
-			RV drv = concat ( yrv, urv );
-			Drv = drv;
-			int td = rrv.mint();
-			H.set_size ( drv._dsize() * ( -td + 1 ) );
-			U.set_size ( Urv._dsize() );
-			for ( int i = -1; i >= td; i-- ) {
-				drv.t_plus ( -1 );
-				Drv.add ( drv ); //shift u1
-			}
-			rgrlnk.set_connection ( rrv, Drv );
-
-			dtsize = Drv._dsize();
-			utsize = Urv._dsize();
-		}
-		//! set options from a string
-		void set_options ( const string &s ) {
-			opt_L_theta = ( s.find ( "L_theta" ) != string::npos );
-		};
-		virtual void log_add ( logger &L ) {
-			//DS::log_add ( L ); too long!!
-			L_dt = L.add ( Drv ( 0, dt_size ), "" );
-			L_ut = L.add ( Urv, "" );
-
-			const mat &A = model._A();
-			const mat R = model._R();
-			if ( opt_L_theta ) {
-				L_theta = L.add ( RV ( "{th }", vec_1 ( A.rows() * A.cols() ) ), "t" );
-			}
-			if ( opt_L_theta ) {
-				L_R = L.add ( RV ( "{R }", vec_1 ( R.rows() * R.cols() ) ), "r" );
-			}
-		}
-		virtual void logit ( logger &L ) {
-			//DS::logit ( L );
-			L.logit ( L_dt, H.left ( dt_size ) );
-			L.logit ( L_ut, U );
-
-			const mat &A = model._A();
-			const mat R = model._R();
-			if ( opt_L_theta ) {
-				L.logit ( L_theta, vec ( A._data(), A.rows() *A.cols() ) );
-			};
-			if ( opt_L_theta ) {
-				L.logit ( L_R, vec ( R._data(), R.rows() *R.rows() ) );
-			};
-		}
-
-		// TODO dokumentace - aktualizovat
-		/*! UI for ArxDS using factorized description!
-
-		The ArxDS is constructed from a structure with fields:
-		\code
-		system = {
-			type = "ArxDS";
-			// description of y variables
-			y = {type="rv"; names=["y", "u"];};
-			// description of u variable
-			u = {type="rv"; names=[];}
-			// description of regressor
-			rgr = {type="rv";
-				names = ["y","y","y","u"];
-				times = [-1, -2, -3, -1];
-			}
-
-			// theta
-			theta = [0.8, -0.3, 0.4, 1.0,
-					 0.0, 0.0, 0.0, 0.0];
-			// offset (optional)
-			offset = [0.0, 0.0];
-			//variance
-			r = [0.1, 0.0,
-				 0.0, 1.0];
-			//options: L_theta = log value of theta,
-			opt = "L_theta";
-		};
-		\endcode
-
-		Result is ARX data source offering with full history as Drv.
-		*/
-		void from_setting ( const Setting &set );
-
-		// TODO dodelat void to_setting( Setting &set ) const;
-};
-
-UIREGISTER ( ArxDS );
-SHAREDPTR ( ArxDS );
-
+// ARXDs - DELETED
+
+//! State-space data source simulating two densities
 class stateDS : public DS {
 	private:
@@ -467,5 +329,5 @@
 			dt0 = dt ( indices );
 		}
-
+		//! convenience constructor
 		stateDS ( const shared_ptr<mpdf> &IM0, const shared_ptr<mpdf> &OM0, int usize ) : IM ( IM0 ), OM ( OM0 ),
 				dt ( OM0->dimension() ), xt ( IM0->dimension() ),
