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

C++ P2函数代码示例

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

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



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

示例1: main

int main() {
  __CPROVER_ASYNC_0: P0(0);
  __CPROVER_ASYNC_1: P1(0);
  __CPROVER_ASYNC_2: P2(0);
  __CPROVER_assume(__unbuffered_cnt==3);
  fence();
  // EXPECT:exists
  __CPROVER_assert(!(__unbuffered_p1_r1==1 && __unbuffered_p2_r1==1 && __unbuffered_p2_r3==0), "Program was expected to be safe for PPC, model checker should have said NO.\nThis likely is a bug in the tool chain.");
  return 0;
}
开发者ID:debleena89,项目名称:Mytest,代码行数:10,代码来源:safe120.c


示例2: main

int main() {
    Bitmap bitmap(640, 480);
    Camera cam; cam.zoom = 1, cam.focus = 10000, cam.height = 100;
    BezObj teapot(INPUT);
    teapot.move(P3(0, -100, -1000));
    teapot.rotateZ(-45);
    teapot.rotateX(-45);
    teapot.split(2);
    cam.shot(teapot, bitmap);
    ImageProcessor ip(&bitmap);
    ip.rerange(
        P2(-320, -240),
        P2(0, 0)
    );
    ip.GaussianBlur(2);
    bitmap.save(OUTPUT);
    system(OUTPUT);
    return 0;
}
开发者ID:natebuj,项目名称:Bitmap,代码行数:19,代码来源:main.cpp


示例3: main

int main() {
  __CPROVER_ASYNC_0: P0(0);
  __CPROVER_ASYNC_1: P1(0);
  __CPROVER_ASYNC_2: P2(0);
  __CPROVER_assume(__unbuffered_cnt==3);
  fence();
  // EXPECT:exists
  __CPROVER_assert(!(z==2 && __unbuffered_p1_r1==1 && __unbuffered_p2_r1==1), "Program proven to be relaxed for PPC, model checker says YES.");
  return 0;
}
开发者ID:DanielNeville,项目名称:cbmc,代码行数:10,代码来源:podrw001.c


示例4: myType

