70 | | void getdata ( vec &dt ){it_assert_debug(dt.length()==Y.length(),"ArxDS"); |
71 | | dt=concat(Y,H.left(Urv.count()));}; |
72 | | void getdata ( vec &dt, const ivec &indexes ){it_assert_debug(dt.length()==Y.length(),"ArxDS"); dt=Y(indexes);}; |
73 | | void write ( vec &ut ){it_assert_debug(ut.length()==Urv.count(),"ArxDS"); H.set_subvector(0,ut);}; |
74 | | void write ( vec &ut, const ivec &indexes ){it_assert_debug(ut.length()==Urv.count(),"ArxDS"); set_subvector(H,indexes,ut);}; |
| 76 | void getdata ( vec &dt ) { |
| 77 | it_assert_debug ( dt.length() ==Drv.count(),"ArxDS" ); |
| 78 | dt=H.left ( Urv.count() +Drv.count() ); |
| 79 | }; |
| 80 | void getdata ( vec &dt, const ivec &indexes ) { |
| 81 | it_assert_debug ( dt.length() ==indeces.length(),"ArxDS" ); |
| 82 | dt=H ( indexes ); |
| 83 | }; |
| 84 | void write ( vec &ut ) { |
| 85 | it_assert_debug ( ut.length() ==Urv.count(),"ArxDS" ); |
| 86 | U=ut; |
| 87 | }; |
| 88 | void write ( vec &ut, const ivec &indexes ) { |
| 89 | it_assert_debug ( ut.length() ==indeces.length(),"ArxDS" ); |
| 90 | set_subvector ( U, indexes,ut ); |
| 91 | }; |
79 | | void set_parameters(const mat &Th0, const vec mu0, const chmat &sqR0) |
80 | | {model.set_parameters(Th0, mu0, sqR0); }; |
| 96 | void set_parameters ( const mat &Th0, const vec mu0, const chmat &sqR0 ) |
| 97 | { model.set_parameters ( Th0, mu0, sqR0 ); }; |
| 98 | //! set options from a string |
| 99 | void set_options ( const string &s ) { |
| 100 | opt_L_theta= ( s.find ( "L_theta" ) !=string::npos ); |
| 101 | }; |
| 102 | virtual void log_add ( logger &L ) { |
| 103 | DS::log_add ( L ); |
| 104 | mat &A =model._A(); |
| 105 | mat R =model._R(); |
| 106 | if ( opt_L_theta ) {L_theta=L.add ( RV("{theta }", vec_1(A.rows() *A.cols())),"t" );} |
| 107 | if ( opt_L_theta ) {L_R=L.add ( RV("{R }", vec_1(R.rows() *R.cols())),"r" );} |
| 108 | } |
| 109 | virtual void logit ( logger &L ) { |
| 110 | DS::logit ( L ); |
| 111 | mat &A =model._A(); |
| 112 | mat R =model._R(); |
| 113 | if ( opt_L_theta ) {L.logit ( L_theta,vec ( A._data(), A.rows() *A.cols() ) );}; |
| 114 | if ( opt_L_theta ) {L.logit ( L_R, vec ( R._data(), R.rows() *R.rows() ) );}; |
| 115 | } |
| 116 | |