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


C++ unordered_set::clear方法代码示例

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


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

示例1: closeAllWindows

void closeAllWindows()
{
	if(disableAllDisplay) return;
	boost::unique_lock<boost::mutex> lock(openCVdisplayMutex);
	cv::destroyAllWindows();
	openWindows.clear();
}
开发者ID:ShudaLi,项目名称:dso,代码行数:7,代码来源:ImageDisplay_OpenCV.cpp

示例2: displayThreadLoop

void displayThreadLoop()
{
	printf("started image display thread!\n");
	boost::unique_lock<boost::mutex> lock(openCVdisplayMutex);
	while(imageThreadKeepRunning)
	{
		openCVdisplaySignal.wait(lock);

		if(!imageThreadKeepRunning)
			break;

		while(displayQueue.size() > 0)
		{
			if(!displayQueue.back().autoSize)
			{
				if(openWindows.find(displayQueue.back().name) == openWindows.end())
				{
					cv::namedWindow(displayQueue.back().name, cv::WINDOW_NORMAL);
					cv::resizeWindow(displayQueue.back().name, displayQueue.back().img.cols, displayQueue.back().img.rows);
					openWindows.insert(displayQueue.back().name);
				}
			}
			cv::imshow(displayQueue.back().name, displayQueue.back().img);
			cv::waitKey(1);
			displayQueue.pop_back();
		}
	}
	cv::destroyAllWindows();
	openWindows.clear();

	printf("ended image display thread!\n");
}
开发者ID:siposcsaba89,项目名称:lsd_slam,代码行数:32,代码来源:ImageDisplay_OpenCV.cpp

示例3: if

bool S4Prover::isSatisfiableRefined(SddNode* alpha, SddManager* m, std::unordered_set<SddLiteral> permVars, SddNode* permSdd,
                                std::unordered_set<SddNode*,SddHasher>& assumedSatSdds, std::unordered_set<SddLiteral>& responsibleVars) {
    assumedSatSdds.clear();
    std::unordered_set<SddLiteral> postResponsibleVars;
    bool isSat;
    if (sdd_node_is_false(alpha)) {
        isSat = false;
    }
    else if (dependentSdds.count(alpha) == 1) {
        //Loop detected
        assumedSatSdds.insert(alpha);
        isSat = true;
    }
    else {
        isSat = isSatisfiable(alpha,m,permVars,permSdd,assumedSatSdds, postResponsibleVars);
    }
    
    if (assumedSatSdds.count(alpha) == 1) {
		assumedSatSdds.erase(alpha);
	}
    
    if (!isSat) {
        responsibleVars.insert(postResponsibleVars.begin(), postResponsibleVars.end());
    }
    dependentSdds.erase(alpha);
    return isSat;
}
开发者ID:tpagram,项目名称:sddtab,代码行数:27,代码来源:s4Prover.cpp

示例4: get_indices

void data_store_csv::get_indices(std::unordered_set<int> &indices, int p) {
  indices.clear();
  std::vector<int> &v = m_all_minibatch_indices[p];
  for (auto t : v) {
    indices.insert((*m_shuffled_indices)[t]);
  }
}
开发者ID:LLNL,项目名称:lbann,代码行数:7,代码来源:data_store_csv.cpp

示例5: solve

box random_icp::solve(box b, double const precision ) {
    thread_local static std::unordered_set<std::shared_ptr<constraint>> used_constraints;
    used_constraints.clear();
    thread_local static vector<box> solns;
    thread_local static vector<box> box_stack;
    solns.clear();
    box_stack.clear();
    box_stack.push_back(b);
    do {
        DREAL_LOG_INFO << "random_icp::solve - loop"
                       << "\t" << "box stack Size = " << box_stack.size();
        b = box_stack.back();
        box_stack.pop_back();
        try {
            m_ctc.prune(b, m_config);
            auto this_used_constraints = m_ctc.used_constraints();
            used_constraints.insert(this_used_constraints.begin(), this_used_constraints.end());
        } catch (contractor_exception & e) {
            // Do nothing
        }
        if (!b.is_empty()) {
            tuple<int, box, box> splits = b.bisect(precision);
            int const i = get<0>(splits);
            if (i >= 0) {
                box const & first  = get<1>(splits);
                box const & second = get<2>(splits);
                if (random_bool()) {
                    box_stack.push_back(second);
                    box_stack.push_back(first);
                } else {
                    box_stack.push_back(first);
                    box_stack.push_back(second);
                }
                if (m_config.nra_proof) {
                    m_config.nra_proof_out << "[branched on "
                                         << b.get_name(i)
                                         << "]" << endl;
                }
            } else {
                m_config.nra_found_soln++;
                if (m_config.nra_found_soln >= m_config.nra_multiple_soln) {
                    break;
                }
                if (m_config.nra_multiple_soln > 1) {
                    // If --multiple_soln is used
                    output_solution(b, m_config, m_config.nra_found_soln);
                }
                solns.push_back(b);
            }
        }
    } while (box_stack.size() > 0);
    m_ctc.set_used_constraints(used_constraints);
    if (m_config.nra_multiple_soln > 1 && solns.size() > 0) {
        return solns.back();
    } else {
        assert(!b.is_empty() || box_stack.size() == 0);
        return b;
    }
}
开发者ID:sunqxj,项目名称:dreal3,代码行数:59,代码来源:icp.cpp

