当前位置: 首页>>代码示例>>C++>>正文


C++ dynamic_bitset::reset方法代码示例

本文整理汇总了C++中boost::dynamic_bitset::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ dynamic_bitset::reset方法的具体用法?C++ dynamic_bitset::reset怎么用?C++ dynamic_bitset::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在boost::dynamic_bitset的用法示例。


在下文中一共展示了dynamic_bitset::reset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: findFullXMMCandidates

/*
 * Finds the set of SSATmps that should be considered for allocation
 * to a full XMM register.  These are the SSATmps that satisfy all the
 * following conditions:
 *   a) it requires 2 64-bit registers
 *   b) it's defined in a load instruction
 *   c) all its uses are simple stores to memory
 *
 * The computed set of SSATmps is stored in m_fullXMMCandidates.
 */
void LinearScan::findFullXMMCandidates() {
  boost::dynamic_bitset<> notCandidates(m_irFactory->numTmps());
  m_fullXMMCandidates.reset();
  for (auto* block : m_blocks) {
    for (auto& inst : *block) {
      for (SSATmp& tmp : inst.dsts()) {
        if (tmp.numNeededRegs() == 2 && inst.isLoad()) {
          m_fullXMMCandidates[tmp.id()] = true;
        }
      }
      int idx = 0;
      for (SSATmp* tmp : inst.srcs()) {
        if (tmp->numNeededRegs() == 2 && !inst.storesCell(idx)) {
          notCandidates[tmp->id()] = true;
        }
        idx++;
      }
    }
  }
  m_fullXMMCandidates -= notCandidates;
}
开发者ID:jacano1969,项目名称:hiphop-php,代码行数:31,代码来源:linear-scan.cpp

示例2: reset

 void reset ()
 {
     flags_.reset();
 }
开发者ID:andrewdefries,项目名称:chemmine-ei,代码行数:4,代码来源:mplsh.cpp

示例3: if

std::vector<unsigned int> generateBondHashes(const ROMol &mol, boost::dynamic_bitset<>& atomsInPath,
    const std::vector<const Bond *>& bondCache,
    const std::vector<short>& isQueryBond,
    const PATH_TYPE &path, bool useBondOrder,
    std::vector<boost::uint32_t> *atomInvariants){

  PRECONDITION(!atomInvariants || atomInvariants->size() >= mol.getNumAtoms(),
               "bad atomInvariants size");

  std::vector<unsigned int> bondHashes;
  atomsInPath.reset();
  bool queryInPath=false;
  std::vector<unsigned int> atomDegrees(mol.getNumAtoms(),0);
  for(unsigned int i=0;i<path.size() && !queryInPath;++i){
    const Bond *bi = bondCache[path[i]];
    atomDegrees[bi->getBeginAtomIdx()]++;
    atomDegrees[bi->getEndAtomIdx()]++;
    atomsInPath.set(bi->getBeginAtomIdx());
    atomsInPath.set(bi->getEndAtomIdx());
    if(isQueryBond[path[i]]) queryInPath=true;
  }
  if(queryInPath){
    return bondHashes;
  }

  // -----------------
  // calculate the bond hashes:
  std::vector<unsigned int> bondNbrs(path.size(),0);
  bondHashes.reserve(path.size()+1);

  for(unsigned int i=0;i<path.size();++i){
    const Bond *bi = bondCache[path[i]];
#ifdef REPORT_FP_STATS
        if (std::find(atomsToUse.begin(), atomsToUse.end(),
                      bi->getBeginAtomIdx()) == atomsToUse.end()) {
          atomsToUse.push_back(bi->getBeginAtomIdx());
        }
        if (std::find(atomsToUse.begin(), atomsToUse.end(),
                      bi->getEndAtomIdx()) == atomsToUse.end()) {
          atomsToUse.push_back(bi->getEndAtomIdx());
        }
#endif
    for(unsigned int j=i+1;j<path.size();++j){
      const Bond *bj = bondCache[path[j]];
      if(bi->getBeginAtomIdx()==bj->getBeginAtomIdx() ||
          bi->getBeginAtomIdx()==bj->getEndAtomIdx() ||
          bi->getEndAtomIdx()==bj->getBeginAtomIdx() ||
          bi->getEndAtomIdx()==bj->getEndAtomIdx() ){
        ++bondNbrs[i];
        ++bondNbrs[j];
      }
    }
#ifdef VERBOSE_FINGERPRINTING
        std::cerr << "   bond(" << i << "):" << bondNbrs[i] << std::endl;
#endif
    // we have the count of neighbors for bond bi, compute its hash:
    unsigned int a1Hash = (*atomInvariants)[bi->getBeginAtomIdx()];
    unsigned int a2Hash = (*atomInvariants)[bi->getEndAtomIdx()];
    unsigned int deg1=atomDegrees[bi->getBeginAtomIdx()];
    unsigned int deg2=atomDegrees[bi->getEndAtomIdx()];
    if(a1Hash<a2Hash){
      std::swap(a1Hash,a2Hash);
      std::swap(deg1,deg2);
    }
    else if(a1Hash==a2Hash && deg1<deg2){
      std::swap(deg1,deg2);
    }
    unsigned int bondHash=1;
    if(useBondOrder){
      if(bi->getIsAromatic() || bi->getBondType()==Bond::AROMATIC){
        // makes sure aromatic bonds always hash as aromatic
        bondHash = Bond::AROMATIC;
      }
      else {
        bondHash = bi->getBondType();
      }
    }
    boost::uint32_t ourHash=bondNbrs[i];
    gboost::hash_combine(ourHash,bondHash);
    gboost::hash_combine(ourHash,a1Hash);
    gboost::hash_combine(ourHash,deg1);
    gboost::hash_combine(ourHash,a2Hash);
    gboost::hash_combine(ourHash,deg2);
    bondHashes.push_back(ourHash);
    //std::cerr<<"    "<<bi->getIdx()<<" "<<a1Hash<<"("<<deg1<<")"<<"-"<<a2Hash<<"("<<deg2<<")"<<" "<<bondHash<<" -> "<<ourHash<<std::endl;
  }
  return bondHashes;
}
开发者ID:Richard-Hall,项目名称:rdkit,代码行数:88,代码来源:Fingerprints.cpp

