• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pb函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: pB

void pB()
{
	switch (ch) {
	case 'b':
		pb(); pB();
		break;
	case 'c':
		pc(); pC();
		break;
	default :
		error();
	}
}
开发者ID:Francis0121,项目名称:homework.3.2,代码行数:13,代码来源:reguler02.c


示例2: pA

void pA()
{
	switch (ch) {
	case 'a':
		pa(); pA();
		break;
	case 'b':
		pb(); pB();
		break;
	default:
		error();
	}
}
开发者ID:Francis0121,项目名称:homework.3.2,代码行数:13,代码来源:reguler02.c


示例3: intersection_unoptimized

  template<class K> Object intersection_unoptimized(const Rectangle_2<K> &a, const Rectangle_2<K> &b) {
    typedef K::Point_2                        Point_2;
    typedef std::vector<Point_2>              Container;
    typedef Polygon_2<K, Container>           Polygon_2;
    typedef Polygon_with_holes_2<K,Container> Polygon_with_holes_2;

    if(a.is_degenerate() || b.is_degenerate()) return Object();
    Container pa(a.center()ontainer(true)), pb(b.center()ontainer(true));
    std::vector<Polygon_with_holes_2> res;
    Polygon_2 polya(pa.begin(),pa.end()), polyb(pb.begin(),pb.end());
    intersection(polya,polyb,std::back_inserter(res));
    return (res.empty())?Object():make_object(res.back().outer_boundary().container());
  }
开发者ID:IGNF,项目名称:librjmcmc,代码行数:13,代码来源:Rectangle_2_intersection.hpp


示例4: suggestPixelFormat

    //-----------------------------------------------------------------------
    void RenderTarget::writeContentsToFile(const String& filename)
    {
        PixelFormat pf = suggestPixelFormat();

        uchar *data = OGRE_ALLOC_T(uchar, mWidth * mHeight * PixelUtil::getNumElemBytes(pf), MEMCATEGORY_RENDERSYS);
        PixelBox pb(mWidth, mHeight, 1, pf, data);

        copyContentsToMemory(pb, pb);

        Image().loadDynamicImage(data, mWidth, mHeight, 1, pf, false, 1, 0).save(filename);

        OGRE_FREE(data, MEMCATEGORY_RENDERSYS);
    }
开发者ID:OGRECave,项目名称:ogre,代码行数:14,代码来源:OgreRenderTarget.cpp


示例5: pushswap

void	pushswap(t_struct **la, t_struct **lb)
{
	int			min;

	while (*la)
	{
		min = find_min(*la);
		while ((*la)->val != min)
			ra(la);
		pb(lb, la);
	}
	while (*lb)
		pa(la, lb);
}
开发者ID:naimac,项目名称:swap,代码行数:14,代码来源:push_min.c


示例6: splay

void splay(int x){
	int s = 1,i = x,y; tmp[1] = i;
	while(!isroot(i)) tmp[++s] = i = f[i];
	while(s) pb(tmp[s--]);
	while(!isroot(x)){
		y = f[x];
		if (!isroot(y)){
			if ((son[f[y]][0] == y) ^ (son[y][0] == x))
			rotate(x); else rotate(y);
		}
		rotate(x);
	}
	up(x);
}
开发者ID:cjdjr,项目名称:Algorithmic_Template,代码行数:14,代码来源:LCT.cpp


示例7: LieAlgebraSizeMismatchError

/// the Poisson bracket of two polynomials in this algebra
Polynomial ClassicalLieAlgebra::poissonBracket(const Polynomial& polA,
                                               const Polynomial& polB) const {
  if (!(hasElt(polA) && hasElt(polB)))
    throw LieAlgebraSizeMismatchError();
  assert(polA.hasSameNumVars(polB));
  Polynomial pb(zero());
  Polynomial pbA(zero());
  Polynomial pbB(zero());
  for (Index d = 0; d < dof_; ++d) {
    pbA = (polA.diff(iQ(d)) * polB.diff(iP(d)));
    pbB = (polA.diff(iP(d)) * polB.diff(iQ(d)));
    pb += (pbA - pbB);
  }
  return pb;
}
开发者ID:Peter-Collins,项目名称:NormalForm,代码行数:16,代码来源:ClassicalLieAlgebra.cpp