AREXPORT ArMapObject::ArMapObject(const char *type, 
					                        ArPose pose, 
                                  const char *description,
 		                              const char *iconName, 
                                  const char *name,
 		                              bool hasFromTo, 
                                  ArPose fromPose, 
                                  ArPose toPose) :
  myType((type != NULL) ? type : ""),
  myBaseType(),
  myName((name != NULL) ? name : "" ),
  myDescription((description != NULL) ? description : "" ),
  myPose(pose),
  myIconName((iconName != NULL) ? iconName : "" ),
  myHasFromTo(hasFromTo),
  myFromPose(fromPose),
  myToPose(toPose),
  myFromToSegments(),
  myStringRepresentation()
{
  if (myHasFromTo)
  {
    double angle = myPose.getTh();
    double sa = ArMath::sin(angle);
    double ca = ArMath::cos(angle);
    double fx = fromPose.getX();
    double fy = fromPose.getY();
    double tx = toPose.getX();
    double ty = toPose.getY();
    ArPose P0((fx*ca - fy*sa), (fx*sa + fy*ca));
    ArPose P1((tx*ca - fy*sa), (tx*sa + fy*ca));
    ArPose P2((tx*ca - ty*sa), (tx*sa + ty*ca));
    ArPose P3((fx*ca - ty*sa), (fx*sa + ty*ca));
    myFromToSegments.push_back(ArLineSegment(P0, P1));
    myFromToSegments.push_back(ArLineSegment(P1, P2));
    myFromToSegments.push_back(ArLineSegment(P2, P3));
    myFromToSegments.push_back(ArLineSegment(P3, P0));
    
    myFromToSegment.newEndPoints(fromPose, toPose);
  }
  else { // pose
    size_t whPos = myType.rfind("WithHeading");
    size_t whLen = 11;
    if (whPos > 0) {
      if (whPos == myType.size() - whLen) {
        myBaseType = myType.substr(0, whPos);
      }
    }
  } // end else pose

  IFDEBUG(
  ArLog::log(ArLog::Normal, 
             "ArMapObject::ctor() created %s (%s)",
             myName.c_str(), myType.c_str());
  );
开发者ID:PipFall2015,项目名称:Ottos-Cloud,代码行数:55,代码来源:ArMapObject.cpp


示例5: FillRectangle

void	FillRectangle( const DrawUtils::DrawInfos& i, Pixel& P )
{
	float		Alpha = i.Coverage;
	float		Distance = 1.0f - 2.0f * abs(i.Distance);

	Pixel	P2( NjFloat4( Distance, 0, 0, 0 ) );	// Draw distance to border in red
	if ( Distance < 0.0f )
		Alpha = 0.0f;

	P.Blend( P2, Alpha );
}
开发者ID:Samana,项目名称:GodComplex,代码行数:11,代码来源:Build2DTextures.cpp


示例6: t_pair_PH

double t_pair_PH(double E, Particle& particle, Fun* tpf)  //E=Ep
{
	DataInjection data;
	data.E = E;
	data.mass = particle.mass;
	data.tpf  = tpf;

	double mass = particle.mass;
	double cte	=	0.5*P2(mass*cLight2)*cLight;

	double b   = 10*targetPhotonEmax;   //energia maxima de los fotones en erg

	double a1  = mass*P2(cLight)*pairThresholdPH/(2*E);

	double a = std::max(a1,targetPhotonEmin);

	double integral = RungeKutta(a,b,&cPairPH,&dPH,&f_t_PHPair,&data);

	return cte*integral/P2(E);
}
开发者ID:neiwork,项目名称:radproc,代码行数:20,代码来源:pgammaPairInj.cpp


示例7: main

int main() {
  __CPROVER_ASYNC_0: P0(0);
  __CPROVER_ASYNC_1: P1(0);
  __CPROVER_ASYNC_2: P2(0);
  __CPROVER_ASYNC_3: P3(0);
  __CPROVER_assume(__unbuffered_cnt==4);
  fence();
  // EXPECT:exists
  __CPROVER_assert(!(x==2 && z==2 && __unbuffered_p1_EAX==0 && __unbuffered_p3_EAX==2 && __unbuffered_p3_EBX==0), "Program proven to be relaxed for X86, model checker says YES.");
  return 0;
}
开发者ID:DanielNeville,项目名称:cbmc,代码行数:11,代码来源:mix027.c


示例8: P1

inline void AbstractPath::filterOffset(const int i, Vec2f& here) const {
  Vec2f P1(getElement(i-1), getElement(i));
  Vec2f P2(getElement(i+1), getElement(i));
  
  float p1len = P1.Len(), p2len = P2.Len(), sum = p1len+p2len;
  P1 *= p2len / sum;
  P2 *= p1len / sum;

  here = P1;
  here += P2;
}
开发者ID:doctorpangloss,项目名称:Roto,代码行数:11,代码来源:abstractPath.C


示例9: P2

maxint_t P2(maxint_t x, int threads)
{
  if (x < 1)
    return 0;

  double alpha = get_alpha_deleglise_rivat(x);
  string limit = get_max_x(alpha);

  if (x > to_maxint(limit))
    throw primecount_error("P2(x): x must be <= " + limit);

  if (is_print())
    set_print_variables(true);

  int64_t y = (int64_t) (iroot<3>(x) * alpha);

  if (x <= numeric_limits<int64_t>::max())
    return P2((int64_t) x, y, threads);
  else
    return P2(x, y, threads);
}
开发者ID:kimwalisch,项目名称:primecount,代码行数:21,代码来源:main.cpp


示例10: _getEdges

std::vector<sf::Vector2f> _getEdges(TPPLPoly& A)
{
	std::vector<sf::Vector2f> edges;
	for(unsigned int i=0; i < (A.GetNumPoints()+1) ; ++i)
	{
		sf::Vector2f P1( A[i].x, A[i].y);
		sf::Vector2f P2( A[(i+1)%A.GetNumPoints()].x, A[(i+1)%A.GetNumPoints()].y );

		edges.push_back( P2 - P1 );
	}
	return edges;
}
开发者ID:675492062,项目名称:NavMesh,代码行数:12,代码来源:GeneralPolygon.cpp


示例11: ptcloudFromCorrespondences

Eigen::MatrixXd ptcloudFromCorrespondences(const std::string& correspondencesFilename, const std::string& extrinsicsFilename, const std::string& ptcloudFilename)
{
	// THE UNDISTORTED POINTS (calibrated by K in P1, P2)
	std::ifstream in1(correspondencesFilename);
	if (in1.bad())
		return Eigen::MatrixXd(1,3);
	unsigned int N = 0;
	char buf[256];
	for (; in1.good(); N++)
		in1.getline(buf, 256);
	N--; // Advanced past for loop
	in1.close();

	std::ifstream in(correspondencesFilename);
	if (in.bad())
		return Eigen::MatrixXd(1, 3);
	char c;
	std::vector< cv::Point2d > x1v, x2v;
	for (unsigned int i = 0; i < N && !in.bad(); i++)
	{
		double x1x, x1y, x2x, x2y, max, qwx, qwy;
		in >> x1x >> c >> x1y >> c >> x2x >> c >> x2y >> c >> max >> c >> qwx >> c >> qwy;
		// Hardcoded threshold of .6, qw > .5
		if ((max > .6))//  && (qwx > .5) && (qwy > .5)) // if stabilization
		{
			x1v.push_back(cv::Point2d(x1x, x1y));
			x2v.push_back(cv::Point2d(x2x, x2y));
		}
	}
	Eigen::MatrixXd x1(2, x1v.size());
	Eigen::MatrixXd x2(2, x2v.size());
	unsigned int co = 0;
	for (std::vector<cv::Point2d>::iterator x1r = x1v.begin(), x2r = x2v.begin(); ((x1r != x1v.end()) && (x2r != x2v.end())); x1r++, x2r++, co++)
	{
		x1(0, co) = x1r->x;
		x1(1, co) = x1r->y;
		x2(0, co) = x2r->x;
		x2(1, co) = x2r->y;
	}

	Eigen::MatrixXd P1 = Eigen::MatrixXd::Identity(3, 4), P2 = Eigen::MatrixXd::Identity(3, 4);
	P2(0, 3) = 1.0;
	if (extrinsicsFilename != "")
	{
		std::ifstream extrinsicsFile(extrinsicsFilename);
		if (extrinsicsFile.bad())
			return Eigen::MatrixXd(1, 3);
		double rx, ry, rz, tx, ty, tz;
		extrinsicsFile >> rx >> c >> ry >> c >> rz >> c;
		extrinsicsFile >> tx >> c >> ty >> c >> tz >> c;
		std::cout << "Getting extrinsics: " << rx << ',' << ry << ',' << rz << ',' << tx << ',' << ty << ',' << tz << std::endl;
		P2 = cameraMatrixKnownRT(rx, ry, rz, tx, ty, tz);
	}
开发者ID:heretodev,项目名称:triangulate,代码行数:53,代码来源:triangulate.cpp


示例12: bitmapHeaderInit

bool Bitmap::setSize(int width, int height) {
    if(buffer)
        delete [] buffer;
    this->width = width;
    this->height = height;
    if(width * height > 2073600)
        return false;
    bitmapHeaderInit(header, width, height);
    buffer = new RGB[width * height];
    setOrigin(P2(width / 2 - 1, height / 2 - 1));
    return true;
}
开发者ID:prylee,项目名称:Bitmap,代码行数:12,代码来源:bitmap.cpp


示例13: test_Bbox_E3_operator_incr

void test_Bbox_E3_operator_incr()
{
    Point_E3d P1(-5,-4,-3);
    Point_E3d P2( 7, 6, 5);

    Bbox_E3d box(P1);
    box += P2;

    assert( box == Bbox_E3d(P1, P2) );

    assert( box.center() == Point_E3d(1,1,1) );
}
开发者ID:ghali,项目名称:DelCapo,代码行数:12,代码来源:test_e3.cpp


示例14: P1

bool CSPrimBox::Write2XML(TiXmlElement &elem, bool parameterised)
{
    CSPrimitives::Write2XML(elem,parameterised);

    TiXmlElement P1("P1");
    m_Coords[0].Write2XML(&P1,parameterised);
    elem.InsertEndChild(P1);

    TiXmlElement P2("P2");
    m_Coords[1].Write2XML(&P2,parameterised);
    elem.InsertEndChild(P2);
    return true;
}
开发者ID:koendv,项目名称:CSXCAD,代码行数:13,代码来源:CSPrimBox.cpp


示例15: main

int main() {

  GlobalPoint P1(3., 4., 7.);
  GlobalPoint P2(-2., 5., 7.);

  oldCode(P1,P2);
  newCode(P1,P2);

  oldCode(P2,P1);
  newCode(P2,P1);


  return 0;
}
开发者ID:12345ieee,项目名称:cmg-cmssw,代码行数:14,代码来源:PixelTriplets_InvPrbl_t.cpp


示例16: test_mixed_of

void test_mixed_of()
{
    typedef boost::geometry::model::polygon<P1> polygon_type1;
    typedef boost::geometry::model::polygon<P2> polygon_type2;
    typedef boost::geometry::model::box<P1> box_type1;
    typedef boost::geometry::model::box<P2> box_type2;

    polygon_type1 poly1, poly2;
    boost::geometry::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0))", poly1);
    boost::geometry::read_wkt("POLYGON((0 0,0 5,5 5,5 0,0 0))", poly2);

    box_type1 box1(P1(1, 1), P1(4, 4));
    box_type2 box2(P2(0, 0), P2(5, 5));
    P1 p1(3, 3);
    P2 p2(3, 3);

    BOOST_CHECK_EQUAL(bg::covered_by(p1, poly2), true);
    BOOST_CHECK_EQUAL(bg::covered_by(p2, poly1), true);
    BOOST_CHECK_EQUAL(bg::covered_by(p2, box1), true);
    BOOST_CHECK_EQUAL(bg::covered_by(p1, box2), true);
    BOOST_CHECK_EQUAL(bg::covered_by(box1, box2), true);
    BOOST_CHECK_EQUAL(bg::covered_by(box2, box1), false);
}
开发者ID:ArkanaLord,项目名称:libboost,代码行数:23,代码来源:covered_by.cpp


