Changeset 624
- Timestamp:
- 09/18/09 00:17:02 (15 years ago)
- Location:
- library/bdm/base
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/bdmbase.cpp
r620 r624 49 49 NAMES ( id ) = name; 50 50 SIZES ( id ) = size; 51 bdm_assert(size>0, "RV "+ name +" does not exists. Default size (-1) can not be assigned "); 51 52 } else { 52 53 id = iter->second; 53 bdm_assert_debug ( SIZES ( id ) == size, "RV " + name + " of different size already exists" ); 54 if (size>0){ 55 bdm_assert ( SIZES ( id ) == size, "RV " + name + " of different size already exists" ); 56 } 54 57 } 55 58 return id; -
library/bdm/base/bdmbase.h
r620 r624 273 273 274 274 \code 275 rv = { 276 class = "RV"; // class name 277 // UNIQUE IDENTIFIER same names = same variable 278 names = ( "a", "b", "c", ...); // which will be used e.g. in loggers 279 280 //optional arguments 281 sizes = [1, 2, 3, ...]; // (optional) default = ones() 282 times = [-1, -2, 0, ...]; // time shifts with respect to current time (optional) default = zeros() 283 } 275 class = 'RV'; 276 names = {'a', 'b', 'c', ...}; // UNIQUE IDENTIFIER same names = same variable 277 // names are also used when storing results 278 --- optional --- 279 sizes = [1, 2, 3, ...]; // size of each name. default = ones() 280 // if size = -1, it is found out from previous instances of the same name 281 times = [-1, -2, 0, ...]; // time shifts with respect to current time, default = zeros() 284 282 \endcode 285 283 */ … … 737 735 ivec valid_ids = rv.findself_ids ( rv_up ); 738 736 RV rv_hist = rv.subselect ( find ( valid_ids >= 0 ) ); // select only rvs that are in rv_up 739 RV rv_hist0 =rv_hist.remove_time(); // these RVs will form history at time =0 740 v2h_up = rv_hist0.dataind(rv_up); // indeces of elements of rv_up to be copied 741 // now we need to know what is needed from Up 737 RV rv_hist0 =rv_hist.remove_time(); // these RVs will form history at time =0 738 // now we need to know what is needed from Up 742 739 rv_hist = rv_hist.expand_delayes(); // full regressor - including time 0 743 740 Hrv=rv_hist.subt(rv_hist0); // remove time 0 744 741 history = zeros ( Hrv._dsize() ); 745 742 743 // decide if we need to copy val to history 744 if (Hrv._dsize() >0) { 745 v2h_up = rv_hist0.dataind(rv_up); // indeces of elements of rv_up to be copied 746 } // else v2h_up is empty 747 746 748 Hrv.dataind ( rv, h2v_hist, h2v_down ); 747 749