示例8: EraseAll

void Programmer::WriteInfoPage(const uint8_t chipID[5])
{
	// first parse the chipID

	// do an erase all
	// we must do this for the chip to allow an InfoPage erase
	EraseAll();

	ProgressBar pb("Writing IP");
	
	// send the erase page command
	req_erase_page_t erasePage;
	erasePage.page_num = 0;
	erasePage.length = sizeof erasePage;
	erasePage.request = reqErasePageIP;
	reqSetChecksum(erasePage);
	
	SendRequest(erasePage);

	pb.Refresh(0.3);
	
	// validate the response
	resp_simple_t resp;
	ReadResponse1(resp);

	if (resp.response != req2resp(reqErasePageIP))
		throw std::string("Unexpected response from programmer while erase page in WriteInfoPage()");

	// now init and send the new InfoPage
	req_write_flash_t writeFlash;
	writeFlash.length = sizeof writeFlash;
	writeFlash.address = 0;
	writeFlash.request = reqWriteInfoPage;
	memset(writeFlash.data, 0xff, sizeof writeFlash.data);
	memcpy(writeFlash.data + 0x0B, chipID, CHIP_ID_BYTES);
	reqSetChecksum(writeFlash);
	SendRequest(writeFlash);

	pb.Refresh(0.6);
	
	// validate
	ReadResponse1(resp);

	if (resp.response != req2resp(reqWriteInfoPage))
		throw std::string("Unexpected response from programmer while writing page in WriteInfoPage()");
		
	pb.Refresh(1);
}
开发者ID:boseji,项目名称:nrfburn,代码行数:48,代码来源:programmer.cpp


示例9: UsartPeripheral

    Usart3::Usart3(
            uint32_t baudRate_,
            uint16_t wordLength_,
            uint16_t parity_,
            uint16_t stopBits_,
            uint16_t flowControl_,
            uint16_t mode_) : UsartPeripheral(USART3,DMA1_Channel2,DMA1_Channel3,2,USART3_IRQn) {

        RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3,ENABLE);

        GpioPort pb(GPIOB);
        pb.initialise(GPIO_Speed_50MHz,GPIO_Mode_AF_PP,GPIO_Pin_TX);                 // TX
        pb.initialise(GPIO_Speed_50MHz,GPIO_Mode_IN_FLOATING,GPIO_Pin_RX);     // RX

        initialisePeripheral(baudRate_,wordLength_,parity_,stopBits_,flowControl_,mode_);
    }
开发者ID:dongkc,项目名称:food_processing_equipment,代码行数:16,代码来源:Usart3.cpp


示例10: publishFrame

  // bool publishFrame(Ogre::RenderWindow * render_object, const std::string frame_id)
  bool publishFrame(Ogre::RenderTexture * render_object, const std::string frame_id)
  {
    if (pub_.getTopic() == "")
    {
      return false;
    }
    if (frame_id == "")
    {
      return false;
    }
    // RenderTarget::writeContentsToFile() used as example
    int height = render_object->getHeight();
    int width = render_object->getWidth();
    // the results of pixel format have to be used to determine
    // image.encoding
    Ogre::PixelFormat pf = render_object->suggestPixelFormat();
    uint pixelsize = Ogre::PixelUtil::getNumElemBytes(pf);
    uint datasize = width * height * pixelsize;

    // 1.05 multiplier is to avoid crash when the window is resized.
    // There should be a better solution.
    uchar *data = OGRE_ALLOC_T(uchar, datasize * 1.05, Ogre::MEMCATEGORY_RENDERSYS);
    Ogre::PixelBox pb(width, height, 1, pf, data);
    render_object->copyContentsToMemory(pb, Ogre::RenderTarget::FB_AUTO);

    sensor_msgs::Image image;
    image.header.stamp = ros::Time::now();
    image.header.seq = image_id_++;
    image.header.frame_id = frame_id;
    image.height = height;
    image.width = width;
    image.step = pixelsize * width;
    if (pixelsize == 3)
      image.encoding = sensor_msgs::image_encodings::RGB8;  // would break if pf changes
    else if (pixelsize == 4)
      image.encoding = sensor_msgs::image_encodings::RGBA8;  // would break if pf changes
    else
    {
      ROS_ERROR_STREAM("unknown pixe format " << pixelsize << " " << pf);
    }
    image.is_bigendian = (OGRE_ENDIAN == OGRE_ENDIAN_BIG);
    image.data.resize(datasize);
    memcpy(&image.data[0], data, datasize);
    pub_.publish(image);

    OGRE_FREE(data, Ogre::MEMCATEGORY_RENDERSYS);
  }