示例17: fabs

void Bitmap::sTriangle(P2 p1, P2 p2, P2 p3) {
    double area2o = fabs(det(p3 - p1, p2 - p1));
    for(int i = 0 - int(origin.x); i < width - int(origin.x); i++) {
        for(int j = 0 - int(origin.y); j < height - int(origin.y); j++) {
            double area2n = 0.0;
            area2n += fabs(det(P2(i, j) - p1, P2(i, j) - p2));
            area2n += fabs(det(P2(i, j) - p2, P2(i, j) - p3));
            area2n += fabs(det(P2(i, j) - p3, P2(i, j) - p1));
            if(area2n <= area2o)
                set(P2(i, j));
        }
    }
}
开发者ID:prylee,项目名称:Bitmap,代码行数:13,代码来源:bitmap.cpp


示例18: test_op

void test_op()
{
    Point_E3d  P1(3.0,4.0,5.0);
    Point_E3d  P2(4.0,7.0,9.0);
    Vector_E3d V1(8.0,4.0,2.0);

    Point_E3d A1 = P1;
    A1 += V1;
    assert( Point_E3d(11.0,8.0,7.0) == A1 );
    A1 -= V1;
    assert( P1 == A1 );

    Vector_E3d V2(P1, P2);
    assert( Vector_E3d(1.0, 3.0, 4.0) == V2 );
}
开发者ID:ghali,项目名称:DelCapo,代码行数:15,代码来源:test_e3.cpp


