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

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

51自学网 2021-06-03 08:54:54
  C++
这篇教程C++ toc函数代码示例写得很实用,希望能帮到您。

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

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

示例1: toc

Real LC::InitCavityDists( const std::string &name, const PropertySet &opts ) {    double tic = toc();    if( props.verbose >= 1 ) {        cerr << this->name() << "::InitCavityDists:  ";        if( props.cavity == Properties::CavityType::UNIFORM )            cerr << "Using uniform initial cavity distributions" << endl;        else if( props.cavity == Properties::CavityType::FULL )            cerr << "Using full " << name << opts << "...";        else if( props.cavity == Properties::CavityType::PAIR )            cerr << "Using pairwise " << name << opts << "...";        else if( props.cavity == Properties::CavityType::PAIR2 )            cerr << "Using pairwise(new) " << name << opts << "...";    }    Real maxdiff = 0.0;    for( size_t i = 0; i < nrVars(); i++ ) {        Real md = CalcCavityDist(i, name, opts);        if( md > maxdiff )            maxdiff = md;    }    if( props.verbose >= 1 ) {        cerr << this->name() << "::InitCavityDists used " << toc() - tic << " seconds." << endl;    }    return maxdiff;}
开发者ID:afbarnard,项目名称:libdai,代码行数:28,


示例2: name

void CompressInterface::execute() {	if( _verbose >= 1 ) {		cout << "Called " << name() << " execute method...";	}	if (_verbose >= 3) {		cout << endl;	}	double tic = toc();	init();	while(!hasConverged()) {		iterate();		_iters++;		if( _verbose >= 3 ) {			cout << name() << "::execute:  #varClusters " << _varClustering.size() << ", #facClusters " << _facClustering.size() << " after " << _iters << " passes (" << toc() - tic << " secs.)" <<  endl;		}	}	if( _verbose >= 1 ) {		cout << "Finished in " << _iters << " iterations (" << toc() - tic << " secs.)" << endl;	}}
开发者ID:fhadiji,项目名称:liftandrelax,代码行数:26,


示例3: main

int main(int argc, char *argv[]){   double         clock;   struct buffer  buf;   char          *pattern = NULL;   char          *infile  = NULL;   char          *outdir = strdup(".");   parse_commandline(argc, argv, &pattern, &infile, &outdir);   if(infile == NULL)      return EXIT_FAILURE;   MPI_Init(&argc, &argv);   tic(&clock);   load_file(infile, &buf);   toc(&clock, "Read input:");   transfer_partials(pattern, &buf);   toc(&clock, "Transfer:");   write_chunks(infile, outdir, &buf);   toc(&clock, "Write chunks:");   MPI_Finalize();   free(buf.data);   free(pattern);   free(infile);   return EXIT_SUCCESS;}
开发者ID:eduffy,项目名称:divvy,代码行数:31,


示例4: demo2