开发者ID:lucasw,项目名称:rviz_camera_stream,代码行数:48,代码来源:camera_display.cpp


示例11: ft_algo

void		ft_algo(t_tab **op, t_swap **ba, t_swap **bb, unsigned int i)
{
	if (i / 8)
		ft_algo(op, ba, bb, (i / 8));
	if (i % 8 < 3)
		op[i % 8](ba);
	else if (i % 8 == 3 && *bb)
		pb(bb, ba);
	else if (i % 8 == 4 && *ba)
		pa(ba, bb);
	else if (i % 8 == 5)
		op[3](bb);
	else if (i % 8 == 6)
		op[4](bb);
	else if (i % 8 == 7)
		op[5](bb);
}
开发者ID:anasse82,项目名称:push_swap,代码行数:17,代码来源:ft_algo_bf.c


示例12: JudgeIntersection

void Partition::FindPartitionFace(SFace* Fa, SFace* Fb)
{
	//比较两个面是否有相邻curve_edge, 如果有那么就判断两面是否是分割面 否则continue
	for(auto i = Fa->faceBounds_.begin(); i != Fa->faceBounds_.end(); i++)
	{
		for(auto ia = ((*i)->edgeLoop_).begin(); ia != ((*i)->edgeLoop_).end(); ia++)
		{
			size_t curveFaceAId = (*ia)->edgeCurveId_;
			for(auto j = Fb->faceBounds_.begin(); j != Fb->faceBounds_.end(); j++)
			{
				for(auto jb = ((*j)->edgeLoop_).begin(); jb != ((*j)->edgeLoop_).end(); jb++)
				{
					size_t curveFaceBId = (*jb)->edgeCurveId_;
					orientationFaceA oriA;
					oriA.advancedFaceOri = Fa->adFaceSameSense_;
					oriA.boundsOri = (*i)->boundsOri_;
					oriA.orientedEdgeOri = (*ia)->orientedEdgeOri_;
					oriA.edgeCurveOri = (*ia)->edgeCurvesameSense_;

					char* curveName = (*ia)->curveName_;
					EdgeCurveVertex curveA, curveB;
					curveA.cartesianStart = (*ia)->edgeStart_;
					curveA.cartesianEnd = (*ia)->edgeEnd_;
					curveA.cartesianStart = (*jb)->edgeStart_;
					curveA.cartesianEnd = (*jb)->edgeEnd_;
					CPoint3D pointA = ((CIRCLE*)(*ia))->position_.point;//圆心
					if(curveFaceBId == curveFaceAId)
					{
						//判断是否是分割面
						bool isPartitionFace = JudgeIntersection(Fa, Fb, curveName,
							oriA, curveA, curveB, pointA);
						if(isPartitionFace)
						{
							pair<size_t, SFace*> pa(Fa->entityID_, Fa);
							pair<size_t, SFace*> pb(Fb->entityID_, Fb);
							partitionFaceList_.insert(pa);
							partitionFaceList_.insert(pb);
						}
						else
							continue;
					}
				}
			}
		}
	}
}
开发者ID:vujn,项目名称:chenan,代码行数:46,代码来源:Partition.cpp


示例13: run

    virtual void run()
    {
        python_bridge pb( "processor", "processor" );
        for( int i=0; i<N; i++ )
        {
            // check input event
            const eva::event& e = _inp->next();
            assert( e.get_header()._id == i );

            pb.exec( e.get_raw(), eva::event::size, next().get_raw(), eva::event::size );

            // produce output event
            //next().get_header()._id = i;

            commit();
        }
    }
开发者ID:mmcilroy,项目名称:eva_cpp,代码行数:17,代码来源:test_application3.cpp