示例19: unrotatedSizeHint

QPolygon KDChart::TextLayoutItem::rotatedCorners() const
{
    // the angle in rad
    const qreal angle = mAttributes.rotation() * PI / 180.0;
    QSize size = unrotatedSizeHint();

    // my P1 - P4 (the four points of the rotated area)
    QPointF P1( size.height() * sin( angle ), 0 );
    QPointF P2( size.height() * sin( angle ) + size.width() * cos( angle ), size.width() * sin( angle ) );
    QPointF P3( size.width() * cos( angle ), size.width() * sin( angle ) + size.height() * cos( angle ) );
    QPointF P4( 0, size.height() * cos( angle ) );

    QPolygon result;
    result << P1.toPoint() << P2.toPoint() << P3.toPoint() << P4.toPoint();
    return result;
}
开发者ID:CGenie,项目名称:kmymoney,代码行数:16,代码来源:KDChartLayoutItems.cpp


示例20: P0

Point Rectangle::Sample(float u, float v, Normal *Ns) const {

    // u and v are random samples on the surface of the light source
    Point P0(-x/2, y/2, height), P1(x/2, y/2, height);
    Point P2(-x/2, -y/2, height), P3(x/2, -y/2, height);

    Point p = P0 + (P1 - P0) * u + (P2 - P0) * v;

    Normal n = Normal(Cross(P2-P0, P1-P0));
    *Ns = Normalize(n);

    // NORMAL ON THE PLANE
    *Ns = Normalize((*ObjectToWorld)(n));
    if (ReverseOrientation) *Ns *= -1.f;
    return (*ObjectToWorld)(p);
}
开发者ID:marwan-abdellah,项目名称:pbrt-v2,代码行数:16,代码来源:rectangle.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ P2ALIGN函数代码示例发布时间:2022-05-30
下一篇:
C++ P1275_INOUT函数代码示例发布时间: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