Show
Ignore:
Timestamp:
07/20/09 12:41:12 (15 years ago)
Author:
vbarta
Message:

RV partial cleanup: more arguments passed by reference, less inline functions, tests integrated into the testsuite

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/bdmbase.cpp

    r384 r422  
    5555} 
    5656 
    57 void RV::init ( Array<std::string> in_names, ivec in_sizes,ivec in_times ) { 
     57void RV::init(const Array<std::string> &in_names, const ivec &in_sizes, const ivec &in_times) 
     58{ 
    5859        len = in_names.length(); 
    5960        it_assert_debug ( in_names.length() ==in_times.length(), "check \"times\" " ); 
     
    106107        ret.dsize=ret.countsize(); 
    107108        return ret; 
     109} 
     110 
     111RV RV::operator()(int di1, int di2) const 
     112{ 
     113    ivec sz = cumsizes(); 
     114    int i1 = 0; 
     115    while (sz(i1) < di1) i1++; 
     116    int i2 = i1; 
     117    while (sz(i2) < di2) i2++; 
     118    return subselect(linspace(i1, i2)); 
    108119} 
    109120