示例6:

 void CLKernelParameterParser::KernelParameters::getParameterNames(std::unordered_set<std::string>& dest) const
 {
     dest.clear();
     for(auto it = parametersByName.begin(); it != parametersByName.end(); ++it)
     {
         dest.insert(it->first);
     }
 }
开发者ID:c3di,项目名称:ettention,代码行数:8,代码来源:CLKernelParameterParser.cpp

示例7: add_timers

// Add a collection of timers to the data store.  The collection is emptied by
// this operation, since the timers are now owned by the store.
void TimerStore::add_timers(std::unordered_set<Timer*>& set)
{
  for (auto it = set.begin(); it != set.end(); ++it)
  {
    add_timer(*it);
  }
  set.clear();
}
开发者ID:plfrancis,项目名称:chronos,代码行数:10,代码来源:timer_store.cpp

示例8: url_module_cleanup

static bool url_module_cleanup(KviModule *)
{
	KviConfigurationFile cfg(szConfigPath, KviConfigurationFile::Read);
	cfg.setGroup("ConfigDialog");
	if(cfg.readBoolEntry("SaveUrlListOnUnload", false) == true)
		saveUrlList();
	for(auto tmpitem : g_UrlDlgList)
	{
		if(tmpitem->dlg)
			tmpitem->dlg->close();
	}

	g_List.clear();
	g_BanList.clear();
	g_UrlDlgList.clear();

	return true;
}
开发者ID:HasClass0,项目名称:KVIrc,代码行数:18,代码来源:libkviurl.cpp

示例9: clear

void UrlDialog::clear()
{
	g_List.clear();
	for(auto & tmpitem : g_UrlDlgList)
	{
		if(tmpitem->dlg)
			tmpitem->dlg->m_pUrlList->clear();
	}
}
开发者ID:HasClass0,项目名称:KVIrc,代码行数:9,代码来源:libkviurl.cpp

示例10: reset

 void reset() {
   //dailySessionInterval = SimTimeInterval(0,0);
   content = nullptr;
   currentChunk = 0;
   highestChunkFetched = 0;
   chunksToBeWatched = 0;
   buffer.clear();
   waiting = false;
 }
开发者ID:manuhalo,项目名称:PLACeS,代码行数:9,代码来源:TopologyOracle.hpp

示例11: get_my_indices

void data_store_csv::get_my_indices(std::unordered_set<int> &indices, int p) {
  indices.clear();
  std::vector<int> &v = m_all_minibatch_indices[p];
  for (auto t : v) {
    int index = (*m_shuffled_indices)[t];
    if (m_data.find(index) != m_data.end()) {
      indices.insert(index);
    }
  }
}
开发者ID:LLNL,项目名称:lbann,代码行数:10,代码来源:data_store_csv.cpp

示例12: getNumberOfLoops

size_t Statistics::getNumberOfLoops(DFA_Automata * dfa) {
    std::cout << "start loop counting" << std::endl;
    InStack.insert(std::make_pair(dfa->m_startState, 1));
    LoopDFS(dfa->m_startState);
    size_t cnt = LoopCnt;
    LoopCnt = 0;
    LoopVisited.clear();
    InStack.clear();
    return cnt;
}
开发者ID:martinradev,项目名称:DNAAssembly,代码行数:10,代码来源:Statistics.cpp

示例13: getOtherTraitNames

void TraitPrecStatement::getOtherTraitNames(
    std::unordered_set<std::string>& namesSet) const {
  std::vector<std::string> namesVec;
  m_otherTraitNames->getStrings(namesVec);
  for (unsigned int i = 0; i < namesVec.size(); i++) {
    namesVec[i] = toLower(namesVec[i]);
  }
  namesSet.clear();
  namesSet.insert(namesVec.begin(), namesVec.end());
}
开发者ID:enov,项目名称:hhvm,代码行数:10,代码来源:trait_prec_statement.cpp

示例14: pop

// Pop a set of timers, this function takes ownership of the timers and
// thus empties the passed in set.
void TimerHandler::pop(std::unordered_set<TimerPair>& timers)
{
  for (std::unordered_set<TimerPair>::iterator it = timers.begin();
                                               it != timers.end();
                                               ++it)
  {
    delete it->information_timer;
    pop(it->active_timer);
  }
  timers.clear();
}
开发者ID:prio,项目名称:chronos,代码行数:13,代码来源:timer_handler.cpp

示例15: fig0_5_is_complete

bool fig0_5_is_complete(int components_id)
{
    bool complete = components_seen.count(components_id);

    if (complete) {
        components_seen.clear();
    }
    else {
        components_seen.insert(components_id);
    }

    return complete;
}
开发者ID:coinchon,项目名称:etisnoop,代码行数:13,代码来源:fig0_5.cpp


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