Changeset 263 for bdm/uibuilder.h

Show
Ignore:
Timestamp:
02/09/09 23:11:35 (15 years ago)
Author:
smidl
Message:

UIArxDS test

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/uibuilder.h

    r260 r263  
    5454                                        default: it_error ( "libconfig error?" ); 
    5555                                } 
     56                        } 
     57                        return tmp; 
     58                }; 
     59                const mat getmat ( Setting& S , int ncols) const { 
     60                        CHECK_UITYPE ( S,TypeArray ); 
     61                        mat tmp; 
     62                        int nrows=S.getLength()/ncols; 
     63                        int r=0,c=0; 
     64                        tmp.set_size ( nrows, ncols ); 
     65                        // Build matrix row-wise 
     66                        for ( int i=0;i<S.getLength();i++ ) { 
     67                                switch ( S[i].getType() ) { 
     68                                        case Setting::TypeFloat : 
     69                                                tmp(r,c)=double ( S[i] );break; 
     70                                        case Setting::TypeInt : 
     71                                                tmp(r,c)=int ( S[i] );break; 
     72                                        case Setting::TypeBoolean : 
     73                                                tmp(r,c)=bool ( S[i] );break; 
     74                                        default: it_error ( "libconfig error?" ); 
     75                                } 
     76                                c++; if (c==ncols) {c=0;r++;} 
    5677                        } 
    5778                        return tmp;