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

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

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

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

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

示例1: loop_while_tasks

void Worker::        loop_while_tasks()  {    while (!QThread::currentThread ()->isInterruptionRequested ())      {        Task task;        {            DEBUGINFO TaskTimer tt(boost::format("worker: get task %s %s") % vartype(*schedule_.get ()) % (computing_engine_?vartype(*computing_engine_):"(null)") );            task = schedule_->getTask(computing_engine_);        }        if (task)          {            DEBUGINFO TaskTimer tt(boost::format("worker: running task %s") % task.expected_output());            task.run();            emit oneTaskDone();          }        else          {            DEBUGINFO TaskInfo("worker: back to sleep");            // Wait for a new wakeup call            break;          }      }  }
开发者ID:davidhesselbom,项目名称:freq,代码行数:26,


示例2: loop_while_tasks

void QtEventWorker::        loop_while_tasks()  {    // the only events sent to this thread are wakeup() or termination events,    // in order to not pile up a never ending queue make sure to process events as they come    while (!QCoreApplication::hasPendingEvents ())      {        Timer work_timer;        Signal::Processing::Task task;        {            DEBUGINFO TaskTimer tt(boost::format("worker: get task %s %s") % vartype(*schedule_.get ()) % (computing_engine_?vartype(*computing_engine_):"(null)") );            task = schedule_->getTask(computing_engine_);        }        if (task)          {            DEBUGINFO TaskTimer tt(boost::format("worker: running task %s") % task.expected_output());            task.run();            active_time_since_start_ += work_timer.elapsed ();            ltf_tasks_.tick ();            emit oneTaskDone();          }        else          {            DEBUGINFO Log("worker: back to sleep");            // Wait for a new wakeup call            break;          }        // run loop at least once to simplify testing when aborting a worker right away        if (QThread::currentThread ()->isInterruptionRequested ())            break;      }  }
开发者ID:aveminus,项目名称:freq,代码行数:35,


示例3: tt

Foam::tmp<Foam::DecoupledCoeffField<Type> >Foam::DecoupledCoeffField<Type>::transpose() const{    tmp<DecoupledCoeffField<Type> > tt    (        new DecoupledCoeffField<Type>(this->size())    );    DecoupledCoeffField<Type>& t = tt();    if (scalarCoeffPtr_)    {        t.toScalar() = *scalarCoeffPtr_;    }    else if (linearCoeffPtr_)    {        t.toLinear() = *linearCoeffPtr_;    }    else    {        // Not allocated - do nothing    }    return tt;}
开发者ID:Brzous,项目名称:WindFOAM,代码行数:25,


示例4: compute

void FftClFft::        compute( Tfr::ChunkData::Ptr input, Tfr::ChunkData::Ptr output, FftDirection direction ){    TIME_STFT TaskTimer tt("Fft ClFft");    unsigned n = input->getNumberOfElements().width;    unsigned N = output->getNumberOfElements().width;    if (-1 != direction)        EXCEPTION_ASSERT( n == N );    {        TIME_STFT TaskTimer tt("Computing fft(N=%u, n=%u, direction=%d)", N, n, direction);        OpenCLContext *opencl = &OpenCLContext::Singleton();        cl_int fft_error;        clFFT_Plan plan = CLFFTKernelBuffer::Singleton().getPlan(opencl->getContext(), n, fft_error);        if (fft_error != CL_SUCCESS)            throw std::runtime_error("Could not create clFFT compute plan.");        // Run the fft in OpenCL :)        // fft kernel needs to have read/write access to output data        fft_error |= clFFT_ExecuteInterleaved(                opencl->getCommandQueue(),                plan, 1, (clFFT_Direction)direction,                OpenClMemoryStorage::ReadOnly<1>( input ).ptr(),                OpenClMemoryStorage::ReadWrite<1>( output ).ptr(),                0, NULL, NULL );        if (fft_error != CL_SUCCESS)            throw std::runtime_error("Bad stuff happened during FFT computation.");    }}
开发者ID:aveminus,项目名称:freq,代码行数:33,


示例5: depth

Hajjar2D::Hajjar2D(	 int tag,                     YS_Evolution &model,					 double D, double b, double t,					 double fc_, double fy_):YieldSurface_BC2D(tag, HAJJAR_CLASS_TAG, 0, 0, model),//would blow up if not..					 depth(D), width(b), thick(t), fc(fc_), fy(fy_){double fr  = 0.623*sqrt(fc);double Ast = D*b - (D - 2*t)*(b - 2*t);double Ac  = (D - 2*t)*(b - 2*t);double x = D/t;double y = fc/fy;	c1 = 1.08 - 0.00265*x + 0.000023*x*x - 1.13*1e-7*x*x*x +		 0.374*y - 1.3*y*y - 0.0419*y*y*y - 0.0691*x*y +		 0.000234*x*x*y + 0.0754*x*y*y;	c2 = 0.628 + 0.0259*x - 0.000367*x*x + 1.99*1e-6*x*x*x +		 4.5*y - 14.9*y*y + 22.4*y*y*y + 0.164*x*y +		 -0.000756*x*x*y - 0.126*x*y*y;	c3 = 0.42 + 0.0892*x - 0.00122*x*x + 5.13*1e-6*x*x*x +		 4.9*y - 16.5*y*y + 16.2*y*y*y - 0.165*x*y +		 0.000713*x*x*y + 0.12*x*y*y;	capY = Ast*fy + Ac*fc;double num   = fc*(b*t - 2*t*t) + 0.5*fr*(D - t)*(b - 2*t) + fy*(2*D*t);double denom = fc*(b - 2*t) + 0.5*fr*(b - 2*t) + fy*(4*t);double xn = num/denom;	capX  = 	  fc*(0.5*(b - 2*t)*(xn - t)*(xn - t))				+ 0.5*fr*(0.5*(b - 2*t)*(D - xn - t)*(D - xn - t))				+ fy*((2*t)*(D*D/2 + xn*xn + t*t - D*t - D*xn) + (b*t)*(D - t));	centroidY = (Ac*fc - Ac*fr)/2;	centroidY = centroidY/capY;//!!	translateY = translateY_hist = centroidY;    Vector tt(2);	tt(0) = 0;	tt(1) = centroidY;	hModel->setInitTranslation(tt);	if (coefDebug)	{		opserr << " c1 = " << c1 << ", c2 = " << c2 << ", c3 = " << c3 << "/n";		opserr << " centroidY = " << centroidY << "/n";		opserr << " capX = " << capX << ", capY = " << capY << "/n";	}	// bad:	capX_orig = capX;	capY_orig = capY;	capXdim = capX;	capYdim = capY;}
开发者ID:DBorello,项目名称:OpenSees,代码行数:58,


示例6: maxneb_disc

int maxneb_disc () {	Rcpp::IntegerVector targs(targets);	Rcpp::IntegerVector nebs(neighbors);	Rcpp::IntegerVector plot(plots);	Rcpp::CharacterVector status(stat);	Rcpp::IntegerVector xx(bqudx);	Rcpp::IntegerVector yy(bqudy);	Rcpp::IntegerVector tt(time);	int rad = Rcpp::as<int>(sr);	Rcpp::IntegerVector counts(targs.size());	int max_neb = 0;	for (int i = 0, n = targs.size(); i < n; i++) {		int targ = index(targs[i], nebs);		int num_nebs= 0;		for (int neb = 0, n2 = nebs.size(); neb < n2; neb++) {			if (targ != neb && plot[targ] == plot[neb] &&				(std::strcmp("ALIVE", status[neb]) == 0) &&				(xx[targ] + sr > xx[neb]) && (xx[targ] - sr < xx[neb]) &&				(yy[targ] + sr > yy[neb]) && (yy[targ] - sr < yy[neb]) &&				tt[targ] == tt[neb])				num_nebs++;		}		counts[i] = num_nebs;	}	return std::max_element(counts.begin(), counts.end(), myfn);}
开发者ID:nverno,项目名称:allometry,代码行数:29,


示例7: ss

bool GeneralName::matches_dn(const std::string& nam) const   {   std::stringstream ss(nam);   std::stringstream tt(name());   X509_DN nam_dn, my_dn;   ss >> nam_dn;   tt >> my_dn;   auto attr = nam_dn.get_attributes();   bool ret = true;   int trys = 0;   for(const std::pair<OID,std::string>& c: my_dn.get_attributes())      {      auto i = attr.equal_range(c.first);      if(i.first != i.second)         {         trys += 1;         ret &= i.first->second == c.second;         }      }   return trys > 0 && ret;   }
开发者ID:Andrew-He,项目名称:botan,代码行数:26,


示例8: main

int main(int argc, const char * argv[]){    if (argc < 3) {        std::cout<<"Usage: "<<argv[0]<<"size decay_period input"<<std::endl;        return 1;    }    int size = atoi(argv[1]);    int decay = atoi(argv[2]);    std::ifstream infile(argv[3]);    tt_type tt(size);    specified_timesource ts(0.0);    int timestamp;    int conv_id;    int last_dump = 0;    while(infile >> timestamp >> conv_id) {        if (last_dump + decay < timestamp) {            last_dump = timestamp;            std::cout << "Dump "<<timestamp <<std::endl;            top_talkers_print<int, counter>(tt);        }        ts.set(timestamp);        counter dc(ts, 1.0, decay);        tt.update(conv_id, dc);    }    return 0;}
开发者ID:andrewguy9,项目名称:ngx_http_consistent_hash,代码行数:27,


示例9: add

		//-----------------------------------------------------------------//		void add(const void* src, bool bitmap = false) noexcept		{			if(size_ >= MAX) return;			if(bitmap) {				auto sz = rdr_.get_mobj_size(src);				obj_[size_].w_ = sz.x;				obj_[size_].h_ = sz.y;			} else {				auto sz = rdr_.at_font().get_text_size(static_cast<const char*>(src), false);				obj_[size_].w_ = sz.x;				obj_[size_].h_ = sz.y;			}			obj_[size_].src_ = src;			++size_;			vtx::spos tt(0);			for(auto i = 0; i < size_; ++i) {				auto xx = obj_[i].w_ + space_.x * 2;				if(tt.x < xx) tt.x = xx;				tt.y += obj_[i].h_;				tt.y += gap_;				tt.y += space_.y * 2;			}			m_ = tt;		}
开发者ID:hirakuni45,项目名称:RX,代码行数:27,


示例10: tr_instr_jump

BOOL tr_instr_jump(LmnTranslated   f,                   LmnReactCxt     *rc,                   LmnMembrane     *thisisrootmembutnotused,                   LmnRule         rule,                   int             newid_num,                   const int       *newid){  LmnRegister *v, *tmp;  unsigned int org_use, org_size;  BOOL ret;  int i;  org_use  = warry_use_size(rc);  org_size = warry_size(rc);  v = lmn_register_make(org_size);  for (i = 0; i < newid_num; i++){    v[i].wt = wt(rc, newid[i]);    v[i].at = at(rc, newid[i]);    v[i].tt = tt(rc, newid[i]);  }  tmp = rc_warry(rc);  rc_warry_set(rc, v);  ret = (*f)(rc, thisisrootmembutnotused, rule);  lmn_register_free(rc_warry(rc));  rc_warry_set(rc, tmp);  warry_size_set(rc, org_size);  warry_use_size_set(rc, org_use);  return ret;}
开发者ID:onmsr,项目名称:slim,代码行数:33,


示例11: timeTrans

STR timeTrans(int sec) {	time_t tt(sec);	struct tm* ptm = localtime(&tt);	char tmp[20];	sprintf(tmp, "%04d/%02d/%02d", 1900 + ptm->tm_year, 1 + ptm->tm_mon, ptm->tm_mday);	return STR(tmp);}
开发者ID:sadkangaroo,项目名称:2012.1ProgramDesignFinalProject,代码行数:7,


示例12: TRACE

BOOL CDialerChannel::PlayEnterVox(LPCTSTR xPhone, int nChan){	CString strQuery;		strQuery.Format( "select a.*"					" from xphonenum a inner join"					" xphonenum_info b on a.enterprise_bh = b.enterprise_bh"					" where department_phone = '%s'", xPhone );	TRACE( strQuery + "/n" );		_RecordsetPtr xRecordset;	xRecordset = xExecute(theApp.m_pConnection, (_bstr_t)strQuery, adCmdText);	if ( xRecordset->adoEOF ) return FALSE;		_variant_t TheValue = xRecordset->GetCollect( "xdate_finish" );	if ( VT_NULL == TheValue.vt ) return FALSE;		COleDateTime tt( TheValue );	tt.SetDateTime( tt.GetYear(), tt.GetMonth(), tt.GetDay(), 23, 59, 59 );	if ( COleDateTime::GetCurrentTime() > tt ) return FALSE;		TheValue = xRecordset->GetCollect( "xfalse" );	if ( VT_NULL == TheValue.vt ) return FALSE;	if ( _tcscmp((LPCTSTR)(_bstr_t)TheValue, "1") )return FALSE;		FieldPtr xPlyBlob = xRecordset->GetFields()->GetItem("xentervoice");	return PlayBlob( nChan, xPlyBlob, FALSE ) == TRUE;}
开发者ID:pics860,项目名称:callcenter,代码行数:28,


示例13: uniquePathsWithObstacles

 int uniquePathsWithObstacles(vector<vector<int> > &o) {     // Start typing your C/C++ solution below     // DO NOT write int main() function     int r=o.size();     if(r==0)     return 0;     int c=o[0].size();     vector<int> tt(c+1,0);     vector<vector<int> > w(r+1,tt);     for(int i=1;i<=r;i++)     {         for(int j=1;j<=c;j++)         {             if(o[i-1][j-1]==1)             continue;             if(i==1 && j==1)             {                 w[i][j]=1;                 continue;             }             w[i][j]=w[i-1][j]+w[i][j-1];         }     }     return w[r][c]; }
开发者ID:vetribalaji,项目名称:leetcode,代码行数:25,


示例14: atoi

void Tokenizer::timeChecker(sqlite3* db, FILE* fout) {	if (strstr(buffer, "get-time")) {		int sec = atoi(currentTime.c_str());		time_t tt(sec);		struct tm* ptm = localtime(&tt);		fprintf(fout, "get-time/tsuccessful/t%04d/%02d/%02d/n", 1900 + ptm->tm_year, 1 + ptm->tm_mon, ptm->tm_mday);	}	if (strstr(buffer, "set-time")) {		firstToken;		STR strtime(nextToken);		int year = atoi(strtime.substr(0, 4).c_str());		int month = atoi(strtime.substr(5, 2).c_str());		int day = atoi(strtime.substr(8, 2).c_str());		struct tm curtm;		curtm.tm_year = year - 1900;		curtm.tm_mon = month - 1;		curtm.tm_mday = day;		curtm.tm_hour = curtm.tm_min = curtm.tm_sec = 0;		curtm.tm_isdst = 0;		int tmp = (int)mktime(&curtm);		std::stringstream ss;		ss << tmp;		ss >> currentTime;		fprintf(fout, "set-time/tsuccessful/t%04d/%02d/%02d/n", year, month, day);	}
开发者ID:sadkangaroo,项目名称:2012.1ProgramDesignFinalProject,代码行数:25,


示例15: project

void SaweTestClass::        project(Sawe::pProject p){    if (!project_.expired())    {        Sawe::pProject oldp = project();        if (oldp)        {            disconnect( oldp->tools().render_view(), SIGNAL(postPaint()), this, SLOT(postPaint()));            disconnect( oldp->tools().render_view(), SIGNAL(finishedWorkSection()), this, SLOT(renderViewFinishedWorkSection()));        }    }    else    {        // Close any other project currently open by the application        // (application_cmd_options.cpp opens a project by default, but that        // might not be the project we want to run in the current test)        Sawe::Application* app = Sawe::Application::global_ptr ();        std::set<boost::weak_ptr<Sawe::Project>> projects = app->projects ();        for (boost::weak_ptr<Sawe::Project> wp : projects) {            Sawe::pProject pl = wp.lock ();            if (pl && pl != p) {                TaskTimer tt("Closing previous project");                app->slotClosed_window( pl->mainWindow () );            }        }    }    project_ = p;    project_is_opened_ = false;    QVERIFY( p.get() );    connect( p->tools().render_view(), SIGNAL(postPaint()), this, SLOT(postPaint()), Qt::QueuedConnection);}
开发者ID:gustafsson,项目名称:freq-integration,代码行数:35,


示例16: WXUNUSED

wxSize NumericRenderer::GetBestSize(wxGrid &grid,                                 wxGridCellAttr & WXUNUSED(attr),                                 wxDC & WXUNUSED(dc),                                 int row,                                 int col){   wxGridTableBase *table = grid.GetTable();   NumericEditor *ne =      static_cast<NumericEditor *>(grid.GetCellEditor(row, col));   wxSize sz;   if (ne) {      double value;      table->GetValue(row, col).ToDouble(&value);      NumericTextCtrl tt(mType, &grid,                      wxID_ANY,                      ne->GetFormat(),                      value,                      ne->GetRate(),                      wxPoint(10000, 10000),  // create offscreen                      wxDefaultSize,                      true);      sz = tt.GetSize();      ne->DecRef();   }   return sz;}
开发者ID:RaphaelMarinier,项目名称:audacity,代码行数:29,


示例17: catchException

        void catchException(const std::exception& ex) {            QString error = QString::fromUtf8(ex.what());            QString message = "<qt><b>qtfuzzylite</b> has experienced an internal error and will exit.<br><br>"                    "Please report this error to &nbsp; <a href='mailto:[email
C++ tt_int_op函数代码示例
C++ tswitch函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。