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


C++ CC函数代码示例

本文整理汇总了C++中CC函数的典型用法代码示例。如果您正苦于以下问题:C++ CC函数的具体用法?C++ CC怎么用?C++ CC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: fout

//================================================
void DynamicalGraph::Run(uint32_t t_init, uint32_t t_measure) {
  std::ofstream fout("timeseries.dat");

  for( ; m_currentTime<t_init; m_currentTime++) {
    Update();
    if( m_currentTime%1024 == 0 ) {
      std::cerr << "t : " << m_currentTime << std::endl;
      fout << m_currentTime << ' ' << Diversity()
        << ' ' << LinkDensity()
        << ' ' << CC() << std::endl;
    }
  }

  ClearHisto();

  for( ; m_currentTime<t_init+t_measure; m_currentTime++) {
    Update();
    m_densitySum += LinkDensity();
    m_densityCount++;
    if( m_currentTime % 128 == 0 ) {
      m_CCsum += CC();
      m_CCcount++;
    }
    if( m_currentTime%1024 == 0 ) {
      std::cerr << "t : " << m_currentTime << std::endl;
      fout << m_currentTime << ' ' << Diversity()
        << ' ' << LinkDensity()
        << ' ' << CC() << std::endl;
    }
  }
  fout.close();
}
开发者ID:yohm,项目名称:dynamical_graph_model,代码行数:33,代码来源:dynamical_graph_model.cpp

示例2: cesar_cipher2

void cesar_cipher2(list *p_l,int *key,int *pos) {
    list node = *p_l; // liste temporaire
    int i;
    for(i=0;i<*pos;i++) node = node->next;
        if(CONTENT >= 'A' && CONTENT <= 'Z') // si le char est une majuscule
            CONTENT = CC(CONTENT,*key,'A'); // on chiffre la phrase
        else if(CONTENT >= 'a' && CONTENT <= 'z') // si le char est une minuscule
            CONTENT = CC(CONTENT,*key,'a'); // on chiffre la phrase
}
开发者ID:ariefsatriana,项目名称:Cryptographer-Tool,代码行数:9,代码来源:cesar.c

示例3: CC

void mpz_matrix_manager::tensor_product(mpz_matrix const & A, mpz_matrix const & B, mpz_matrix & C) {
    scoped_mpz_matrix CC(*this);
    mk(A.m * B.m, A.n * B.n, CC);
    for (unsigned i = 0; i < CC.m(); i++)
        for (unsigned j = 0; j < CC.n(); j++)
            nm().mul(A(i / B.m, j / B.n), 
                     B(i % B.m, j % B.n), 
                     CC(i, j));
    C.swap(CC);
}
开发者ID:AleksandarZeljic,项目名称:z3,代码行数:10,代码来源:mpz_matrix.cpp

示例4: cesar_cipher

void cesar_cipher(list *p_l,int *key) {
    list node = *p_l; // liste temporaire
    while(node) {
        if(CONTENT >= 'A' && CONTENT <= 'Z') // si le char est une majuscule
            CONTENT = CC(CONTENT,*key,'A'); // on chiffre la phrase
        else if(CONTENT >= 'a' && CONTENT <= 'z') // si le char est une minuscule
            CONTENT = CC(CONTENT,*key,'a'); // on chiffre la phrase
        node = node->next; // on avance dans la liste
    }
}
开发者ID:ariefsatriana,项目名称:Cryptographer-Tool,代码行数:10,代码来源:cesar.c

示例5: memcpy