示例14: after

    ATOOLS::Vec4D_Vector  Combine
    (const Cluster_Amplitude &ampl,int i,int j,int k,const ATOOLS::Flavour &mo)
    {
      Mass_Selector *p_ms=ampl.MS();
      if (i>j) std::swap<int>(i,j);
      Vec4D_Vector after(ampl.Legs().size()-1);
      double mb2(0.0);
      if (i<2) {
	mb2=ampl.Leg(1-i)->Mom().Abs2();
	double mfb2(p_ms->Mass2(ampl.Leg(1-i)->Flav()));
	if ((mfb2==0.0 && IsZero(mb2,1.0e-6)) || IsEqual(mb2,mfb2,1.0e-6)) mb2=mfb2;
      }
      Vec4D pi(ampl.Leg(i)->Mom()), pj(ampl.Leg(j)->Mom());
      Vec4D pk(ampl.Leg(k)->Mom()), pb(i<2?ampl.Leg(1-i)->Mom():Vec4D());
      double mi2=pi.Abs2(), mfi2=p_ms->Mass2(ampl.Leg(i)->Flav());
      double mj2=pj.Abs2(), mfj2=p_ms->Mass2(ampl.Leg(j)->Flav());
      double mk2=pk.Abs2(), mfk2=p_ms->Mass2(ampl.Leg(k)->Flav());
      if ((mfi2==0.0 && IsZero(mi2,1.0e-6)) || IsEqual(mi2,mfi2,1.0e-6)) mi2=mfi2;
      if ((mfj2==0.0 && IsZero(mj2,1.0e-6)) || IsEqual(mj2,mfj2,1.0e-6)) mj2=mfj2;
      if ((mfk2==0.0 && IsZero(mk2,1.0e-6)) || IsEqual(mk2,mfk2,1.0e-6)) mk2=mfk2;
      double mij2=p_ms->Mass2(mo);
      Kin_Args lt;
      if (i>1) {
	if (k>1) lt=ClusterFFDipole(mi2,mj2,mij2,mk2,pi,pj,pk,2);
	else lt=ClusterFIDipole(mi2,mj2,mij2,mk2,pi,pj,-pk,2);
	if ((k==0 && lt.m_pk[3]<0.0) ||
	    (k==1 && lt.m_pk[3]>0.0) || lt.m_pk[0]<0.0) return Vec4D_Vector();
      }
      else {
	if (k>1) {
	  lt=ClusterIFDipole(mi2,mj2,mij2,mk2,mb2,-pi,pj,pk,-pb,2);
	}
	else lt=ClusterIIDipole(mi2,mj2,mij2,mk2,-pi,pj,-pk,2);
	if ((i==0 && lt.m_pi[3]<0.0) ||
	    (i==1 && lt.m_pi[3]>0.0) || lt.m_pi[0]<0.0) return Vec4D_Vector();
      }
      if (lt.m_stat<0) return Vec4D_Vector();
      for (size_t l(0), m(0);m<ampl.Legs().size();++m) {
	if (m==(size_t)j) continue;
	if (m==(size_t)i) after[l]=i>1?lt.m_pi:-lt.m_pi;
	else if (m==(size_t)k) after[l]=k>1?lt.m_pk:-lt.m_pk;
	else after[l]=lt.m_lam*ampl.Leg(m)->Mom();
	++l;
      }
      return after;
    }
开发者ID:ktf,项目名称:sherpa,代码行数:46,代码来源:Pythia_Jet_Criterion.C


示例15: tri_simple

void	tri_simple(t_lst *l, t_options *options, int *tri)
{
	while ((l->a)->length > 0)
	{
		more_effective_moving(l, find_min(&l->a), options);
		pb(l);
		if (options->v == 1)
			show_piles(l, "pb");
	}
	while ((l->b)->length > 0)
	{
		pa(l);
		if (options->v == 1)
			show_piles(l, "pa");
	}
	*tri = 2;
}
开发者ID:mpaincha,项目名称:push_swap,代码行数:17,代码来源:algo_1.c


