Changeset 895 for library/bdm/mex

Show
Ignore:
Timestamp:
04/08/10 16:01:03 (14 years ago)
Author:
smidl
Message:

get rid of Yrv in DS

Location:
library/bdm/mex
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/mex/mex_datasource.h

    r766 r895  
    4545                rowid = linspace ( 0, Data.rows() - 1 ); 
    4646                dtsize = rowid.length(); 
    47                 ytsize = rowid.length(); 
    4847                utsize = 0; 
    4948 
     
    8786        mexDS () : DS() {}; 
    8887 
    89         /*! \brief Create memory data source from mxArray 
     88        /*! \brief Data source computed by matlab function 
    9089 
    9190        \code 
     
    9493                step_name="";              // name of function to call 
    9594                input_name="";             // name of workspace variable where inputs are written 
    96                 yrv = {class='RV',...}  // identification of outputs 
     95                drv = {class='RV',...}  // identification of outputs 
    9796                urv = {class='RV',...}   // identification of inputs 
    9897                }; 
     
    106105                UI::get ( input_name, set, "input_name", UI::compulsory ); 
    107106 
    108                 shared_ptr<RV> ry = UI::build<RV> ( set, "yrv", UI::compulsory ); 
     107                shared_ptr<RV> rd = UI::build<RV> ( set, "drv", UI::compulsory ); 
    109108                shared_ptr<RV> ru = UI::build<RV> ( set, "urv", UI::compulsory ); 
    110109 
    111                 ytsize = ry->_dsize(); 
     110                dtsize = rd->_dsize(); 
    112111                utsize = ru->_dsize(); 
    113                 dtsize = ytsize + utsize; 
    114112 
    115                 set_drv ( *ry, *ru ); 
     113                set_drv ( *rd, *ru ); 
    116114                validate(); 
    117115        } 
     
    142140                mexCallMATLAB ( 1, &tmp, 0, ( mxArray ** ) &dummy, step_name.c_str() ); 
    143141                // save its results 
    144                 bdm_assert_debug ( ( int ) mxGetM ( tmp ) == ytsize || ( int ) mxGetN ( tmp ) == ytsize, "mexDS.step() expected return vector of length " + num2str ( dtsize ) + 
     142                bdm_assert_debug ( ( int ) mxGetM ( tmp ) == dtsize || ( int ) mxGetN ( tmp ) == dtsize, "mexDS.step() expected return vector of length " + num2str ( dtsize ) + 
    145143                                   "got vector " + num2str ( ( int ) mxGetM ( tmp ) ) + "x" + num2str ( ( int ) mxGetN ( tmp ) ) ); 
    146144                //write  y 
    147145                dt.set_subvector ( 0, mxArray2vec ( tmp ) ); 
    148146                //write u 
    149                 dt.set_subvector ( ytsize, ut ); 
    150147        } 
    151148        void write ( const vec &ut0 ) { 
  • library/bdm/mex/mex_logger.h

    r737 r895  
    6262                        istart = 0; 
    6363                        for ( int j = 0; j < entries ( i ).length(); j++ ) { // same for as in add!!! 
    64                                 vec_name = names ( i ) + prefix_sep() + entries ( i ).name ( j ); 
     64                                vec_name = names ( i ) + "_" + entries ( i ).name ( j ); 
    6565                                iend = istart + entries ( i ).size ( j ) - 1; 
    6666                                M = vectors ( i ).get_cols ( istart, iend );