Changeset 182 for bdm/stat/libBM.cpp

Show
Ignore:
Timestamp:
10/17/08 10:28:15 (16 years ago)
Author:
smidl
Message:

compilation error!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/libBM.cpp

    r181 r182  
    151151                } 
    152152        } 
     153        it_assert_debug(res.length()==tsize,"this rv is not fully present in crv!"); 
    153154        return res; 
    154155 
     156} 
     157 
     158void RV::dataind (const RV &rv2, ivec &selfi, ivec &rv2i) const { 
     159        //clean results 
     160        selfi.set_size(0); 
     161        rv2i.set_size(0); 
     162         
     163        // just in case any rv is empty 
     164        if ((len==0)||(rv2.length()==0)){return;}  
     165         
     166        //find comon rv 
     167        ivec cids=itpp::find(this->findself(rv2)>=0); 
     168         
     169        // index of  
     170        if ( cids.length()>0 ) { 
     171                str str1 = tostr(); 
     172                str str2 = rv2.tostr();  
     173                 
     174                ivec part1; 
     175                ivec part2; 
     176                int i,j; 
     177                // find common rv in strs 
     178                for ( j=0; j < cids.length();j++ ) { 
     179                        i = cids(j); 
     180                        part1 = itpp::find ( ( str1.ids == ids ( i ) ) & ( str1.times == times ( i ) ) ); 
     181                        part2 = itpp::find ( ( str2.ids == ids ( i ) ) & ( str2.times == times ( i ) ) ); 
     182                        selfi = concat ( selfi, part1 ); 
     183                        rv2i = concat ( rv2i, part2 ); 
     184                } 
     185        } 
     186        it_assert_debug(selfi.length() == rv2i.length(),"this should not happen!"); 
    155187} 
    156188 
     
    206238                // find ith rv in common rv 
    207239                rvsinrv ( i ) = mpdfs ( i )->_rv().dataind ( rv ); 
    208                 rvcsinrv ( i ) = mpdfs ( i )->_rvc().dataind ( rv ); 
    209                 rvinrvcs ( i ) = rv.dataind(mpdfs ( i )->_rvc()); 
    210                 //rvcsinrv and rvinrvcs must be 1-to-1 
    211                 it_assert_debug(rvcsinrv ( i ).length()==rvinrvcs(i).length(),"" ); 
     240                // establish link between rv and rvc 
     241                rv.dataind(mpdfs(i)->_rvc(), irv_rvcs(i), irvcs_rv(i)); 
    212242        } 
    213243}