示例4: filterParticles

/******************************************************************************
* Performs the actual rejection of particles.
******************************************************************************/
size_t SliceModifier::filterParticles(boost::dynamic_bitset<>& mask, TimePoint time, TimeInterval& validityInterval)
{
	// Get the required input properties.
	ParticlePropertyObject* const posProperty = expectStandardProperty(ParticleProperty::PositionProperty);
	ParticlePropertyObject* const selProperty = applyToSelection() ? inputStandardProperty(ParticleProperty::SelectionProperty) : nullptr;
	OVITO_ASSERT(posProperty->size() == mask.size());
	OVITO_ASSERT(!selProperty || selProperty->size() == mask.size());

	FloatType sliceWidth = 0;
	if(_widthCtrl) sliceWidth = _widthCtrl->getFloatValue(time, validityInterval);
	sliceWidth *= 0.5;

	Plane3 plane = slicingPlane(time, validityInterval);

	size_t na = 0;
	boost::dynamic_bitset<>::size_type i = 0;
	const Point3* p = posProperty->constDataPoint3();
	const Point3* p_end = p + posProperty->size();

	if(sliceWidth <= 0) {
		if(selProperty) {
			const int* s = selProperty->constDataInt();
			for(; p != p_end; ++p, ++s, ++i) {
				if(*s && plane.pointDistance(*p) > 0) {
					mask.set(i);
					na++;
				}
				else mask.reset(i);
			}
		}
		else {
			for(; p != p_end; ++p, ++i) {
				if(plane.pointDistance(*p) > 0) {
					mask.set(i);
					na++;
				}
				else mask.reset(i);
			}
		}
	}
	else {
		bool invert = inverse();
		if(selProperty) {
			const int* s = selProperty->constDataInt();
			for(; p != p_end; ++p, ++s, ++i) {
				if(*s && invert == (plane.classifyPoint(*p, sliceWidth) == 0)) {
					mask.set(i);
					na++;
				}
				else mask.reset(i);
			}
		}
		else {
			for(; p != p_end; ++p, ++i) {
				if(invert == (plane.classifyPoint(*p, sliceWidth) == 0)) {
					mask.set(i);
					na++;
				}
				else mask.reset(i);
			}
		}
	}
	return na;
}
开发者ID:bitzhuwei,项目名称:OVITO_sureface,代码行数:67,代码来源:SliceModifier.cpp


注:本文中的boost::dynamic_bitset::reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。