/* solve a linear system using Cholesky, LU, and QR, with various orderings */cs_long_t demo2 (problem *Prob){    cs_cl *A, *C ;    cs_complex_t *b, *x, *resid ;    double t, tol ;    cs_long_t k, m, n, ok, order, nb, ns, *r, *s, *rr, sprank ;    cs_cld *D ;    if (!Prob) return (0) ;    A = Prob->A ; C = Prob->C ; b = Prob->b ; x = Prob->x ; resid = Prob->resid;    m = A->m ; n = A->n ;    tol = Prob->sym ? 0.001 : 1 ;               /* partial pivoting tolerance */    D = cs_cl_dmperm (C, 1) ;                      /* randomized dmperm analysis */    if (!D) return (0) ;    nb = D->nb ; r = D->r ; s = D->s ; rr = D->rr ;    sprank = rr [3] ;    for (ns = 0, k = 0 ; k < nb ; k++)    {        ns += ((r [k+1] == r [k]+1) && (s [k+1] == s [k]+1)) ;    }    printf ("blocks: %g singletons: %g structural rank: %g/n",        (double) nb, (double) ns, (double) sprank) ;    cs_cl_dfree (D) ;    for (order = 0 ; order <= 3 ; order += 3)   /* natural and amd(A'*A) */    {        if (!order && m > 1000) continue ;        printf ("QR   ") ;        print_order (order) ;        rhs (x, b, m) ;                         /* compute right-hand side */        t = tic () ;        ok = cs_cl_qrsol (order, C, x) ;           /* min norm(Ax-b) with QR */        printf ("time: %8.2f ", toc (t)) ;        print_resid (ok, C, x, b, resid) ;      /* print residual */    }    if (m != n || sprank < n) return (1) ;      /* return if rect. or singular*/    for (order = 0 ; order <= 3 ; order++)      /* try all orderings */    {        if (!order && m > 1000) continue ;        printf ("LU   ") ;        print_order (order) ;        rhs (x, b, m) ;                         /* compute right-hand side */        t = tic () ;        ok = cs_cl_lusol (order, C, x, tol) ;      /* solve Ax=b with LU */        printf ("time: %8.2f ", toc (t)) ;        print_resid (ok, C, x, b, resid) ;      /* print residual */    }    if (!Prob->sym) return (1) ;    for (order = 0 ; order <= 1 ; order++)      /* natural and amd(A+A') */    {        if (!order && m > 1000) continue ;        printf ("Chol ") ;        print_order (order) ;        rhs (x, b, m) ;                         /* compute right-hand side */        t = tic () ;        ok = cs_cl_cholsol (order, C, x) ;         /* solve Ax=b with Cholesky */        printf ("time: %8.2f ", toc (t)) ;        print_resid (ok, C, x, b, resid) ;      /* print residual */    }    return (1) ;} 
开发者ID:GHilmarG,项目名称:Ua,代码行数:60,


示例5: choleskyPartial

