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

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

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

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

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

示例1: getMemoryShapes

 bool getMemoryShapes(const std::vector<MatShape> &inputs,                      const int requiredOutputs,                      std::vector<MatShape> &outputs,                      std::vector<MatShape> &internals) const {     Layer::getMemoryShapes(inputs, requiredOutputs, outputs, internals);     internals.assign(1, shape(1, total(inputs[0], 2)));     return true; }
开发者ID:cyberCBM,项目名称:DetectO,代码行数:9,


示例2: foodTotalChanged

void Customer::fireTotalsChanged() {    foodTotalChanged(foodTotal());    taxTotalChanged(taxTotal());    barTotalChanged(barTotal());    totalChanged(total());    actualTaxChanged(actualTax());    marginChanged(margin());}
开发者ID:jkalweit,项目名称:free-pos,代码行数:9,


示例3: main

void main (void){    struct tipopro proveedor[n];    cargamatriz (proveedor, n);    escribirmatriz (proveedor, n);    printf ("IMPORTE TOTAL= %d/n", total (proveedor, n));    getch ();}
开发者ID:jaguililla,项目名称:dai2000,代码行数:9,


示例4: CV_Assert

/* dst = src */void Mat::copyTo( OutputArray _dst ) const{    int dtype = _dst.type();    if( _dst.fixedType() && dtype != type() )    {        CV_Assert( channels() == CV_MAT_CN(dtype) );        convertTo( _dst, dtype );        return;    }    if( empty() )    {        _dst.release();        return;    }    if( dims <= 2 )    {        _dst.create( rows, cols, type() );        Mat dst = _dst.getMat();        if( data == dst.data )            return;        if( rows > 0 && cols > 0 )        {            const uchar* sptr = data;            uchar* dptr = dst.data;            // to handle the copying 1xn matrix => nx1 std vector.            Size sz = size() == dst.size() ?                getContinuousSize(*this, dst) :                getContinuousSize(*this);            size_t len = sz.width*elemSize();            for( ; sz.height--; sptr += step, dptr += dst.step )                memcpy( dptr, sptr, len );        }        return;    }    _dst.create( dims, size, type() );    Mat dst = _dst.getMat();    if( data == dst.data )        return;    if( total() != 0 )    {        const Mat* arrays[] = { this, &dst };        uchar* ptrs[2];        NAryMatIterator it(arrays, ptrs, 2);        size_t sz = it.size*elemSize();        for( size_t i = 0; i < it.nplanes; i++, ++it )            memcpy(ptrs[1], ptrs[0], sz);    }}
开发者ID:bigdig,项目名称:opencv,代码行数:57,


示例5: i

BigInteger BigInteger::operator*(const BigInteger & r) const{	BigInteger i(0), total(0), one(1);	for( ; i < *this; i = i + one )    // runs faster if *this < r   	{		total = total + r;		if ( total.hasOverFlowed() ) return total;      // stop when overflow	}	return total;}
开发者ID:JoshuaKennedy,项目名称:jccc_cs235,代码行数:10,


示例6: return

int UMat::checkVector(int _elemChannels, int _depth, bool _requireContinuous) const{    return (depth() == _depth || _depth <= 0) &&        (isContinuous() || !_requireContinuous) &&        ((dims == 2 && (((rows == 1 || cols == 1) && channels() == _elemChannels) ||                        (cols == _elemChannels && channels() == 1))) ||        (dims == 3 && channels() == 1 && size.p[2] == _elemChannels && (size.p[0] == 1 || size.p[1] == 1) &&         (isContinuous() || step.p[1] == step.p[2]*size.p[2])))    ? (int)(total()*channels()/_elemChannels) : -1;}
开发者ID:RandallTalea,项目名称:opencv,代码行数:10,


示例7: total

size_t MessageEncoder::getEncodedSize(const Properties& p, const qpid::types::Variant::Map& ap, const std::string& d){    size_t total(getEncodedSize(p));    //application-properties:    total += 3/*descriptor*/ + getEncodedSize(ap, true);    //body:    if (d.size()) total += 3/*descriptor*/ + 1/*code*/ + encodedSize(d);    return total;}
开发者ID:bbcarchdev,项目名称:qpid-cpp,代码行数:10,


示例8: setWarning

void WorksheetWidget::finished(){	if(WorksheetModel* model = qobject_cast<WorksheetModel*>(ui->tableView->model()))		model->setWorkLog(m_fetcher->workLog());	if(!m_fetcher->lastError().isNull())		setWarning(m_fetcher->lastError());	ui->totalTimeLabel->setText("Total time spent: " + Entry::formatTimeSpent(total()));}
开发者ID:megakoko,项目名称:jira-worksheet,代码行数:10,


示例9: iconSize

QSize QToolBoxButton::sizeHint() const{    QSize iconSize(8, 8);    if ( !icon.isNull() )	iconSize += icon.pixmap( QIconSet::Small, QIconSet::Normal ).size() + QSize( 2, 0 );    QSize textSize = fontMetrics().size( Qt::ShowPrefix, label ) + QSize(0, 8);    QSize total(iconSize.width() + textSize.width(), QMAX(iconSize.height(), textSize.height()));    return total.expandedTo(QApplication::globalStrut());}
开发者ID:AliYousuf,项目名称:abanq-port,代码行数:10,


示例10: start

  void Array::unshift(STATE, Object* val) {    native_int new_size = total_->to_native() + 1;    native_int lend = start_->to_native();    if(lend > 0) {      tuple_->put(state, lend-1, val);      start(state, Fixnum::from(lend-1));      total(state, Fixnum::from(new_size));    } else {      Tuple* nt = Tuple::create(state, new_size);      nt->copy_from(state, tuple_, start_, total_,		    Fixnum::from(1));      nt->put(state, 0, val);      total(state, Fixnum::from(new_size));      start(state, Fixnum::from(0));      tuple(state, nt);    }  }
开发者ID:code0100fun,项目名称:rubinius,代码行数:19,


示例11: get

  Object* Array::shift(STATE) {    native_int cnt = total_->to_native();    if(cnt == 0) return cNil;    Object* obj = get(state, 0);    set(state, 0, cNil);    start(state, Fixnum::from(start_->to_native() + 1));    total(state, Fixnum::from(cnt - 1));    return obj;  }
开发者ID:code0100fun,项目名称:rubinius,代码行数:10,


示例12: main

int main() {	int n;	res[1]=res[2]=1;	scanf("%d",&n);	while(n--) {		int m;		scanf("%d",&m);		printf("%d/n",total(m));	}}
开发者ID:zjut019,项目名称:ACM,代码行数:10,


示例13: total

ofVec2f ofxCvOpticalFlowLK::flowInRegion(float x, float y, float w, float h){	ofVec2f topLeft, bottomRight, total(0,0);	boundsForRect(x, y, w, h, &topLeft, &bottomRight);	for (int j = topLeft.y; j < bottomRight.y; j++) {		for(int i = topLeft.x; i < bottomRight.x; i++){			total += flowAtPoint(i, j);		}	}	return total; }
开发者ID:Flightphase,项目名称:ofxCvOpticalFlowLK,代码行数:10,


示例14: fits2mat

void Target::SetImage(string filename){    if (filename.size() > 0)    {    	// Read the file into a matrix:        fits2mat(filename.c_str(), this->image);        // Normalize it, just in case it wasn't normalized to begin with.        this->image /= total(this->image);    }}
开发者ID:bkloppenborg,项目名称:oifits-sim,代码行数:11,


示例15: CV_Assert

void Mat::create(int d, const int* _sizes, int _type){    int i;    CV_Assert(0 <= d && d <= CV_MAX_DIM && _sizes);    _type = CV_MAT_TYPE(_type);    if( data && (d == dims || (d == 1 && dims <= 2)) && _type == type() )    {        if( d == 2 && rows == _sizes[0] && cols == _sizes[1] )            return;        for( i = 0; i < d; i++ )            if( size[i] != _sizes[i] )                break;        if( i == d && (d > 1 || size[1] == 1))            return;    }    int _sizes_backup[CV_MAX_DIM]; // #5991    if (_sizes == (this->size.p))    {        for(i = 0; i < d; i++ )            _sizes_backup[i] = _sizes[i];        _sizes = _sizes_backup;    }    release();    if( d == 0 )        return;    flags = (_type & CV_MAT_TYPE_MASK) | MAGIC_VAL;    setSize(*this, d, _sizes, 0, true);    if( total() > 0 )    {        MatAllocator *a = allocator, *a0 = getDefaultAllocator();#ifdef HAVE_TGPU        if( !a || a == tegra::getAllocator() )            a = tegra::getAllocator(d, _sizes, _type);#endif        if(!a)            a = a0;        CV_TRY        {            u = a->allocate(dims, size, _type, 0, step.p, 0, USAGE_DEFAULT);            CV_Assert(u != 0);        }        CV_CATCH_ALL        {            if(a != a0)                u = a0->allocate(dims, size, _type, 0, step.p, 0, USAGE_DEFAULT);            CV_Assert(u != 0);        }        CV_Assert( step[dims-1] == (size_t)CV_ELEM_SIZE(flags) );    }
开发者ID:cyberCBM,项目名称:DetectO,代码行数:53,


示例16: total

string Fragment::get(){	int ttl = total();	int choice = rand()%ttl;	int i = 0;	for ( ; choice > 0 && i <= m_last; i++)	{		choice -= m_data[i].weight;	}	if (i == 1) i--;	return m_data[i].data;}
开发者ID:ayypot,项目名称:markovdb,代码行数:12,


示例17: getFLOPS

    virtual int64 getFLOPS(const std::vector<MatShape> &inputs,                           const std::vector<MatShape> &outputs) const    {        (void)outputs; // suppress unused variable warning        int64 flops = 0;        for(int i = 0; i < inputs.size(); i++)        {            flops += 60*total(inputs[i]);        }        return flops;    }
开发者ID:Aspie96,项目名称:opencv,代码行数:12,


示例18: total_times

  vector<int> total_times(const valarray<bool>& v)   {    vector<int> total(v.size()+1);    total[0] = 0;    for(int i=0;i<v.size();i++) {      total[i+1] = total[i];      if (v[i]) total[i+1]++;    }          return total;  }
开发者ID:sibonli,项目名称:BAli-Phy,代码行数:12,


示例19: total

void total(trieNodePointer root){	for (int i=0; i < 36; i++)	{		if (root->children[i] != NULL)		{			total(root->children[i]);			if (root->children[i]->files != NULL)				totalNodes++;		}	}}
开发者ID:ajay,项目名称:Systems,代码行数:12,


示例20: total

void newton::run_newton(const complex<double> & start, complex<double>& cur, int & niter){cur = start;for (niter = 0; niter < MITER; ++niter){old = cur;complex<double> total(0.0,0.0);total = total + 1.0/(cur - std::complex<double>(1,0))+ 1.0/(cur - std::complex<double>(0.309017,0.951057))+ 1.0/(cur - std::complex<double>(-0.809017,0.587785))+ 1.0/(cur - std::complex<double>(-0.809017,-0.587785))+ 1.0/(cur - std::complex<double>(0.309017,-0.951057));cur = cur - 1.0/total; diff = abs(old-cur); if (diff < .00001) { return;}} }
开发者ID:quantombone,项目名称:opengl_fractals,代码行数:12,


示例21: printTree

void printTree(trieNodePointer root, char *output){	FILE *outputFile = fopen(output, "w");	totalNodes = 0;	nodeCount = 0;	total(ROOT);	fprintf(outputFile, "{/"list/" : [/n");	resetVisited(root);	printTreeRecursive(root, outputFile);	fprintf(outputFile, "]}/n");	fclose(outputFile);}
开发者ID:ajay,项目名称:Systems,代码行数:12,


示例22: iconSize

QSize dtkToolBoxButton::sizeHint(void) const{    QSize iconSize(8, 8);    if (!this->icon().isNull()) {        int icone = this->style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this->parentWidget() /* QToolBox */);        iconSize += QSize(icone + 2, icone);    }    QSize textSize = fontMetrics().size(Qt::TextShowMnemonic, text()) + QSize(0, 8);    QSize total(iconSize.width() + textSize.width(), qMax(iconSize.height(), textSize.height()));    return total.expandedTo(QApplication::globalStrut());}
开发者ID:NicolasSchnitzler,项目名称:dtk,代码行数:12,


示例23: scroller

tile_picker::tile_picker(int X, int Y, int ID, int spec_type,             int Scale, int scroll_h, int Wid, ifield *Next)     : scroller(X,Y,ID,2,2,1,0,Next){  wid=Wid;  type=spec_type;  th=scroll_h;  scale=Scale;  set_size(picw()*wid,pich()*th);  sx=get_current();  t=total();}
开发者ID:DeejStar,项目名称:abuse-SDL2,代码行数:12,


示例24: getAvgColor

static ofPoint getAvgColor(ofImage img) {    ofPoint total(0,0,0);    int width = img.getWidth();    int height = img.getHeight();    ofPixels pixels = img.getPixels();    for(int i = 0; i < width; i++) {        for(int j = 0; j < height; j++) {            ofColor col = pixels.getColor(i, j);            total += ofPoint(col.r, col.g, col.b);        }    }    return total / (width*height);}
开发者ID:mattvisco,项目名称:SFPC_2016,代码行数:13,



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


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