void CMyAI::newGame()
{
	memcpy(originalBoard, p_ai->GetBoard(), sizeof(int)*BOARD_SIZE);
	history.clear();
	firstMoveIsOver = true;
	cout << "===================start a new game=====================" << endl;

	if (we == PLAYER_1)
	{
		cout << "\t\twe are player 1" << endl;
	}
	else
	{
		cout << "\t\twe are player 2" << endl;
	}
	if (next == we)
	{
		cout << "\tYeah! We go first!!!" << endl;
		first = next;
	}
	else
	{
		cout << "\tOh shit! We do not go first!" << endl;
		first = next;
	}

	int count7x7 = 0;
	for (int x = 2; x <= 8; x++){
		for (int y = 2; y <= 8; y++){
			if (originalBoard[CC(x, y)] == BLOCK_OBSTACLE)
				count7x7++;
		}
	}

	int count3x3 = 0;
	for (int x = 4; x <= 6; x++){
		for (int y = 4; y <= 6; y++){
			if (originalBoard[CC(x, y)] == BLOCK_OBSTACLE)
				count3x3++;
		}
	}

	if (count7x7 >= 8 || (count3x3 >= 2 && count7x7 >= 6)){
		searcher.heuristic.rateBoard = &CHeuristicBase::simpleRateBoard;
	}
	else
	{
		searcher.heuristic.rateBoard = &CHeuristicBase::voronoiRateBoard;
	}
}
开发者ID:louislzcute,项目名称:ai-contest-2015,代码行数:50,代码来源:MyAI.cpp

示例6: assert

//---------------------------------------------------------------------------------------
// Initialize, use a Config object
bool CCudaProjector3D::initialize(const Config& _cfg)
{
	assert(_cfg.self);
	ConfigStackCheck<CProjector3D> CC("CudaProjector3D", this, _cfg);

	// if already initialized, clear first
	if (m_bIsInitialized) {
		clear();
	}

	// initialization of parent class
	if (!CProjector3D::initialize(_cfg)) {
		return false;
	}

	XMLNode node = _cfg.self.getSingleNode("ProjectionKernel");
	m_projectionKernel = ker3d_default;
	if (node) {
		std::string sProjKernel = node.getContent();

		if (sProjKernel == "default") {

		} else if (sProjKernel == "sum_square_weights") {
			m_projectionKernel = ker3d_sum_square_weights;
		} else {
			return false;
		}
	}
	CC.markNodeParsed("ProjectionKernel");

	m_bIsInitialized = _check();
	return m_bIsInitialized;
}
开发者ID:eureka3,项目名称:astra-toolbox,代码行数:35,代码来源:CudaProjector3D.cpp

示例7: ASTRA_ASSERT

//---------------------------------------------------------------------------------------
// Initialize - Config
bool CSirtAlgorithm::initialize(const Config& _cfg)
{
	ASTRA_ASSERT(_cfg.self);
	ConfigStackCheck<CAlgorithm> CC("SirtAlgorithm", this, _cfg);

	// if already initialized, clear first
	if (m_bIsInitialized) {
		clear();
	}

	// initialization of parent class
	if (!CSartAlgorithm::initialize(_cfg)) {
		return false;
	}

	//// init data objects and data projectors
	//_init();

	//// Alpha
	//m_fAlpha = _cfg.self.getOptionNumerical("Alpha", m_fAlpha);
	//CC.markOptionParsed("Alpha");

	// success
	m_bIsInitialized = _check();
	return m_bIsInitialized;
}
开发者ID:mohamedadaly,项目名称:TRex,代码行数:28,代码来源:SirtAlgorithm.cpp

示例8: AA

  KOKKOS_INLINE_FUNCTION
  int
  Gemm<Trans::ConjTranspose,Trans::NoTranspose,
       AlgoGemm::SparseSparseSuperNodes,Variant::One>
  ::invoke(PolicyType &policy,
           MemberType &member,
           const ScalarType alpha,
           CrsExecViewTypeA &A,
           CrsExecViewTypeB &B,
           const ScalarType beta,
           CrsExecViewTypeC &C) {

    if (member.team_rank() == 0) {
      DenseMatrixView<typename CrsExecViewTypeA::flat_mat_base_type> AA(A.Flat());
      DenseMatrixView<typename CrsExecViewTypeA::flat_mat_base_type> BB(B.Flat());
      DenseMatrixView<typename CrsExecViewTypeA::flat_mat_base_type> CC(C.Flat());
      
      Gemm<Trans::ConjTranspose,Trans::NoTranspose,
        AlgoGemm::ExternalBlas,Variant::One>
        ::invoke(policy, member,
                 alpha, AA, BB, beta, CC);
    }

    return 0;
  }
开发者ID:uppatispr,项目名称:trilinos-official,代码行数:25,代码来源:Tacho_Gemm_ConjTrans_NoTrans_SparseSparseSuperNodes.hpp