/* ************************************************************************* */bool choleskyPartial(Matrix& ABC, size_t nFrontal) {  const bool debug = ISDEBUG("choleskyPartial");  assert(ABC.rows() == ABC.cols());  assert(ABC.rows() >= 0 && nFrontal <= size_t(ABC.rows()));  const size_t n = ABC.rows();  // Compute Cholesky factorization of A, overwrites A.  tic(1, "lld");	Eigen::LLT<Matrix, Eigen::Upper> llt = ABC.block(0,0,nFrontal,nFrontal).selfadjointView<Eigen::Upper>().llt();  ABC.block(0,0,nFrontal,nFrontal).triangularView<Eigen::Upper>() = llt.matrixU();  toc(1, "lld");  if(debug) cout << "R:/n" << Eigen::MatrixXd(ABC.topLeftCorner(nFrontal,nFrontal).triangularView<Eigen::Upper>()) << endl;  // Compute S = inv(R') * B  tic(2, "compute S");  if(n - nFrontal > 0) {    ABC.topLeftCorner(nFrontal,nFrontal).triangularView<Eigen::Upper>().transpose().solveInPlace(        ABC.topRightCorner(nFrontal, n-nFrontal));  }  if(debug) cout << "S:/n" << ABC.topRightCorner(nFrontal, n-nFrontal) << endl;  toc(2, "compute S");  // Compute L = C - S' * S  tic(3, "compute L");  if(debug) cout << "C:/n" << Eigen::MatrixXd(ABC.bottomRightCorner(n-nFrontal,n-nFrontal).selfadjointView<Eigen::Upper>()) << endl;  if(n - nFrontal > 0)    ABC.bottomRightCorner(n-nFrontal,n-nFrontal).selfadjointView<Eigen::Upper>().rankUpdate(        ABC.topRightCorner(nFrontal, n-nFrontal).transpose(), -1.0);  if(debug) cout << "L:/n" << Eigen::MatrixXd(ABC.bottomRightCorner(n-nFrontal,n-nFrontal).selfadjointView<Eigen::Upper>()) << endl;  toc(3, "compute L");	// Check last diagonal element - Eigen does not check it	bool ok;	if(llt.info() == Eigen::Success) {		if(nFrontal >= 2) {			int exp2, exp1;			(void)frexp(ABC(nFrontal-2, nFrontal-2), &exp2);			(void)frexp(ABC(nFrontal-1, nFrontal-1), &exp1);			ok = (exp2 - exp1 < underconstrainedExponentDifference);		} else if(nFrontal == 1) {			int exp1;			(void)frexp(ABC(0,0), &exp1);			ok = (exp1 > -underconstrainedExponentDifference);		} else {			ok = true;		}	} else {		ok = false;	}	return ok;}
开发者ID:gburachas,项目名称:gtsam_pcl,代码行数:57,


示例6: CG

/* metoda CG */void CG(double * b, double a, double * x, unsigned int n) {	double * r, * p, * w, ro1, ro2, beta, alfa;	int i, iterations;	r = malloc(sizeof(double)*n);	p = malloc(sizeof(double)*n);	w = malloc(sizeof(double)*n);	bzero(x, sizeof(double)*n);		tic();	r[0] = b[0] + a*x[0] - x[1];	for ( i = 1; i < n - 1; ++i )		r[i] = b[i] + a*x[i] - x[i+1] - x[i-1];	r[n-1] = b[n-1] + a*x[n-1] - x[n-2];	ro1 = 0;	for ( i = 0; i < n; ++i )		ro1 += r[i]*r[i];	beta = 0;	iterations = 0;	while ( ++iterations ) {		for ( i = 0; i < n; ++i )			p[i] = r[i] + beta*p[i];		w[0] = a*p[0] - p[1];		for ( i = 1; i < n - 1; ++i )			w[i] = a*p[i] - p[i+1] - p[i-1];		w[n-1] = a*p[n-1] - p[n-2];		alfa = 0;		for ( i = 0; i < n; ++i )			alfa += p[i]*w[i];		alfa = ro1 / alfa;		for ( i = 0; i < n; ++i )			x[i] = x[i] + alfa*p[i];		for ( i = 0; i < n; ++i )			r[i] = r[i] - alfa*w[i];		ro2 = 0;		for ( i = 0; i < n; ++i )			ro2 += r[i]*r[i];		if ( ro1 <= EPSILON2 ) { 			printf("/n| residuum | < epsilon = %e!/n", EPSILON2);			STOP(a, x, b, n, iterations, toc(), 1);			break; /* gdy wyniki bardzo dokladne, jest dzielenie przez 0 */		}		beta = ro2 / ro1;		ro1 = ro2;				if ( STOP(a, x, b, n, iterations, toc(), 0) )			break;	}	free(r);	free(p);	free(w);}
开发者ID:truszkowski,项目名称:studies,代码行数:55,


示例7: Jacobi

void Jacobi(double * b, double a, double * x, unsigned int n) {/* x(k+1) = M N x(k) - M b */	double lambda = ( a + 2.0*cos(PI / (((double) n)+1.0)) );	double px, tx;	double eta = ( a - lambda );	unsigned int i;	int iterations = 0;	bzero( x, sizeof(double)*n );	tic(); 	while ( ++iterations ) {		px = x[0];		x[0] = -( eta*x[0] - x[1] - b[0] ) / lambda;		for ( i = 1; i < n - 1; ++i )	{			tx = x[i];			x[i] = -( eta*tx - px - x[i+1] - b[i] ) / lambda;			px = tx;		}		x[n-1] = -( eta*x[n-1] - px - b[n-1] ) / lambda;		if ( STOP(a, x, b, n, iterations, toc(), 0) )			break;	}}
开发者ID:truszkowski,项目名称:studies,代码行数:25,


示例8: PNStream_SetDataCallback

ulong PNStream_SetDataCallback(ulong p1,ulong p2,ulong p3,ulong p4) {    ulong result;    int i=0;    void **pp;    fprintf(stderr, "PNStream_SetDataCallback(ulong p1=0x%0x(%d), ", p1, p1);    fprintf(stderr, "ulong p2=0x%0x(%d),/n/t", p2, p2);    fprintf(stderr, "ulong p3=0x%0x(%d),", p3, p3);    fprintf(stderr, "ulong p4=0x%0x(%d))/n", p4, p4);    hexdump((void*)p1, 0x24);    hexdump((void*)p2, 32);    hexdump((void*)p3, 4);    hexdump((void*)p4, 32);    fprintf(stderr, "content of the callback functions:/n/n");    while(i<8) {        hexdump(*((void**)p2+i), (i==0)?32*4:16);        i++;    }    i=0;    pp=(*(void***)p2);    fprintf(stderr, "content of the callback functions (first entry):/n/n");    while(i<15) {        hexdump(*((void**)pp+i), 32);        i++;    }    tic();    result=(*pnsSetDataCallback)(p1,p2,p3,p4);    toc();    hexdump((void*)p1, 0x24);//	hexdump((void*)p2, 256);//	hexdump((void*)p3, 4);    hexdump(*((void**)p3), 256);    fprintf(stderr, "PNStream_SetDataCallback --> 0x%0x(%d)/n/n/n", result, result);    return result;}
开发者ID:OpenSageTV,项目名称:mplayer-sage9orig,代码行数:35,


示例9: toc

float Timer::toc(std::string const &msg){    float duration_one = toc();    printf("%s  %.2f/n", msg.c_str(), duration_one);    fflush(stdout);    return duration_one;}
开发者ID:lming08,项目名称:libmf,代码行数:7,


示例10: SERVICE_fwd

void SERVICE_fwd(float* in, int in_size, float* out, int out_size,                 Net<float>* net) {  string net_name = net->name();  STATS_INIT("service", "DjiNN service inference");  PRINT_STAT_STRING("network", net_name.c_str());  if (Caffe::mode() == Caffe::CPU)    PRINT_STAT_STRING("platform", "cpu");  else    PRINT_STAT_STRING("platform", "gpu");  float loss;  vector<Blob<float>*> in_blobs = net->input_blobs();  tic();  in_blobs[0]->set_cpu_data(in);  vector<Blob<float>*> out_blobs = net->ForwardPrefilled(&loss);  memcpy(out, out_blobs[0]->cpu_data(), sizeof(float));  PRINT_STAT_DOUBLE("inference latency", toc());  STATS_END();  if (out_size != out_blobs[0]->count())    LOG(FATAL) << "out_size =! out_blobs[0]->count())";  else    memcpy(out, out_blobs[0]->cpu_data(), out_size * sizeof(float));}
开发者ID:Averroes,项目名称:djinn,代码行数:28,


示例11: generateEdgeList

EdgeList generateEdgeList(int argc, char** argv, packed_edge** output){    int log_numverts;    int64_t nedges;    packed_edge* result;    log_numverts = 16; /* In base 2 */    if (argc >= 2) log_numverts = atoi(argv[1]);    make_graph(log_numverts, INT64_C(16) << log_numverts, 1, 2, &nedges, &result);    printf("nedges=%ld before/n",nedges);    //remove loops:#if rmdup    tic();    packed_edge* end=thrust::remove_if(result, result+nedges, is_loop());    //sort packed_edge twice:    thrust::sort(result,end,pe_less1());    thrust::sort(result,end,pe_less2());    //nedges=(end-result);    //printf("nedges=%d after loop/n",nedges);    //remove duplicates:    end=thrust::unique(result,end);    cudaDeviceSynchronize();    elapsed_time+=toc();    printf("remove dup took %f ms/n", elapsed_time);    //TEMP: reset elapsed time:    elapsed_time=0;    nedges=(end-result);    printf("nedges=%ld after dup/n",nedges);    //#endif    uusi::EdgeList el=graph500ToEdgeList((const packed_edge*)result,nedges);    *output=result;    return el;}
开发者ID:peteraldaron,项目名称:BunchOfRandomCode,代码行数:32,


示例12: tic

intPreconditionerBlockMS<space_type>::applyInverse ( const vector_type& X, vector_type& Y ) const{    tic();    U = X;    U.close();    *M_uin = U.template element<0>();    M_uin->close();    *M_pin = U.template element<1>();    M_pin->close();    // Solve eq (12)    // solve here eq 15 : Pm v = c    backend(_name=M_prefix_11)->solve(_matrix=M_11,                                      _rhs=M_uin,                                      _solution=M_uout                                     ) ;    M_uout->close();    // solve here eq 16    backend(_name=M_prefix_22)->solve(_matrix=M_L,                                      _rhs=M_pin,                                      _solution=M_pout                                     );    M_pout->close();    U.template element<0>() = *M_uout;    U.template element<1>() = *M_pout;    U.close();    Y=U;    Y.close();    toc("[PreconditionerBlockMS] applyInverse update solution",FLAGS_v>0);    return 0;}
开发者ID:MarieHouillon,项目名称:feelpp,代码行数:34,


示例13: main

/// Program entryint main( int argc, char* argv[] ){    // Config    using real = double;    const real p1 = 1.1;    const real p2 = 1.2;    const real p3 = 1.3;    const double warming_time = 1.;    const double run_time     = 10.;    const std::size_t min_run = 3;    // Command-line parameters    const std::size_t dimension = std::stoull(argv[1]);    const std::size_t nsample1  = std::stoull(argv[2]);    const std::size_t nsample2  = std::stoull(argv[3]);    // Kernel initialization    Kernel<real> kernel(dimension, nsample1, nsample2);    kernel.init(p1, p2, p3);    // Runs    std::size_t nrun = 0;    bool is_warming = true;    double total_duration = 0;    tic();    while ( true )    {        kernel.run();        total_duration = toc();        // Managing warming and run time        if (is_warming && total_duration >= warming_time)        {            is_warming = false;            tic();        }        else if (! is_warming)        {            ++nrun;                        // Ending benchmark            if ( total_duration >= run_time && nrun >= min_run )                break;        }    }    // Checksum    const double checksum = kernel.checksum();    // Mean duration    const double duration = total_duration / nrun;    // Displaying results    std::cout << std::fixed;    std::cout << duration << " " << checksum << std::endl;    return 0;}
开发者ID:rolanddenis,项目名称:BenchmarksPythonJuliaAndCo,代码行数:61,


示例14: identify

Real LC::run() {    if( props.verbose >= 1 )        cerr << "Starting " << identify() << "...";    if( props.verbose >= 2 )        cerr << endl;    double tic = toc();    Real md = InitCavityDists( props.cavainame, props.cavaiopts );    if( md > _maxdiff )        _maxdiff = md;    for( size_t i = 0; i < nrVars(); i++ ) {        _pancakes[i] = _cavitydists[i];        foreach( const Neighbor &I, nbV(i) ) {            _pancakes[i] *= factor(I);            if( props.updates == Properties::UpdateType::SEQRND )              _pancakes[i] *= _phis[i][I.iter];        }        _pancakes[i].normalize();        CalcBelief(i);    }
开发者ID:afbarnard,项目名称:libdai,代码行数:25,


示例15: measureDuration

 double measureDuration(unsigned long iterations,                        void (*fp)(unsigned long)) {     tic();     fp(iterations);     toc();     return getElapsedTime(); }
开发者ID:jkatghub,项目名称:tud-cpp-lecture,代码行数:7,


示例16: toc

void Timer::stop() {  elapsed_ += toc(id_);  elapsed_ -= paused_;  paused_ = 0;  int i = (iterations_ + 1) % (interval_ + 1);  if(i == 0) restart();  else iterations_ = i;}
开发者ID:SiChiTong,项目名称:robotics,代码行数:8,


示例17: main_speedtestvector

int main_speedtestvector() {	std::cout << "Main has started!" << std::endl;	tic();	std::vector<double> v1;	v1 = fillVec1();	toc();	tic();	std::vector<double> v2(SIZE);	std::vector<double> v3 = fillVec2(v2);	toc();	std::cout << "Main has finished!" << std::endl;	return 0;}
开发者ID:ricleal,项目名称:CppTests,代码行数:17,


示例18: LOG

voidPreconditionerBlockMS<space_type>::init( void ){    if( Environment::worldComm().isMasterRank() )        std::cout << "Init preconditioner blockms/n";    LOG(INFO) << "Init .../n";    tic();    BoundaryConditions M_bc = M_model.boundaryConditions();    LOG(INFO) << "Create sub Matrix/n";    map_vector_field<FEELPP_DIM,1,2> m_dirichlet_u { M_bc.getVectorFields<FEELPP_DIM> ( "u", "Dirichlet" ) };    map_scalar_field<2> m_dirichlet_p { M_bc.getScalarFields<2> ( "phi", "Dirichlet" ) };    /*     * AA = [[ A - k^2 M, B^t],     *      [ B        , 0  ]]     * We need to extract A-k^2 M and add it M to form A+(1-k^2) M = A+g M     */    // Is the zero() necessary ?    M_11->zero();    this->matrix()->updateSubMatrix(M_11, M_Vh_indices, M_Vh_indices, false); // M_11 = A-k^2 M    LOG(INFO) << "Use relax = " << M_relax << std::endl;    M_11->addMatrix(M_relax,M_mass);                            // A-k^2 M + M_relax*M = A+(M_relax-k^2) M    auto f2A = form2(_test=M_Vh, _trial=M_Vh,_matrix=M_11);    auto f1A = form1(_test=M_Vh);    for(auto const & it : m_dirichlet_u )        f2A += on(_range=markedfaces(M_Vh->mesh(),it.first), _expr=it.second,_rhs=f1A, _element=u, _type="elimination_symmetric");    /*      * Rebuilding sub-backend     */    backend(_name=M_prefix_11, _rebuild=true);    backend(_name=M_prefix_22, _rebuild=true);    // We have to set the G, Px,Py,Pz or X,Y,Z matrices to AMS    if(soption(_name="pc-type", _prefix=M_prefix_11) == "ams")    {#if FEELPP_DIM == 3    initAMS();    {        if(boption(_name="setAlphaBeta",_prefix=M_prefix_11))        {            auto prec = preconditioner(_pc=pcTypeConvertStrToEnum(soption(M_prefix_11+".pc-type")),                                       _backend=backend(_name=M_prefix_11),                                       _prefix=M_prefix_11,                                       _matrix=M_11                                      );            prec->setMatrix(M_11);            prec->attachAuxiliarySparseMatrix("a_alpha",M_a_alpha);            prec->attachAuxiliarySparseMatrix("a_beta",M_a_beta);        }    }#else    std::cerr << "ams preconditioner is not interfaced in two dimensions/n";#endif    }    toc("[PreconditionerBlockMS] Init",FLAGS_v>0);    LOG(INFO) << "Init done/n";}
开发者ID:MarieHouillon,项目名称:feelpp,代码行数:58,


示例19: main

int main(void) {	/*Matrix& A0 = *new DenseMatrix(new double[4] {1, 2, 3, 4}, 4, 1);	disp(A0);	Matrix& A1 = reshape(A0, new int[2] {2, 2});	disp(A1);*/	int m = 8;	int r = m / 4;	Matrix& L = randn(m, r);	Matrix& R = randn(m, r);	Matrix& A_star = mtimes(L, R.transpose());	Matrix& E_star0 = zeros(size(A_star));	int* indices = randperm(m * m);	int nz = m * m / 20;	int* nz_indices = new int[nz];	for (int i = 0; i < nz; i++) {		nz_indices[i] = indices[i] - 1;	}	Matrix& E_vec = vec(E_star0);	Matrix& Temp = (minus(rand(nz, 1), 0.5).times(100));	// disp(Temp);	setSubMatrix(E_vec, nz_indices, nz, new int[1] {0}, 1, Temp);	// disp(E_vec);	Matrix& E_star = reshape(E_vec, size(E_star0));	// disp(E_star);	// Input	Matrix& D = A_star.plus(E_star);	double lambda = 1 * pow(m, -0.5);	RobustPCA& robustPCA = *new RobustPCA(lambda);	robustPCA.feedData(D);	tic();	robustPCA.run();	fprintf("Elapsed time: %.2f seconds./n", toc());	// Output	Matrix& A_hat = robustPCA.GetLowRankEstimation();	Matrix& E_hat = robustPCA.GetErrorMatrix();	fprintf("A*:/n");	disp(A_star, 4);	fprintf("A^:/n");	disp(A_hat, 4);	fprintf("E*:/n");	disp(E_star, 4);	fprintf("E^:/n");	disp(E_hat, 4);	fprintf("rank(A*): %d/n", rank(A_star));	fprintf("rank(A^): %d/n", rank(A_hat));	fprintf("||A* - A^||_F: %.4f/n", norm(A_star.minus(A_hat), "fro"));	fprintf("||E* - E^||_F: %.4f/n", norm(E_star.minus(E_hat), "fro"));	return EXIT_SUCCESS;}
开发者ID:Maple-Wang,项目名称:libLAML,代码行数:58,


示例20: RV20toYUV420_RN_FRU_Free

ulong RV20toYUV420_RN_FRU_Free(ulong p1) {	ulong result;	fprintf(stderr, "RV20toYUV420_RN_FRU_Free(ulong p1=0x%0x(%d))/n", p1, p1);	tic();	result=(*rvyuvRNFRUFree)(p1);	toc();	fprintf(stderr, "RV20toYUV420_RN_FRU_Free --> 0x%0x(%d)/n/n/n", result, result);	return result;}
开发者ID:BOTCrusher,项目名称:sagetv,代码行数:9,


示例21: cmd_nlls

void cmd_nlls(){  Real *work, *y, *bounds, *covar, *p;  int nQ = count_data();  int ndim = fit[0].pars.n;  int i;  /* Allocate storage: y, covar, bounds, p */  work = (Real *)malloc(sizeof(Real)*(nQ + ndim*ndim + 3*ndim));  assert(work != NULL);  y = work;  bounds = y + nQ;  covar = bounds + 2*ndim;  p = covar + ndim*ndim;  write_pop(&set); /* In case fit crashes */  /* Record what we are doing */  if (parFD != NULL) {    fprintf(parFD,"# %15d   Starting Levenberg-Marquardt/n", GetGen(&set));    fflush(parFD);   }  /* Copy normalized data values */  copy_normalized_data(y);  /* Set bounds */  for (i=0; i < ndim; i++) {    bounds[i] = 0.;    bounds[i+ndim] = 1.;  }  /* Get best into p */  pars_set(&fit[0].pars, bestpars);  pars_get01(&fit[0].pars, p);  /* Call nlls */  tic();#if 1  box_nlls(step_nlls, ndim, nQ, fit, y, bounds, p, covar);#else  nlls(step_nlls, ndim, nQ, fit, y, p, covar);#endif  printf("Done LM/n");fflush(stdout);  toc();  print_covar(ndim,covar);  /* Record LM results */  log_best();  /* Inject new p into the GA */  setChromosome(&set, 0, p);  /* Done */  free(work);}
开发者ID:reflectometry,项目名称:garefl,代码行数:57,


示例22: msm_vidc_debugfs_update

void msm_vidc_debugfs_update(struct msm_vidc_inst *inst,	enum msm_vidc_debugfs_event e){	struct msm_vidc_debug *d = &inst->debug;	char a[64] = "Frame processing";	switch (e) {	case MSM_VIDC_DEBUGFS_EVENT_ETB:		inst->count.etb++;		if (inst->count.ebd && inst->count.ftb > inst->count.fbd) {			d->pdata[FRAME_PROCESSING].name[0] = '/0';			tic(inst, FRAME_PROCESSING, a);		}	break;	case MSM_VIDC_DEBUGFS_EVENT_EBD:		inst->count.ebd++;		if (inst->count.ebd && inst->count.ebd == inst->count.etb) {			toc(inst, FRAME_PROCESSING);			dprintk(VIDC_PROF, "EBD: FW needs input buffers/n");		}		if (inst->count.ftb == inst->count.fbd)			dprintk(VIDC_PROF, "EBD: FW needs output buffers/n");	break;	case MSM_VIDC_DEBUGFS_EVENT_FTB: {		inst->count.ftb++;		if (inst->count.ebd && inst->count.etb > inst->count.ebd) {			d->pdata[FRAME_PROCESSING].name[0] = '/0';			tic(inst, FRAME_PROCESSING, a);		}	}	break;	case MSM_VIDC_DEBUGFS_EVENT_FBD:		inst->debug.samples++;		if (inst->count.ebd && inst->count.fbd == inst->count.ftb) {			toc(inst, FRAME_PROCESSING);			dprintk(VIDC_PROF, "FBD: FW needs output buffers/n");		}		if (inst->count.etb == inst->count.ebd)			dprintk(VIDC_PROF, "FBD: FW needs input buffers/n");		break;	default:		dprintk(VIDC_ERR, "Invalid state in debugfs: %d/n", e);		break;	}}
开发者ID:AbdulrahmanAmir,项目名称:Dorimanx-LG-G2-D802-Kernel,代码行数:44,


示例23: test1d

void test1d(int nfft,int isinverse){    char mensaje [128];    clock_t start;    clock_t end;        size_t buflen = sizeof(kiss_fft_cpx)*nfft;    kiss_fft_cpx  * in = (kiss_fft_cpx*)malloc(buflen);    kiss_fft_cpx  * out= (kiss_fft_cpx*)malloc(buflen);    kiss_fft_cfg  cfg = kiss_fft_alloc(nfft,0,0);    int k;    for (k=0;k<nfft;++k) {        in[k].r = (rand() % 32767) - 16384;        in[k].i = (rand() % 32767) - 16384;    }#ifdef DOUBLE_PRECISION    for (k=0;k<nfft;++k) {       in[k].r *= 32768;       in[k].i *= 32768;    }#endif        if (isinverse)    {       for (k=0;k<nfft;++k) {          in[k].r /= nfft;          in[k].i /= nfft;       }    }        /*for (k=0;k<nfft;++k) printf("%d %d ", in[k].r, in[k].i);printf("/n");*/    //start=TPM3CNT;   //tic    tic();        if (isinverse)       kiss_ifft(cfg,in,out);    else       kiss_fft(cfg,in,out);        toc();    //end =TPM3CNT;    //toc    /*for (k=0;k<nfft;++k) printf("%d %d ", out[k].r, out[k].i);printf("/n");*/        check(in,out,nfft,isinverse);    free(in);    free(out);    free(cfg);}
开发者ID:joseomar,项目名称:Proyectos_CCS-TI,代码行数:56,


示例24: PNStream_GetIPNUnknown

ulong PNStream_GetIPNUnknown(ulong p1) {    ulong result;    fprintf(stderr, "PNStream_GetIPNUnknown(ulong p1=0x%0x(%d))/n", p1, p1);//	hexdump((void*)p1, 44);    tic();    result=(*pnsGetIPNUnknown)(p1);    toc();//	hexdump((void*)p1, 44);    fprintf(stderr, "PNStream_GetIPNUnknown --> 0x%0x(%d)/n/n/n", result, result);    return result;}
开发者ID:OpenSageTV,项目名称:mplayer-sage9orig,代码行数:11,


示例25: PNCodec_Close

ulong PNCodec_Close(ulong p1) {    ulong result;    fprintf(stderr, "PNCodec_Close(PNCMain *pncMain=0x%0x(%d))/n", p1, p1);//	hexdump((void*)p1, 44);    tic();    result=(*pncClose)(p1);    toc();//	hexdump((void*)p1, 44);    fprintf(stderr, "PNCodec_Close --> 0x%0x(%d)/n/n/n", result, result);    return result;}
开发者ID:OpenSageTV,项目名称:mplayer-sage9orig,代码行数:11,


示例26: PNStream_Close

ulong PNStream_Close(ulong p1) {    ulong result;    fprintf(stderr, "PNStream_Close(ulong p1=0x%0x(%d))/n", p1, p1);//	hexdump((void*)p1, 44);    tic();    result=(*pnsClose)(p1);    toc();//	hexdump((void*)p1, 44);    fprintf(stderr, "PNStream_Close --> 0x%0x(%d)/n/n/n", result, result);    return result;}
开发者ID:OpenSageTV,项目名称:mplayer-sage9orig,代码行数:11,



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


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