- Timestamp:
- 09/13/09 23:14:26 (15 years ago)
- Location:
- library/bdm/base
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/datasources.h
r609 r611 23 23 * \brief Memory storage of off-line data column-wise 24 24 25 The data are stored in an internal matrix \c Data . Each column of Data corresponds to one discrete time observation \f$t\f$. Access to this matrix is via indices \c rowid and \c delays.25 The data are stored in an internal matrix \c Data . Each column of Data corresponds to one discrete time observation \f$t\f$. Access to this matrix is via indices \c rowid. 26 26 27 27 The data can be loaded from a file. … … 56 56 /*! Create object from the following structure 57 57 \code 58 { class = 'MemDS';58 { class = "MemDS"; 59 59 Data = (...); // Data matrix or data vector 60 60 --- optional --- 61 drv = {class= 'RV'; ...} // Identification how rows of the matrix Data will be known to others61 drv = {class="RV"; ...} // Identification how rows of the matrix Data will be known to others 62 62 time = 0; // Index of the first column to user_info, 63 63 rowid = [1,2,3...]; // ids of rows to be used … … 68 68 \code 69 69 rowid= [0, 1, 2, ...number_of_rows_of_Data]; 70 drv = {names=(" 0", "1", "2", ..."number_of_rows_of_Data");70 drv = {names=("ch0", "ch1", "ch2", ..."number_of_rows_of_Data"); 71 71 sizes=( 1 1 1 ...); 72 72 times=( 0 0 0 ...); … … 93 93 UIREGISTER(MemDS); 94 94 95 /*! \brief Simulate data from a static pdf 95 /*! \brief Simulate data from a static pdf (epdf) 96 96 97 Trivial example of a data source, could be used for tests of some estimation algorithms. For example, simulating data from a mixture model and feeding them to mixture model estimators. 97 98 */ … … 119 120 /*! 120 121 \code 121 class = " PdfDS";122 epdf = {class="epdf_offspring", ...}// list of points122 class = "EpdfDS"; 123 epdf = {class="epdf_offspring", ...}// uncondtitional density to sample from 123 124 \endcode 124 125 … … 126 127 void from_setting ( const Setting &set ) { 127 128 iepdf=UI::build<epdf> ( set,"epdf",UI::compulsory ); 128 dt = zeros ( iepdf->dimension() ); 129 bdm_assert(iepdf->isnamed(), "Input epdf must be named, check if RV is given correctly"); 130 dt = iepdf->sample(); 131 dtsize=dt.length(); 132 set_drv(iepdf->_rv(),RV()); 133 utsize =0; 129 134 } 130 135 }; -
library/bdm/base/loggers.h
r565 r611 89 89 SHAREDPTR ( memlog ); 90 90 91 92 /*! \brief Simple logger used for debugging 93 All data records are written out to std from where they could be send to file 94 */ 95 class stdlog: public memlog{ 96 public: 97 //! default constructor 98 stdlog():memlog(1){}; 99 100 void init() { 101 memlog::init(); 102 for (int i=0; i<entries.length();i++){ 103 if (entries(i)._dsize()==1) { 104 cout << names(i) << entries(i).name(0) << "\t"; 105 } 106 else 107 for (int j=0; j<vectors(i).cols(); j++){ 108 cout << names(i) << entries(i).scalarname(j) << "\t"; 109 } 110 } 111 cout << endl; 112 113 114 } 115 //!writes everything out 116 void step() { 117 for (int i=0; i<vectors.length();i++){ 118 for (int j=0; j<vectors(i).cols(); j++){ 119 cout << vectors(i)(0,j) << "\t"; 120 } 121 } 122 cout << endl; 123 } 124 /*! \brief UI for stdlog 125 126 TODO dat tam kam patri, a to celej blok 127 128 \code 129 logger = { 130 class = "stdlog"; // no parameterization needed 131 } 132 \endcode 133 */ 134 void from_setting ( const Setting &set ){ 135 } 136 137 }; 138 UIREGISTER(stdlog); 139 91 140 /*! 92 141 * \brief Logging into dirfile with buffer in memory