示例9: verticesMatching

	void statisticsNetwork::closenessCentrality ( string filename ) // funktioniert nur für komplett verbundene Netzwerke korrekt
	{

		nodeIterator vi;
		network::nodeList vl;
		verticesMatching(vl, _dynNode_);

		unsigned int i;
		double distSum;
		vector <double> CC (vl.size());


		vector<baseType> distance;
		distance.resize(vl.size());

		for( vi=vl.begin() ; vi!=vl.end() ; vi++ )
		{
			dijkstra( distance, vl, *vi );
			distSum=0;
			for ( i=0 ; i<vl.size() ; i++ )
				distSum = distSum + distance[i];

			CC[ *vi -*vl.begin() ] = (vl.size()-1) / distSum ;
		}

		ofstream out(filename.c_str());
		for( i=0 ; i<vl.size() ; i++)
			out << CC[i] << endl ;

	}
开发者ID:hfuchs,项目名称:Conedy,代码行数:30,代码来源:statisticsNetwork.cpp

示例10: mark_cells_on_cells

void mark_cells_on_cells(CellIt     seed,
			 CellSeq&   cell_seq,
			 EltMarker& visited,
			 int        level,
			 CellPred   inside)
{
  typedef typename CellIt::grid_type        grid_type;
  typedef GT                                gt;
  typedef typename gt::Cell                 Cell;
  typedef typename gt::CellOnCellIterator   CellOnCellIterator;

  enumerated_cell_range<grid_type> new_cells(cell_seq.TheGrid()); 
  while(! seed.IsDone()) {
    Cell C = *seed;
    for(CellOnCellIterator cc(C); ! cc.IsDone(); ++cc) 
      if(inside(*cc)) {
	Cell CC(*cc);
	if(visited(CC) == 0) {
	  visited[CC] = level;
	  //cell_seq.append(CC);
	  new_cells.append(CC);
	}
      }
    ++seed;
  }
  cell_seq.append(new_cells.FirstCell(), new_cells.EndCell());
}
开发者ID:BackupTheBerlios,项目名称:gral,代码行数:27,代码来源:incidence-hulls.C

示例11: assembleSelector

inline void igl::PlanarizerShapeUp<DerivedV, DerivedF>::assembleP()
{
  P.setZero(3*ni*numF);
  for (int fi = 0; fi< numF; fi++)
  {
    // todo: this can be made faster by omitting the selector matrix
    Eigen::SparseMatrix<typename DerivedV::Scalar > Sfi;
    assembleSelector(fi, Sfi);
    Eigen::SparseMatrix<typename DerivedV::Scalar > NSi = Ni*Sfi;
    
    Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, 1> Vi = NSi*Vv;
    Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, Eigen::Dynamic> CC(3,ni);
    for (int i = 0; i <ni; ++i)
      CC.col(i) = Vi.segment(3*i, 3);
    Eigen::Matrix<typename DerivedV::Scalar, 3, 3> C = CC*CC.transpose();
    
    // Alec: Doesn't compile
    Eigen::EigenSolver<Eigen::Matrix<typename DerivedV::Scalar, 3, 3>> es(C);
    // the real() is for compilation purposes
    Eigen::Matrix<typename DerivedV::Scalar, 3, 1> lambda = es.eigenvalues().real();
    Eigen::Matrix<typename DerivedV::Scalar, 3, 3> U = es.eigenvectors().real();
    int min_i;
    lambda.cwiseAbs().minCoeff(&min_i);
    U.col(min_i).setZero();
    Eigen::Matrix<typename DerivedV::Scalar, Eigen::Dynamic, Eigen::Dynamic> PP = U*U.transpose()*CC;
    for (int i = 0; i <ni; ++i)
     P.segment(3*ni*fi+3*i, 3) =  weightsSqrt[fi]*PP.col(i);
    
  }
}
开发者ID:JiaranZhou,项目名称:libigl,代码行数:30,代码来源:planarize_quad_mesh.cpp

示例12: CC_HASH

