56 | | MemDS ( mat &Dat, ivec &rowid0, ivec &delays0 ); |
57 | | }; |
| 55 | MemDS ( mat &Dat, ivec &rowid0); |
| 56 | /*! Create object from the following structure |
| 57 | \code |
| 58 | { class = 'MemDS'; |
| 59 | Data = (...); // Data matrix or data vector |
| 60 | --- optional --- |
| 61 | drv = {class='RV'; ...} // Identification how rows of the matrix Data will be known to others |
| 62 | time = 0; // Index of the first column to user_info, |
| 63 | rowid = [1,2,3...]; // ids of rows to be used |
| 64 | } |
| 65 | \endcode |
| 66 | |
| 67 | If the optional fields are not given, they will be filled as follows: |
| 68 | \code |
| 69 | rowid= [0, 1, 2, ...number_of_rows_of_Data]; |
| 70 | drv = {names=("0", "1", "2", ..."number_of_rows_of_Data"); |
| 71 | sizes=( 1 1 1 ...); |
| 72 | times=( 0 0 0 ...); |
| 73 | }; |
| 74 | time = 0; |
| 75 | \endcode |
| 76 | If \c rowid is given, \c drv will be named after indeces in rowids. |
| 77 | |
| 78 | Hence the data provided by method \c getdata() will be full column of matrix Data starting from the first record. |
| 79 | */ |
| 80 | void from_setting(const Setting &set){ |
| 81 | UI::get(Data, set, "Data", UI::compulsory); |
| 82 | if(!UI::get(time, set,"time", UI::optional)) {time =0;} |
| 83 | if(!UI::get(rowid, set, "rowid",UI::optional)) {rowid =linspace(0,Data.rows()-1);} |
| 84 | shared_ptr<RV> r=UI::build<RV>(set,"drv",UI::optional); |
| 85 | if (!r) {r=new RV(); |
| 86 | for (int i=0; i<rowid.length(); i++){ r->add(RV("ch"+num2str(rowid(i)), 1, 0));} |
| 87 | } |
| 88 | set_drv(*r,RV()); //empty urv |
| 89 | dtsize=r->_dsize(); |
| 90 | utsize=0; |
| 91 | } |
| 92 | }; |
| 93 | UIREGISTER(MemDS); |