您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CC函数代码示例

51自学网 2021-06-01 19:57:18
  C++
这篇教程C++ CC函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例6: assert

//---------------------------------------------------------------------------------------// Initialize, use a Config objectbool 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,


示例7: ASTRA_ASSERT

//---------------------------------------------------------------------------------------// Initialize - Configbool 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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例13: assert

//---------------------------------------------------------------------------------------// Initialize, use a Config objectbool 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,


示例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,


示例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,


示例16: CC

bool CFanFlatVecProjectionGeometry2D::initializeAngles(const Config& _cfg){	ConfigStackCheck<CProjectionGeometry2D> CC("FanFlatVecProjectionGeometry2D", this, _cfg);	// Required: Vectors	XMLNode node = _cfg.self.getSingleNode("Vectors");	ASTRA_CONFIG_CHECK(node, "FanFlatVecProjectionGeometry2D", "No Vectors tag specified.");	vector<float32> data;	try {		data = node.getContentNumericalArray();	} catch (const StringUtil::bad_cast &e) {		ASTRA_CONFIG_CHECK(false, "FanFlatVecProjectionGeometry2D", "Vectors must be a numerical matrix.");	}	CC.markNodeParsed("Vectors");	ASTRA_CONFIG_CHECK(data.size() % 6 == 0, "FanFlatVecProjectionGeometry2D", "Vectors doesn't consist of 6-tuples.");	m_iProjectionAngleCount = data.size() / 6;	m_pProjectionAngles = new SFanProjection[m_iProjectionAngleCount];	for (int i = 0; i < m_iProjectionAngleCount; ++i) {		SFanProjection& p = m_pProjectionAngles[i];		p.fSrcX  = data[6*i +  0];		p.fSrcY  = data[6*i +  1];		p.fDetUX = data[6*i +  4];		p.fDetUY = data[6*i +  5];		// The backend code currently expects the corner of the detector, while		// the matlab interface supplies the center		p.fDetSX = data[6*i +  2] - 0.5f * m_iDetectorCount * p.fDetUX;		p.fDetSY = data[6*i +  3] - 0.5f * m_iDetectorCount * p.fDetUY;	}	return true;}
开发者ID:astra-toolbox,项目名称:astra-toolbox,代码行数:33,


示例17: ASTRA_ASSERT

//---------------------------------------------------------------------------------------// Initialize - Configbool CCudaFDKAlgorithm3D::initialize(const Config& _cfg){	ASTRA_ASSERT(_cfg.self);	ConfigStackCheck<CAlgorithm> CC("CudaFDKAlgorithm3D", this, _cfg);	// if already initialized, clear first	if (m_bIsInitialized) {		clear();	}	// initialization of parent class	if (!CReconstructionAlgorithm3D::initialize(_cfg)) {		return false;	}	initializeFromProjector();	// Deprecated options	m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", m_iVoxelSuperSampling);	m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", m_iGPUIndex);	m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUIndex", m_iGPUIndex);	CC.markOptionParsed("VoxelSuperSampling");	CC.markOptionParsed("GPUIndex");	if (!_cfg.self.hasOption("GPUIndex"))		CC.markOptionParsed("GPUindex");	m_bShortScan = _cfg.self.getOptionBool("ShortScan", false);	CC.markOptionParsed("ShortScan");	// success	m_bIsInitialized = _check();	return m_bIsInitialized;}
开发者ID:PhysikerErlangen,项目名称:astra-toolbox,代码行数:37,


示例18: delayed_lsqfit

float * delayed_lsqfit( int veclen ,                        float * data , int nref , float *ref[] , double * cc ){   int    ii , jj ;   float  *alpha = NULL ;   double *rr = NULL ;   register double sum ;   if( nref < 1 || veclen < nref ||       data == NULL || ref == NULL || cc == NULL ) return NULL ;   /*** form RHS vector into rr ***/   rr = DBLEVEC(nref) ; if( rr == NULL ) return NULL ;   for( ii=0 ; ii < nref ; ii++ ){      sum = 0.0 ;      for( jj=0 ; jj < veclen ; jj++ ) sum += ref[ii][jj] * data[jj] ;      rr[ii] = sum ;   }   /*** forward solve ***/   for( ii=0 ; ii < nref ; ii++ ){      sum = rr[ii] ;      for( jj=0 ; jj < ii ; jj++ ) sum -= CC(ii,jj) * rr[jj] ;      rr[ii] = sum / CC(ii,ii) ;   }   /*** backward solve ***/   for( ii=nref-1 ; ii >= 0 ; ii-- ){      sum = rr[ii] ;      for( jj=ii+1 ; jj < nref ; jj++ ) sum -= CC(jj,ii) * rr[jj] ;      rr[ii] = sum / CC(ii,ii) ;   }   /*** put result into alpha ***/   alpha = (float *) malloc( sizeof(float) * nref ) ; if( alpha == NULL ) return NULL ;   for( ii=0 ; ii < nref ; ii++ ) alpha[ii] = rr[ii] ;   /*** cleanup and exit ***/   free(rr) ;   return alpha ;}
开发者ID:Gilles86,项目名称:afni,代码行数:47,


示例19: ASTRA_ASSERT

//---------------------------------------------------------------------------------------// Initialize - Configbool CConeVecProjectionGeometry3D::initialize(const Config& _cfg){	ASTRA_ASSERT(_cfg.self);	ConfigStackCheck<CProjectionGeometry3D> CC("ConeVecProjectionGeometry3D", this, _cfg);		XMLNode* node;	// TODO: Fix up class hierarchy... this class doesn't fit very well.	// initialization of parent class	//CProjectionGeometry3D::initialize(_cfg);	// Required: DetectorRowCount	node = _cfg.self->getSingleNode("DetectorRowCount");	ASTRA_CONFIG_CHECK(node, "ConeVecProjectionGeometry3D", "No DetectorRowCount tag specified.");	m_iDetectorRowCount = boost::lexical_cast<int>(node->getContent());	ASTRA_DELETE(node);	CC.markNodeParsed("DetectorRowCount");	// Required: DetectorColCount	node = _cfg.self->getSingleNode("DetectorColCount");	ASTRA_CONFIG_CHECK(node, "ConeVecProjectionGeometry3D", "No DetectorColCount tag specified.");	m_iDetectorColCount = boost::lexical_cast<int>(node->getContent());	m_iDetectorTotCount = m_iDetectorRowCount * m_iDetectorColCount;	ASTRA_DELETE(node);	CC.markNodeParsed("DetectorColCount");	// Required: Vectors	node = _cfg.self->getSingleNode("Vectors");	ASTRA_CONFIG_CHECK(node, "ConeVecProjectionGeometry3D", "No Vectors tag specified.");	vector<double> data = node->getContentNumericalArrayDouble();	CC.markNodeParsed("Vectors");	ASTRA_DELETE(node);	ASTRA_CONFIG_CHECK(data.size() % 12 == 0, "ConeVecProjectionGeometry3D", "Vectors doesn't consist of 12-tuples.");	m_iProjectionAngleCount = data.size() / 12;	m_pProjectionAngles = new SConeProjection[m_iProjectionAngleCount];	for (int i = 0; i < m_iProjectionAngleCount; ++i) {		SConeProjection& p = m_pProjectionAngles[i];		p.fSrcX  = data[12*i +  0];		p.fSrcY  = data[12*i +  1];		p.fSrcZ  = data[12*i +  2];		p.fDetUX = data[12*i +  6];		p.fDetUY = data[12*i +  7];		p.fDetUZ = data[12*i +  8];		p.fDetVX = data[12*i +  9];		p.fDetVY = data[12*i + 10];		p.fDetVZ = data[12*i + 11];		// The backend code currently expects the corner of the detector, while		// the matlab interface supplies the center		p.fDetSX = data[12*i +  3] - 0.5f * m_iDetectorRowCount * p.fDetVX - 0.5f * m_iDetectorColCount * p.fDetUX;		p.fDetSY = data[12*i +  4] - 0.5f * m_iDetectorRowCount * p.fDetVY - 0.5f * m_iDetectorColCount * p.fDetUY;		p.fDetSZ = data[12*i +  5] - 0.5f * m_iDetectorRowCount * p.fDetVZ - 0.5f * m_iDetectorColCount * p.fDetUZ;	}	// success	m_bInitialized = _check();	return m_bInitialized;}
开发者ID:viktorrulev,项目名称:gem_optical_tomography,代码行数:61,


示例20: ASTRA_ASSERT

//----------------------------------------------------------------------------------------// Initialization with a Config objectbool CProjectionGeometry2D::initialize(const Config& _cfg){	ASTRA_ASSERT(_cfg.self);	ConfigStackCheck<CProjectionGeometry2D> CC("ProjectionGeometry2D", this, _cfg);		// uninitialize if the object was initialized before	if (m_bInitialized)	{		clear();	}	// Required: DetectorWidth	XMLNode* node = _cfg.self->getSingleNode("DetectorWidth");	ASTRA_CONFIG_CHECK(node, "ProjectionGeometry2D", "No DetectorWidth tag specified.");	m_fDetectorWidth = boost::lexical_cast<float32>(node->getContent());	ASTRA_DELETE(node);	CC.markNodeParsed("DetectorWidth");	// Required: DetectorCount	node = _cfg.self->getSingleNode("DetectorCount");	ASTRA_CONFIG_CHECK(node, "ProjectionGeometry2D", "No DetectorCount tag specified.");	m_iDetectorCount = boost::lexical_cast<int>(node->getContent());	ASTRA_DELETE(node);	CC.markNodeParsed("DetectorCount");	// Required: ProjectionAngles	node = _cfg.self->getSingleNode("ProjectionAngles");	ASTRA_CONFIG_CHECK(node, "ProjectionGeometry2D", "No ProjectionAngles tag specified.");	vector<float32> angles = node->getContentNumericalArray();	delete node;	m_iProjectionAngleCount = angles.size();	ASTRA_CONFIG_CHECK(m_iProjectionAngleCount > 0, "ProjectionGeometry2D", "Not enough ProjectionAngles specified.");	m_pfProjectionAngles = new float32[m_iProjectionAngleCount];	for (int i = 0; i < m_iProjectionAngleCount; i++) {		m_pfProjectionAngles[i] = angles[i];	}	CC.markNodeParsed("ProjectionAngles");	vector<float32> offset = _cfg.self->getOptionNumericalArray("ExtraDetectorOffset");	m_pfExtraDetectorOffset = new float32[m_iProjectionAngleCount];	if (offset.size() == (size_t)m_iProjectionAngleCount) {		for (int i = 0; i < m_iProjectionAngleCount; i++) {			m_pfExtraDetectorOffset[i] = offset[i];		}	} else {		for (int i = 0; i < m_iProjectionAngleCount; i++) {			m_pfExtraDetectorOffset[i] = 0.0f;		}		}	CC.markOptionParsed("ExtraDetectorOffset");	// some checks	ASTRA_CONFIG_CHECK(m_iDetectorCount > 0, "ProjectionGeometry2D", "DetectorCount should be positive.");	ASTRA_CONFIG_CHECK(m_fDetectorWidth > 0.0f, "ProjectionGeometry2D", "DetectorWidth should be positive.");	ASTRA_CONFIG_CHECK(m_pfProjectionAngles != NULL, "ProjectionGeometry2D", "ProjectionAngles not initialized");	// Interface class, so don't return true	return false;}
开发者ID:valeriysokolov,项目名称:astra-toolbox,代码行数:60,


示例21: ASTRA_ASSERT

//---------------------------------------------------------------------------------------// Initialize - Configbool CCudaFDKAlgorithm3D::initialize(const Config& _cfg){	ASTRA_ASSERT(_cfg.self);	ConfigStackCheck<CAlgorithm> CC("CudaFDKAlgorithm3D", this, _cfg);	// if already initialized, clear first	if (m_bIsInitialized) {		clear();	}	// initialization of parent class	if (!CReconstructionAlgorithm3D::initialize(_cfg)) {		return false;	}	initializeFromProjector();	// Deprecated options	m_iVoxelSuperSampling = (int)_cfg.self.getOptionNumerical("VoxelSuperSampling", m_iVoxelSuperSampling);	m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", m_iGPUIndex);	m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUIndex", m_iGPUIndex);	CC.markOptionParsed("VoxelSuperSampling");	CC.markOptionParsed("GPUIndex");	if (!_cfg.self.hasOption("GPUIndex"))		CC.markOptionParsed("GPUindex");		// filter	if (_cfg.self.hasOption("FilterSinogramId")){		m_iFilterDataId = (int)_cfg.self.getOptionInt("FilterSinogramId");		const CFloat32ProjectionData2D * pFilterData = dynamic_cast<CFloat32ProjectionData2D*>(CData2DManager::getSingleton().get(m_iFilterDataId));		if (!pFilterData){			ASTRA_ERROR("Incorrect FilterSinogramId");			return false;		}		const CProjectionGeometry3D* projgeom = m_pSinogram->getGeometry();		const CProjectionGeometry2D* filtgeom = pFilterData->getGeometry();		int iPaddedDetCount = calcNextPowerOfTwo(2 * projgeom->getDetectorColCount());		int iHalfFFTSize = calcFFTFourierSize(iPaddedDetCount);		if(filtgeom->getDetectorCount()!=iHalfFFTSize || filtgeom->getProjectionAngleCount()!=projgeom->getProjectionCount()){			ASTRA_ERROR("Filter size does not match required size (%i angles, %i detectors)",projgeom->getProjectionCount(),iHalfFFTSize);			return false;		}	}else	{		m_iFilterDataId = -1;	}	CC.markOptionParsed("FilterSinogramId");	m_bShortScan = _cfg.self.getOptionBool("ShortScan", false);	CC.markOptionParsed("ShortScan");	// success	m_bIsInitialized = _check();	return m_bIsInitialized;}
开发者ID:astra-toolbox,项目名称:astra-toolbox,代码行数:59,


示例22: dis_bpcc

static int dis_bpcc(uint32_t *pc, uint32_t inst){	char *bpcc[0x10] = {		"bpn",	 "bpe",  "bple",  "bpl",		"bpleu", "bpcs", "bpneg", "bpvs"		"bpa",   "bpne", "bpg",   "bpge",		"bpgu",  "bpcc", "bppos", "bpvc"	};	if ((CC(inst) != 0) && (CC(inst) != 2)) {		ILLEGAL;	}	(void)printf("%p:/t%s%s%s/t%s,0x%lx/n", (void *)pc,	       bpcc[COND(inst)],	       A(inst) ? ",a" : "",	       PT(inst) ? ",pt" : ",pn",	       CC(inst) ? "%xcc" : "%icc",	       DISP19(inst) + (int64_t)pc);	return DELAY;}
开发者ID:PrincetonUniversity,项目名称:piton-sw,代码行数:19,


示例23: ASTRA_ASSERT

//---------------------------------------------------------------------------------------// Initialize - Configbool CCudaForwardProjectionAlgorithm::initialize(const Config& _cfg){	ASTRA_ASSERT(_cfg.self);	ConfigStackCheck<CAlgorithm> CC("CudaForwardProjectionAlgorithm", this, _cfg);	// Projector	XMLNode node = _cfg.self.getSingleNode("ProjectorId");	CCudaProjector2D* pCudaProjector = 0;	if (node) {		int id = boost::lexical_cast<int>(node.getContent());		CProjector2D *projector = CProjector2DManager::getSingleton().get(id);		pCudaProjector = dynamic_cast<CCudaProjector2D*>(projector);		if (!pCudaProjector) {			ASTRA_WARN("non-CUDA Projector2D passed to FP_CUDA");		}	}	CC.markNodeParsed("ProjectorId");		// sinogram data	node = _cfg.self.getSingleNode("ProjectionDataId");	ASTRA_CONFIG_CHECK(node, "FP_CUDA", "No ProjectionDataId tag specified.");	int id = boost::lexical_cast<int>(node.getContent());	m_pSinogram = dynamic_cast<CFloat32ProjectionData2D*>(CData2DManager::getSingleton().get(id));	CC.markNodeParsed("ProjectionDataId");	// volume data	node = _cfg.self.getSingleNode("VolumeDataId");	ASTRA_CONFIG_CHECK(node, "FP_CUDA", "No VolumeDataId tag specified.");	id = boost::lexical_cast<int>(node.getContent());	m_pVolume = dynamic_cast<CFloat32VolumeData2D*>(CData2DManager::getSingleton().get(id));	CC.markNodeParsed("VolumeDataId");	// GPU number	m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUindex", -1);	m_iGPUIndex = (int)_cfg.self.getOptionNumerical("GPUIndex", m_iGPUIndex);	CC.markOptionParsed("GPUindex");	if (!_cfg.self.hasOption("GPUindex"))		CC.markOptionParsed("GPUIndex");	// Detector supersampling factor	m_iDetectorSuperSampling = 1;	if (pCudaProjector) {		// New interface		m_iDetectorSuperSampling = pCudaProjector->getDetectorSuperSampling();	}	// Deprecated option	m_iDetectorSuperSampling = (int)_cfg.self.getOptionNumerical("DetectorSuperSampling", m_iDetectorSuperSampling);	CC.markOptionParsed("DetectorSuperSampling");	// return success	return check();}
开发者ID:malenie,项目名称:astra-toolbox,代码行数:57,


示例24: ASTRA_ASSERT

//---------------------------------------------------------------------------------------// Initialize - Configbool CParallelProjectionGeometry2D::initialize(const Config& _cfg){	ASTRA_ASSERT(_cfg.self);	ConfigStackCheck<CProjectionGeometry2D> CC("ParallelProjectionGeometry2D", this, _cfg);		// initialization of parent class	CProjectionGeometry2D::initialize(_cfg);	// success	m_bInitialized = _check();	return m_bInitialized;}
开发者ID:AnderBiguri,项目名称:astra-toolbox,代码行数:15,


示例25: KSPGMRESUpdateHessenberg

static PetscErrorCode KSPGMRESUpdateHessenberg(KSP ksp,PetscInt it,PetscBool hapend,PetscReal *res){  PetscScalar *hh,*cc,*ss,tt;  PetscInt    j;  KSP_GMRES   *gmres = (KSP_GMRES*)(ksp->data);  PetscFunctionBegin;  hh = HH(0,it);  cc = CC(0);  ss = SS(0);  /* Apply all the previously computed plane rotations to the new column     of the Hessenberg matrix */  for (j=1; j<=it; j++) {    tt  = *hh;    *hh = PetscConj(*cc) * tt + *ss * *(hh+1);    hh++;    *hh = *cc++ * *hh - (*ss++ * tt);  }  /*    compute the new plane rotation, and apply it to:     1) the right-hand-side of the Hessenberg system     2) the new column of the Hessenberg matrix    thus obtaining the updated value of the residual  */  if (!hapend) {    tt = PetscSqrtScalar(PetscConj(*hh) * *hh + PetscConj(*(hh+1)) * *(hh+1));    if (tt == 0.0) {      ksp->reason = KSP_DIVERGED_NULL;      PetscFunctionReturn(0);    }    *cc        = *hh / tt;    *ss        = *(hh+1) / tt;    *GRS(it+1) = -(*ss * *GRS(it));    *GRS(it)   = PetscConj(*cc) * *GRS(it);    *hh        = PetscConj(*cc) * *hh + *ss * *(hh+1);    *res       = PetscAbsScalar(*GRS(it+1));  } else {    /* happy breakdown: HH(it+1, it) = 0, therfore we don't need to apply            another rotation matrix (so RH doesn't change).  The new residual is            always the new sine term times the residual from last time (GRS(it)),            but now the new sine rotation would be zero...so the residual should            be zero...so we will multiply "zero" by the last residual.  This might            not be exactly what we want to do here -could just return "zero". */    *res = 0.0;  }  PetscFunctionReturn(0);}
开发者ID:feelpp,项目名称:debian-petsc,代码行数:50,


示例26: CC

void Tests::ProcessArgument(std::vector<std::string> &args){#define CC(a, n) if (args.size() != n + 1) { std::cout<<"Error: "<<a<<" expects "<<n<<" params"<<std::endl; return; }    std::string arg = args[0];    if (arg == "help")    {        CC("help", 0)        PrintHelp();    }    else if (arg == "i")    {        CC("i", 1)        inputFilename = args[1];    }    else if (arg == "ct")    {        CC("ct", 1)        complexType = static_cast<ComplexType>(atoi(args[1].c_str()));    }    else if (arg == "rt")    {        CC("rt", 1)        reductionType = static_cast<ReductionType>(atoi(args[1].c_str()));    }    else if (arg == "h")    {        CC("h", 1)        hapProgramFilename = args[1];    }    else    {        std::cout<<"Unknown argument: "<<arg<<std::endl;    }#undef CC}
开发者ID:pbrendel,项目名称:FundGroup,代码行数:37,


示例27: ASTRA_ASSERT

//---------------------------------------------------------------------------------------// Initialize - Configbool CArtAlgorithm::initialize(const Config& _cfg){	ASTRA_ASSERT(_cfg.self);	ConfigStackCheck<CAlgorithm> CC("ArtAlgorithm", this, _cfg);	// if already initialized, clear first	if (m_bIsInitialized) {		clear();	}		// initialization of parent class	if (!CReconstructionAlgorithm2D::initialize(_cfg)) {		return false;	}	// ray order	string projOrder = _cfg.self.getOption("RayOrder", "sequential");	CC.markOptionParsed("RayOrder");	m_iCurrentRay = 0;	m_iRayCount = m_pProjector->getProjectionGeometry()->getProjectionAngleCount() * 		m_pProjector->getProjectionGeometry()->getDetectorCount();	if (projOrder == "sequential") {		m_piProjectionOrder = new int[m_iRayCount];		m_piDetectorOrder = new int[m_iRayCount];		for (int i = 0; i < m_iRayCount; i++) {			m_piProjectionOrder[i] = (int)floor((float)i / m_pProjector->getProjectionGeometry()->getDetectorCount());			m_piDetectorOrder[i] = i % m_pProjector->getProjectionGeometry()->getDetectorCount();		}	} else if (projOrder == "custom") {		vector<float32> rayOrderList = _cfg.self.getOptionNumericalArray("RayOrderList");		m_iRayCount = rayOrderList.size() / 2;		m_piProjectionOrder = new int[m_iRayCount];		m_piDetectorOrder = new int[m_iRayCount];		for (int i = 0; i < m_iRayCount; i++) {			m_piProjectionOrder[i] = static_cast<int>(rayOrderList[2*i]);			m_piDetectorOrder[i] = static_cast<int>(rayOrderList[2*i+1]);		}		CC.markOptionParsed("RayOrderList");	} else {		return false;	}	m_fLambda = _cfg.self.getOptionNumerical("Lambda", 1.0f);	CC.markOptionParsed("Lambda");	// success	m_bIsInitialized = _check();	return m_bIsInitialized;}
开发者ID:iceseismic,项目名称:astra-toolbox,代码行数:51,


示例28: ASTRA_ASSERT

//---------------------------------------------------------------------------------------// Initialize - Configbool CCudaBackProjectionAlgorithm::initialize(const Config& _cfg){	ASTRA_ASSERT(_cfg.self);	ConfigStackCheck<CAlgorithm> CC("CudaBackProjectionAlgorithm", this, _cfg);	m_bIsInitialized = CCudaReconstructionAlgorithm2D::initialize(_cfg);	if (!m_bIsInitialized)		return false;	m_pAlgo = new BPalgo();	m_bAlgoInit = false;	return true;}
开发者ID:alex002,项目名称:astra-toolbox,代码行数:17,



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


C++ CC4函数代码示例
C++ CBrush函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。