void CC_HASH(unsigned int hashlen, void (*CC)(const void *data, uint32_t len, unsigned char *md),
						 C_BLOB &Param1,
						 C_LONGINT &Param2,
						 C_TEXT &returnValue)
{
	uint8_t *buf = (uint8_t *)calloc(hashlen, sizeof(uint8_t));
	
	CC((unsigned char *)Param1.getBytesPtr(), Param1.getBytesLength(), buf);
	
	C_BLOB temp;
	temp.setBytes((const uint8_t *)buf, hashlen);
	switch (Param2.getIntValue())
	{
		case 1:
			temp.toB64Text(&returnValue);
			break;
		case 2:
			temp.toB64Text(&returnValue, true);
			break;
		default:
			temp.toHexText(&returnValue);
			break;
	}
	
	free(buf);
}
开发者ID:miyako,项目名称:4d-plugin-common-crypto,代码行数:26,代码来源:4DPlugin.cpp

示例13: assert

//---------------------------------------------------------------------------------------
// Initialize, use a Config object
bool CCudaProjector2D::initialize(const Config& _cfg)
{
	assert(_cfg.self);
	ConfigStackCheck<CProjector2D> CC("CudaProjector2D", this, _cfg);

	// if already initialized, clear first
	if (m_bIsInitialized) {
		clear();
	}

	// initialization of parent class
	if (!CProjector2D::initialize(_cfg)) {
		return false;
	}

	// TODO: Check the projection geometry is a supported type

	XMLNode node = _cfg.self.getSingleNode("ProjectionKernel");
	m_projectionKernel = ker2d_default;
	if (node) {
		std::string sProjKernel = node.getContent();

		if (sProjKernel == "default") {

		} else {
			return false;
		}
	}
	CC.markNodeParsed("ProjectionKernel");

	m_bIsInitialized = _check();
	return m_bIsInitialized;
}
开发者ID:eureka3,项目名称:astra-toolbox,代码行数:35,代码来源:CudaProjector2D.cpp

示例14: AA

  KOKKOS_INLINE_FUNCTION
  int
  Herk<Uplo::Upper,Trans::ConjTranspose,
       AlgoHerk::SparseSparseSuperNodesByBlocks,Variant::One>
  ::invoke(PolicyType &policy,
           MemberType &member,
           const ScalarType alpha,
           CrsExecViewTypeA &A,
           const ScalarType beta,
           CrsExecViewTypeC &C) {



    if (member.team_rank() == 0) {
      DenseMatrixView<typename CrsExecViewTypeA::hier_mat_base_type> AA(A.Hier());
      DenseMatrixView<typename CrsExecViewTypeA::hier_mat_base_type> CC(C.Hier());
      
      Herk<Uplo::Upper,Trans::ConjTranspose,
        AlgoHerk::DenseByBlocks,Variant::One>
        ::invoke(policy, member,
                 alpha, AA, beta, CC);
    }

    return 0;
  }
开发者ID:uppatispr,项目名称:trilinos-official,代码行数:25,代码来源:Tacho_Herk_Upper_ConjTrans_SparseSparseSuperNodesByBlocks.hpp

示例15: Str

Expected<const CodeRegions &> AsmCodeRegionGenerator::parseCodeRegions() {
  MCTargetOptions Opts;
  Opts.PreserveAsmComments = false;
  MCStreamerWrapper Str(Ctx, Regions);

  // Create a MCAsmParser and setup the lexer to recognize llvm-mca ASM
  // comments.
  std::unique_ptr<MCAsmParser> Parser(
      createMCAsmParser(Regions.getSourceMgr(), Ctx, Str, MAI));
  MCAsmLexer &Lexer = Parser->getLexer();
  MCACommentConsumer CC(Regions);
  Lexer.setCommentConsumer(&CC);

  // Create a target-specific parser and perform the parse.
  std::unique_ptr<MCTargetAsmParser> TAP(
      TheTarget.createMCAsmParser(STI, *Parser, MCII, Opts));
  if (!TAP)
    return make_error<StringError>(
        "This target does not support assembly parsing.",
        inconvertibleErrorCode());
  Parser->setTargetParser(*TAP);
  Parser->Run(false);

  // Get the assembler dialect from the input.  llvm-mca will use this as the
  // default dialect when printing reports.
  AssemblerDialect = Parser->getAssemblerDialect();
  return Regions;
}
开发者ID:jamboree,项目名称:llvm,代码行数:28,代码来源:CodeRegionGenerator.cpp


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