Exemplo n.º 1
0
  INT_VECT GetBitFuncGroupIds(const FragCatalog *self,unsigned int idx){
    if(idx > self->getFPLength())
      throw_index_error(idx);
    INT_VECT res;
    INT_INT_VECT_MAP gps = self->getEntryWithBitId(idx)->getFuncGroupMap();
    for(INT_INT_VECT_MAP::const_iterator i=gps.begin();i!=gps.end();i++){
      for(INT_VECT_CI ivci=i->second.begin();ivci!=i->second.end();ivci++){
	res.push_back(*ivci);
      }
    }
    return res;
  }
Exemplo n.º 2
0
bool checkFused(const INT_VECT &rids, INT_INT_VECT_MAP &ringNeighs) {
  INT_INT_VECT_MAP_CI nci;
  int nrings = rdcast<int>(ringNeighs.size());
  boost::dynamic_bitset<> done(nrings);
  int rid;
  INT_VECT fused;

  // mark all rings in the system other than those in rids as done
  for (nci = ringNeighs.begin(); nci != ringNeighs.end(); nci++) {
    rid = (*nci).first;
    if (std::find(rids.begin(), rids.end(), rid) == rids.end()) {
      done[rid] = 1;
    }
  }

  // then pick a fused system from the remaining (i.e. rids)
  // If the rings in rids are fused we should get back all of them
  // in fused
  // if we get a smaller number in fused then rids are not fused
  pickFusedRings(rids.front(), ringNeighs, fused, done);

  CHECK_INVARIANT(fused.size() <= rids.size(), "");
  return (fused.size() == rids.size());
}