示例16: tmp

 void maxsmt_solver_base::commit_assignment() {
     expr_ref tmp(m);
     expr_ref_vector fmls(m);
     rational k(0), cost(0);
     vector<rational> weights;
     for (soft const& s : m_soft) {
         if (s.is_true()) {
             k += s.weight;
         }
         else {
             cost += s.weight;
         }
         weights.push_back(s.weight);
         fmls.push_back(s.s);
     }       
     pb_util pb(m);
     tmp = pb.mk_ge(weights.size(), weights.c_ptr(), fmls.c_ptr(), k);
     TRACE("opt", tout << "cost: " << cost << "\n" << tmp << "\n";);
开发者ID:levnach,项目名称:z3,代码行数:18,代码来源:maxsmt.cpp


示例17: main

int main(int , char **)
{
    std::cout << "Tests on gfa library" << std::endl;

    std::cout << "Create Point3D and assign to other Point3D" << std::endl;
    GFA::Point3D pa(1,2,3);
    GFA::Point3D pb(4,5,6);
    std::cout << pa.x << " " << pa.y << " " << pa.z << std::endl;
    std::cout << pb.x << " " << pb.y << " " << pb.z << std::endl;
    pa = pb;
    std::cout << pa.x << " " << pa.y << " " << pa.z << std::endl;
    GFA::Point3D pd(pb);
    std::cout << pd.x << " " << pd.y << " " << pd.z << std::endl;
    // This should give an error
    //GFA::Point3D pe(pc);
    
    return 0;
}
开发者ID:faalbers,项目名称:gfa,代码行数:18,代码来源:main.cpp


示例18: _l

int  MediaMemoryAllocator<memorytype>::GetMediaBuffer(sp<IMediaBuffer>& Sample)
{
	AutolockEx _l(m_lock);
	if(m_availablememory.size())
	{
		Sample.clear();
		sp<IMediaBufferAllocator> p(this);
		sp<IMemory> pb((m_availablememory.begin())->get());
		Sample = new CMediaBuffer(p,pb);
		m_availablememory.erase(m_availablememory.begin());
		return OK;
	}
	
	LOGI("[VTMAL]MediaMemoryAllocator<%d> GetMediaBuffer fail,m_samplenums=%d,m_samplesize=%d",\
		memorytype,m_samplenums,m_samplesize);
	 return NO_MEMORY;

}
开发者ID:4Fwolf,项目名称:mt6572_x201,代码行数:18,代码来源:buffermanagement.hpp


示例19: getBoundByValue

unsigned LAVar::setBound( const Real & v, bool upper )
{
  unsigned i = getBoundByValue( v, upper );
  if( i != 0 )
    return i;

  Delta * bound = NULL;

  Delta::deltaType bound_type = ( upper ? Delta::UPPER : Delta::LOWER );

  bound = new Delta( v );

  assert( bound );

  LAVarBound pb( bound, NULL, ( bound_type == Delta::UPPER ), false );

  addBoundAndUpdateSorting( pb );
  return getBoundByValue( v, upper );
}
开发者ID:dreal-deps,项目名称:opensmt,代码行数:19,代码来源:LAVar.C


示例20: dlg

void IcoCreatorView::on_button_save()
{
	CL_SaveFileDialog dlg(this);

	dlg.add_filter("ICO files", "*.ico", true);
	dlg.add_filter("All files", "*.*");

	dlg.set_initial_directory(CL_System::get_exe_path());

	if(dlg.show())
	{
		CL_String filename = dlg.get_filename();

		try
		{
			CL_IconSet icon_set;

			int count = 0;
			for(int i = 0; i < 11; ++i)
			{
				if(lineedit_selected_file[i]->get_text().empty() == false)
				{
					CL_PixelBuffer pb(lineedit_selected_file[i]->get_text());
					icon_set.add_image(pb);
					count++;
				}
			}

			CL_DataBuffer databuffer = icon_set.create_win32_icon();

			CL_File ico_file(filename, CL_File::create_always, CL_File::access_write);
			ico_file.write(databuffer.get_data(), databuffer.get_size());
			
			ico_file.close();

			label_result->set_text(cl_format("Saved %1 images into ico file: %2", count, filename));
		}
		catch(CL_Exception error)
		{
			label_result->set_text(cl_format("Save error: %1", error.message));
		}
	}
}
开发者ID:PaulFSherwood,项目名称:cplusplus,代码行数:43,代码来源:ico_creator_view.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pbase函数代码示例发布时间:2022-05-30
下一篇:
C++ payload函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap