281 | | ipdf = UI::build<pdf> ( set, "pdf", UI::compulsory ); |
282 | | |
283 | | RV Yrv = ipdf->_rv(); |
284 | | // get unique rvs form rvc |
285 | | RV rgrv0 = ipdf->_rvc().remove_time(); |
286 | | // input is what in not in Yrv |
287 | | Urv = rgrv0.subt ( Yrv ); |
288 | | Drv= concat(Yrv,Urv); |
289 | | // connect input and output to rvc |
290 | | ut2rgr.set_connection ( ipdf->_rvc(), Urv ); |
291 | | yt2rgr.set_connection ( ipdf->_rvc(), Yrv ); |
292 | | |
293 | | //set history - if given |
294 | | shared_ptr<RV> rv_ini = UI::build<RV> ( set, "init_rv", UI::optional ); |
295 | | if ( rv_ini ) { // check if |
296 | | vec val; |
297 | | UI::get ( val, set, "init_values", UI::optional ); |
298 | | if ( val.length() != rv_ini->_dsize() ) { |
299 | | bdm_error ( "init_rv and init_values fields have incompatible sizes" ); |
300 | | } else { |
301 | | ut2rgr.set_history ( *rv_ini, val ); |
302 | | yt2rgr.set_history ( *rv_ini, val ); |
303 | | } |
304 | | } |
305 | | |
306 | | yt = zeros ( ipdf->dimension() ); |
307 | | rgr = zeros ( ipdf->dimensionc() ); |
308 | | ut = zeros ( Urv._dsize() ); |
309 | | |
310 | | utsize = ut.length(); |
311 | | dtsize = yt.length() + utsize; |
| 286 | ipdf = UI::build<pdf> ( set, "pdf", UI::compulsory ); |
| 287 | UI::get ( init_rv, set, "init_rv", UI::optional); |
| 288 | UI::get ( init_values, set, "init_values", UI::optional); |
315 | | DS::validate(); |
| 292 | RV Yrv = ipdf->_rv(); |
| 293 | // get unique rvs form rvc |
| 294 | RV rgrv0 = ipdf->_rvc().remove_time(); |
| 295 | // input is what in not in Yrv |
| 296 | Urv = rgrv0.subt ( Yrv ); |
| 297 | Drv= concat(Yrv,Urv); |
| 298 | // connect input and output to rvc |
| 299 | ut2rgr.set_connection ( ipdf->_rvc(), Urv ); |
| 300 | yt2rgr.set_connection ( ipdf->_rvc(), Yrv ); |
| 301 | |
| 302 | if ( init_rv._dsize()>0 ) { // check if |
| 303 | if ( init_values.length() != init_rv._dsize() ) { |
| 304 | bdm_error ( "init_rv and init_values fields have incompatible sizes" ); |
| 305 | } else { |
| 306 | ut2rgr.set_history ( init_rv, init_values ); |
| 307 | yt2rgr.set_history ( init_rv, init_values ); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | yt = zeros ( ipdf->dimension() ); |
| 312 | rgr = zeros ( ipdf->dimensionc() ); |
| 313 | ut = zeros ( Urv._dsize() ); |
| 314 | |
| 315 | utsize = ut.length(); |
| 316 | dtsize = yt.length() + utsize; |
| 317 | |
| 318 | DS::validate(); |