Exemplo n.º 1
0
int panduan(int *i,int *j,int k)
{
    if(1==aaa(i,j))return 1;
    switch(k)
    {
       case 1:if(*i<8)*i+=2;break;
       case 2:if(*i>1)*i-=2;break;
       case 3:if(*j>1)*j-=2;break;//gotoxy(5,12);printf("3:%d %d",*i,*j);getch();
       case 4:if(*j<8)*j+=2;break;//gotoxy(5,12);printf("4:%d %d",*i,*j);getch();
    }
    if(1==aaa(i,j))return 1;
    switch(k)
    {
       case 1:if(*i>0)*i-=1;if(*j>0)*j-=1;break;
       case 2:if(*i<9)*i+=1;if(*j<9)*j+=1;break;
       case 3:if(*j<9)*j+=1;if(*i>0)*i-=1;break;
       case 4:if(*j>0)*j-=1;if(*i<9)*i+=1;break;
    }
    if(1==aaa(i,j))return 1;
    switch(k)
    {
       case 1:if(*j<8&&*j>=0)*j+=2;break;
       case 2:if(*j>1&&*j<=9)*j-=2;break;
       case 3:if(*i>1&&*i<=9)*i-=2;break;
       case 4:if(*i<8&&*i>=0)*i+=2;break;
    }
    if(1==aaa(i,j))return 1;
    gotoxy(5,13);
    printf("game over");
    getch();
    exit(0);
}
Exemplo n.º 2
0
int main () {
  if (1) {
    if (x > 1 ) { foo(); brk(); }
    } else aaa();
  if (1)
    while (x > 1 ) { foo(); brk(); }
  else aaa();
  foo(); brk();
}
Exemplo n.º 3
0
Arquivo: main.cpp Projeto: CCJY/coliru
 void test()
 {
     if (__builtin_expect(aaa(), 0))
     {
         bbb();
     }
 }
Exemplo n.º 4
0
int main(){
    puts( aaa() );
    puts( bbb(Tony) );
    puts( ccc(Tony) );
    puts( ddd(zzz) );
    return 0;
}
Exemplo n.º 5
0
Arquivo: main.cpp Projeto: CCJY/coliru
 void test()
 {
     if (aaa() == 0)
     {
         bbb();
     }
 }
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Returns center and scale of plane marker
	// @param plane Vector of found planes
	// @param scene_cloud point cloud of the scene
	// @param center Sendor to map transformation matrix
	// @param scale Sendor to map transformation matrix
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	bool DynModelExporter::getCenterAndScale(Plane<float> &plane, Normals &normals, PointXYZ &center, PointXYZ &scale)
	{
		center.x = 0.0;
		center.y = 0.0;
		center.z = 0.0;

		float size = 0.0;
		PointXYZ min(9999999.0, 9999999.0, 9999999.0);
		PointXYZ max(-9999999.0, -9999999.0, -9999999.0);

		for (unsigned int i = 0; i < normals.m_points.rows; ++i)
		for (unsigned int j = 0; j < normals.m_points.cols; ++j)
		{
			 // 1cm TODO - make as param
			cv::Vec3f point = normals.m_points.at<cv::Vec3f>(i, j);
			cv::Vec4f localPlane = normals.m_planes.at<cv::Vec4f>(i, j);
			Plane<float> aaa(localPlane[0], localPlane[1], localPlane[2], localPlane[3]);
			 if (plane.distance(point) < 0.1 && plane.isSimilar(aaa, 0.3, 0.5))
			 {
				 center.x += point[0];
				 center.y += point[1];
				 center.z += point[2];
				 size += 1.0;

				 if (point[0] < min.x) min.x = point[0];
				 if (point[1] < min.y) min.y = point[1];
				 if (point[2] < min.z) min.z = point[2];

				 if (point[0] > max.x) max.x = point[0];
				 if (point[1] > max.y) max.y = point[1];
				 if (point[2] > max.z) max.z = point[2];
			 }
		}

		//std::cout << std::endl << std::endl << min << " " << max << std::endl << std::endl;
		if (size > 1000)
		{
			center.x /= size;
			center.y /= size;
			center.z /= size;
			//center.z = -(center.x*plane.a + center.y*plane.b + plane.d)/plane.c;
		}
		else return false;

		scale.x = max.x - min.x;
		if (scale.x > 3)
			scale.x = 3;
		scale.y = max.y - min.y;
		if (scale.y > 3)
			scale.y = 3;
		scale.z = max.z - min.z;
		if (scale.z > 3)
			scale.z = 3;

		std::cout << size << std::endl;
		return true;
	}
Exemplo n.º 7
0
void arahant()
{
 aaa(xnxt,ynxt,h,wa);
 rrr(xnxt,ynxt,h,wr);
 aaa(xnxt,ynxt,h,wa);
 hhh(xnxt,ynxt,h,wh);
 aaa(xnxt,ynxt,h,wa);
 nnn(xnxt,ynxt,h,wn);
 ttt(xnxt,ynxt,h,wt);
 xnxt+=s/2;
 aaa(xnxt,ynxt,h,wa);
 xnxt+=s/2;
 n1(xnxt,ynxt,h,w1);
 n1(xnxt,ynxt,h,w1);
 iii(xnxt,ynxt,h,wi);
 ttt(xnxt,ynxt,h,wt);
 n1(xnxt,ynxt,h,w1);
 n0(xnxt,ynxt,h,w0);
}
Exemplo n.º 8
0
void balloon1()
{
 bbb(xnxt,ynxt,h,wb);
 aaa(xnxt,ynxt,h,wa);
 lll(xnxt,ynxt,h,wl);
 lll(xnxt,ynxt,h,wl);
 ooo(xnxt,ynxt,h,wo);
 ooo(xnxt,ynxt,h,wo);
 nnn(xnxt,ynxt,h,wn);
}
Exemplo n.º 9
0
int
main ()
{
  int i;

  for (i = 0; i < 10; i++)
    aaa (123);

  return 0;
}
Exemplo n.º 10
0
void dhanush()
{
 ddd(xnxt,ynxt,h,wd);
 hhh(xnxt,ynxt,h,wh);
 aaa(xnxt,ynxt,h,wa);
 nnn(xnxt,ynxt,h,wn);
 uuu(xnxt,ynxt,h,wu);
 sss(xnxt,ynxt,h,ws);
 hhh(xnxt,ynxt,h,wh);
 xnxt+=s/2;
 aaa(xnxt,ynxt,h,wa);
 xnxt+=s/2;
 n1(xnxt,ynxt,h,w1);
 n1(xnxt,ynxt,h,w1);
 iii(xnxt,ynxt,h,wi);
 ttt(xnxt,ynxt,h,wt);
 n1(xnxt,ynxt,h,w1);
 n8(xnxt,ynxt,h,w8);
}
Exemplo n.º 11
0
void guidance()
{
 ggg(xnxt,ynxt,h,wg);
 uuu(xnxt,ynxt,h,wu);
 iii(xnxt,ynxt,h,wi);
 ddd(xnxt,ynxt,h,wd);
 aaa(xnxt,ynxt,h,wa);
 nnn(xnxt,ynxt,h,wn);
 ccc(xnxt,ynxt,h,wc);
 eee(xnxt,ynxt,h,we);
}
Exemplo n.º 12
0
void madam()
{
 mmm(xnxt,ynxt,h,wm);
 rrr(xnxt,ynxt,h,wr);
 sss(xnxt,ynxt,h,ws);
 fs(xnxt,ynxt);
 ppp(xnxt,ynxt,h,wp);
 uuu(xnxt,ynxt,h,wu);
 sss(xnxt,ynxt,h,ws);
 hhh(xnxt,ynxt,h,wh);
 ppp(xnxt,ynxt,h,wp);
 aaa(xnxt,ynxt,h,wa);
 lll(xnxt,ynxt,h,wl);
 aaa(xnxt,ynxt,h,wa);
 ttt(xnxt,ynxt,h,wt);
 hhh(xnxt,ynxt,h,wh);
 aaa(xnxt,ynxt,h,wa);


}
Exemplo n.º 13
0
void graphics()
{
 ggg(xnxt,ynxt,h,wg);
 rrr(xnxt,ynxt,h,wr);
 aaa(xnxt,ynxt,h,wa);
 ppp(xnxt,ynxt,h,wp);
 hhh(xnxt,ynxt,h,wh);
 iii(xnxt,ynxt,h,wi);
 ccc(xnxt,ynxt,h,wc);
 sss(xnxt,ynxt,h,ws);
}
Exemplo n.º 14
0
void harsha()
{
 sss(xnxt,ynxt,h,ws);
 hhh(xnxt,ynxt,h,wh);
 rrr(xnxt,ynxt,h,wr);
 eee(xnxt,ynxt,h,we);
 eee(xnxt,ynxt,h,we);
 hhh(xnxt,ynxt,h,wh);
 aaa(xnxt,ynxt,h,wa);
 rrr(xnxt,ynxt,h,wr);
 sss(xnxt,ynxt,h,ws);
 hhh(xnxt,ynxt,h,wh);
 aaa(xnxt,ynxt,h,wa);
 xnxt+=s/2;
 n1(xnxt,ynxt,h,w1);
 n1(xnxt,ynxt,h,w1);
 iii(xnxt,ynxt,h,wi);
 ttt(xnxt,ynxt,h,wt);
 n8(xnxt,ynxt,h,w8);
 n8(xnxt,ynxt,h,w8);
}
Exemplo n.º 15
0
int foo ()
{
    struct  
    {
        int operator() ()
        {
            return 2;
        };
    } aaa;

    return (aaa());
};
Exemplo n.º 16
0
void game()
{
 ggg(xnxt,ynxt,h,wg);
 aaa(xnxt,ynxt,h,wa);
 mmm(xnxt,ynxt,h,wm);
 eee(xnxt,ynxt,h,we);
ynxt-=3*s/2;xnxt-=3*s;
 ooo(xnxt,ynxt,h,wo);
 vvv(xnxt,ynxt,h,wv);
 eee(xnxt,ynxt,h,we);
 rrr(xnxt,ynxt,h,wr);
}
Exemplo n.º 17
0
fourth()
{
 n4(xnxt,ynxt,h,w4);
 fs(xnxt,ynxt);
xnxt+=s/2;
 ggg(xnxt,ynxt,h,wg);
 aaa(xnxt,ynxt,h,wa);
 mmm(xnxt,ynxt,h,wm);
 eee(xnxt,ynxt,h,we);
xnxt+=s/2;
 ooo(xnxt,ynxt,h,wo);
 vvv(xnxt,ynxt,h,wv);
 eee(xnxt,ynxt,h,we);
 rrr(xnxt,ynxt,h,wr);
xnxt+=s/2;
 iii(xnxt,ynxt,h,wi);
 fff(xnxt,ynxt,h,wf);
xnxt+=s/2;
 yyy(xnxt,ynxt,h,wy);
 ooo(xnxt,ynxt,h,wo);
 uuu(xnxt,ynxt,h,wu);
xnxt+=s/2;
 mmm(xnxt,ynxt,h,wm);
 iii(xnxt,ynxt,h,wi);
 sss(xnxt,ynxt,h,ws);
 sss(xnxt,ynxt,h,ws);
xnxt+=s/2;
 n5(xnxt,ynxt,h,w5);
xnxt+=s/2;
 bbb(xnxt,ynxt,h,wb);
 aaa(xnxt,ynxt,h,wa);
 lll(xnxt,ynxt,h,wl);
 lll(xnxt,ynxt,h,wl);
 ooo(xnxt,ynxt,h,wo);
 ooo(xnxt,ynxt,h,wo);
 nnn(xnxt,ynxt,h,wn);
 sss(xnxt,ynxt,h,ws);
  
}
Exemplo n.º 18
0
void how()
{
 hhh(xnxt,ynxt,h,wh);
 ooo(xnxt,ynxt,h,wo);
 www(xnxt,ynxt,h,ww);
 xnxt+=s/2;
 ttt(xnxt,ynxt,h,wt);
 ooo(xnxt,ynxt,h,wo);
 xnxt+=s/2;
 ppp(xnxt,ynxt,h,wp);
 lll(xnxt,ynxt,h,wl);
 aaa(xnxt,ynxt,h,wa);
 yyy(xnxt,ynxt,h,wy);
}
Exemplo n.º 19
0
void sir()
{
 mmm(xnxt,ynxt,h,wm);
 rrr(xnxt,ynxt,h,wr);
 fs(xnxt,ynxt);
 sss(xnxt,ynxt,h,ws);
 hhh(xnxt,ynxt,h,wh);
 rrr(xnxt,ynxt,h,wr);
 iii(xnxt,ynxt,h,wi);
 ddd(xnxt,ynxt,h,wd);
 hhh(xnxt,ynxt,h,wh);
 aaa(xnxt,ynxt,h,wa);
 rrr(xnxt,ynxt,h,wr);
}
Exemplo n.º 20
0
void shreeman()
{
 sss(xnxt,ynxt,h,ws);
 hhh(xnxt,ynxt,h,wh);
 rrr(xnxt,ynxt,h,wr);
 eee(xnxt,ynxt,h,we);
 eee(xnxt,ynxt,h,we);
 mmm(xnxt,ynxt,h,wm);
 aaa(xnxt,ynxt,h,wa);
 nnn(xnxt,ynxt,h,wn);
 xnxt+=s/2;
 n1(xnxt,ynxt,h,w1);
 n1(xnxt,ynxt,h,w1);
 iii(xnxt,ynxt,h,wi);
 ttt(xnxt,ynxt,h,wt);
 n8(xnxt,ynxt,h,w8);
 n9(xnxt,ynxt,h,w9);
}
Exemplo n.º 21
0
void CPostset::HtmlToBytearray(char *src_, int nLen_, QByteArray &target_)
{
    char *p = src_;
    for (int i = 0; i < nLen_;++i)
    {
        if (*p == '%')
        {
            QByteArray aaa(p+1,2);
//            qDebug()<<"aaa"<<aaa.fromHex(aaa);
            i+=2;
            p+=2;
            target_.append(aaa.fromHex(aaa));
        }else
        {
            target_.append(p,1);
        }
        p++;
//        qDebug()<<i<<*p;
    }
}
Exemplo n.º 22
0
void ashrith()
{
 aaa(xnxt,ynxt,h,wa);
 sss(xnxt,ynxt,h,ws);
 hhh(xnxt,ynxt,h,wh);
 rrr(xnxt,ynxt,h,wr);
 iii(xnxt,ynxt,h,wi);
 ttt(xnxt,ynxt,h,wt);
 hhh(xnxt,ynxt,h,wh);
 xnxt+=s/2;
 hhh(xnxt,ynxt,h,wh);
 xnxt+=s/2;
 ccc(xnxt,ynxt,h,wc);
 xnxt+=s/2;
 n1(xnxt,ynxt,h,w1);
 n1(xnxt,ynxt,h,w1);
 iii(xnxt,ynxt,h,wi);
 ttt(xnxt,ynxt,h,wt);
 n1(xnxt,ynxt,h,w1);
 n1(xnxt,ynxt,h,w1);
}
Exemplo n.º 23
0
third()
{
 n3(xnxt,ynxt,h,w3);
 fs(xnxt,ynxt);
xnxt+=s/2;
 ppp(xnxt,ynxt,h,wp);
 rrr(xnxt,ynxt,h,wr);
 eee(xnxt,ynxt,h,we);
 sss(xnxt,ynxt,h,ws);
 sss(xnxt,ynxt,h,ws);
xnxt+=s/2;
 eee(xnxt,ynxt,3*h/4,3*we/4);
 nnn(xnxt,ynxt,3*h/4,3*wn/4);
 ttt(xnxt,ynxt,3*h/4,3*wt/4);
 eee(xnxt,ynxt,3*h/4,3*we/4);
 rrr(xnxt,ynxt,3*h/4,3*wr/4);
xnxt+=s/2;
 ttt(xnxt,ynxt,h,wt);
 ooo(xnxt,ynxt,h,wo);
xnxt+=s/2;
 sss(xnxt,ynxt,h,ws);
 hhh(xnxt,ynxt,h,wh);
 ooo(xnxt,ynxt,h,wo);
 ooo(xnxt,ynxt,h,wo);
 ttt(xnxt,ynxt,h,wt);
xnxt+=s/2;
 ttt(xnxt,ynxt,h,wt);
 hhh(xnxt,ynxt,h,wh);
 eee(xnxt,ynxt,h,we);
xnxt+=s/2;
 aaa(xnxt,ynxt,h,wa);
 rrr(xnxt,ynxt,h,wr);
 rrr(xnxt,ynxt,h,wr);
 ooo(xnxt,ynxt,h,wo);
 www(xnxt,ynxt,h,ww);
}
Exemplo n.º 24
0
Arquivo: b.c Projeto: AleemDev/waf
int bbb() {
	return aaa();
}
Exemplo n.º 25
0
void useit() {
  aaa();
}
Exemplo n.º 26
0
int main(int argc, char *argv[])
{
    paracel::main_env comm_main_env(argc, argv);
    paracel::Comm comm(MPI_COMM_WORLD);
    int rk = comm.get_rank();
    int sz = comm.get_size();
    auto f = []() {
        int b = 1;
    };
    comm.get_rank();

    {   // builtin send + recv
        if(rk == 0) {
            int a = 7;
            comm.send(a, 1, 2014);
        } else if(rk == 1) {
            int b = 0;
            comm.recv(b, 0, 2014);
            std::cout << b << std::endl;
        }
    }

    {   // isend + recv
        if(rk == 0) {
            int a = 7;
            MPI_Request req;
            req = comm.isend(a, 1, 2014);
        } else if(rk == 1) {
            int b = 0;
            comm.recv(b, 0, 2014);
            std::cout << b << std::endl;
        }
    }

    {   // container send + recv
        if(rk == 0) {
            std::vector<int> aa {77, 88};
            comm.send(aa, 1, 2014);
        } else if(rk == 1) {
            std::vector<int> bb;
            comm.recv(bb, 0, 2014);
            for(auto & item : bb)
                std::cout << item << std::endl;
        }
    }

    {   // container isend + recv
        if(rk == 0) {
            std::vector<int> aa {77, 88};
            MPI_Request req;
            req = comm.isend(aa, 1, 2014);
        } else if(rk == 1) {
            std::vector<int> bb;
            comm.recv(bb, 0, 2014);
            for(auto & item : bb)
                std::cout << item << std::endl;
        }
    }

    {   // paracel triple send + recv
        if(rk == 0) {
            std::tuple<std::string, std::string, double> aa;
            std::get<0>(aa) = "abc";
            std::get<1>(aa) = "def";
            std::get<2>(aa) = 3.14;
            MPI_Request req;
            req = comm.isend(aa, 1, 2014);
        } else if(rk == 1) {
            std::tuple<std::string, std::string, double> bb;
            comm.recv(bb, 0, 2014);
            std::cout << "deniug" << std::get<0>(bb) << "--" << std::get<1>(bb) << "--" << std::get<2>(bb) << std::endl;
        }
    }

    {   // paracel list of triple send + recv
        if(rk == 0) {
            std::vector<std::tuple<std::string, std::string, double> > aa;
            std::tuple<std::string, std::string, double> tmp1;
            std::get<0>(tmp1) = "abc";
            std::get<1>(tmp1) = "def";
            std::get<2>(tmp1) = 4.15;
            aa.push_back(tmp1);
            std::tuple<std::string, std::string, double> tmp2;
            std::get<0>(tmp2) = "cba";
            std::get<1>(tmp2) = "fed";
            std::get<2>(tmp2) = 5.16;
            aa.push_back(tmp2);
            MPI_Request req;
            req = comm.isend(aa, 1, 2014);
        } else if(rk == 1) {
            std::vector<std::tuple<std::string, std::string, double> > bb;
            comm.recv(bb, 0, 2014);
            for(auto & item : bb) {
                std::cout << "test" << std::get<0>(item) << "--" << std::get<1>(item) << "--" << std::get<2>(item) << std::endl;
            }
        }
    }

    {   // another paracel list of triple send + recv
        if(rk == 0) {
            std::vector<std::tuple<std::string, std::string, double> > aa;
            std::tuple<std::string, std::string, double> tmp1;
            std::get<0>(tmp1) = "abc";
            std::get<1>(tmp1) = "def";
            std::get<2>(tmp1) = 4.15;
            aa.push_back(tmp1);
            std::tuple<std::string, std::string, double> tmp2;
            aa.push_back(tmp2);
            MPI_Request req;
            req = comm.isend(aa, 1, 2014);
        } else if(rk == 1) {
            std::vector<std::tuple<std::string, std::string, double> > bb;
            comm.recv(bb, 0, 2014);
            for(auto & item : bb) {
                std::cout << "check " << std::get<0>(item) << "--" << std::get<1>(item) << "--" << std::get<2>(item) << std::endl;
            }
        }
    }

    {   // builtin sendrecv
        int a = 8;
        int b;
        int left, right;
        right = (rk + 1) % sz;
        left = rk - 1;
        if(left < 0) left = sz - 1;
        comm.sendrecv(a, b, left, 2014, right, 2014);
        std::cout << "b" << b << std::endl;
    }

    {   // container sendrecv
        std::vector<int> aaa{1,2,3};
        std::vector<int> bbb;
        int left, right;
        right = (rk + 1) % sz;
        left = rk - 1;
        if(left < 0) left = sz - 1;
        comm.sendrecv(aaa, bbb, left, 2014, right, 2014);
        for(auto & item : bbb)
            std::cout << item << std::endl;
    }

    {   // paracel triple sendrecv
        std::tuple<std::string, std::string, double> aa;
        std::tuple<std::string, std::string, double> bb;
        std::get<0>(aa) = "abc";
        std::get<1>(aa) = "def";
        std::get<2>(aa) = 3.14;
        int left, right;
        right = (rk + 1) % sz;
        left = rk - 1;
        if(left < 0) left = sz - 1;
        comm.sendrecv(aa, bb, left, 2014, right, 2014);
        std::cout << "triple sendrecv" << std::get<0>(bb) << "--" << std::get<1>(bb) << "--" << std::get<2>(bb) << std::endl;
    }

    {   // paracel list of triple sendrecv
        std::vector<std::tuple<std::string, std::string, double> > bb;
        std::vector<std::tuple<std::string, std::string, double> > aa;
        std::tuple<std::string, std::string, double> tmp1;
        std::get<0>(tmp1) = "abc";
        std::get<1>(tmp1) = "def";
        std::get<2>(tmp1) = 4.15;
        aa.push_back(tmp1);
        std::tuple<std::string, std::string, double> tmp2;
        std::get<0>(tmp2) = "cba";
        std::get<1>(tmp2) = "fed";
        std::get<2>(tmp2) = 5.16;
        aa.push_back(tmp2);
        int left, right;
        right = (rk + 1) % sz;
        left = rk - 1;
        if(left < 0) left = sz - 1;
        comm.sendrecv(aa, bb, left, 2014, right, 2014);
        for(auto & item : bb) {
            std::cout << "test sendrecv" << std::get<0>(item) << "--" << std::get<1>(item) << "--" << std::get<2>(item) << std::endl;
        }
    }

    {   // another paracel list of triple sendrecv
        std::vector<std::tuple<std::string, std::string, double> > bb;
        std::vector<std::tuple<std::string, std::string, double> > aa;
        std::tuple<std::string, std::string, double> tmp1;
        std::get<0>(tmp1) = "abc";
        std::get<1>(tmp1) = "def";
        std::get<2>(tmp1) = 4.15;
        std::tuple<std::string, std::string, double> tmp2;
        aa.push_back(tmp2);
        aa.push_back(tmp1);
        int left, right;
        right = (rk + 1) % sz;
        left = rk - 1;
        if(left < 0) left = sz - 1;
        comm.sendrecv(aa, bb, left, 2014, right, 2014);
        for(auto & item : bb) {
            std::cout << "another test sendrecv" << std::get<0>(item) << "--" << std::get<1>(item) << "--" << std::get<2>(item) << std::endl;
        }
    }

    {   // debug for list of triple sendrecv
        std::vector<std::vector<std::tuple<std::string, std::string, double> > > aa(2);
        std::vector<std::tuple<std::string, std::string, double> > bb;
        int t, f;
        if(rk == 0) {
            std::vector<std::tuple<std::string, std::string, double> > aaa;
            std::tuple<std::string, std::string, double> tmp1;
            std::get<0>(tmp1) = "a";
            std::get<1>(tmp1) = "b";
            std::get<2>(tmp1) = 1.;
            aaa.push_back(tmp1);
            std::get<0>(tmp1) = "a";
            std::get<1>(tmp1) = "c";
            std::get<2>(tmp1) = 1.;
            aaa.push_back(tmp1);
            std::get<0>(tmp1) = "a";
            std::get<1>(tmp1) = "d";
            std::get<2>(tmp1) = 1.;
            aaa.push_back(tmp1);
            std::get<0>(tmp1) = "b";
            std::get<1>(tmp1) = "a";
            std::get<2>(tmp1) = 1.;
            aaa.push_back(tmp1);
            aa[1] = aaa;
            t = 1;
            f = 1;
        } else if(rk == 1) {
            std::vector<std::tuple<std::string, std::string, double> > aaa;
            std::tuple<std::string, std::string, double> tmp1;
            std::get<0>(tmp1) = "e";
            std::get<1>(tmp1) = "a";
            std::get<2>(tmp1) = 1.;
            aaa.push_back(tmp1);
            std::get<0>(tmp1) = "e";
            std::get<1>(tmp1) = "d";
            std::get<2>(tmp1) = 1.;
            aaa.push_back(tmp1);
            aa[0] = aaa;

            std::vector<std::tuple<std::string, std::string, double> > aaaa;
            std::tuple<std::string, std::string, double> tmp2;
            std::get<0>(tmp2) = "b";
            std::get<1>(tmp2) = "d";
            std::get<2>(tmp2) = 1.;
            aaaa.push_back(tmp2);
            std::get<0>(tmp2) = "d";
            std::get<1>(tmp2) = "c";
            std::get<2>(tmp2) = 1.;
            aaaa.push_back(tmp2);
            aa[1] = aaaa;
            f = 0;
            t = 0;
        }
        comm.sendrecv(aa[t], bb, t, 2014, f, 2014);
    }

    {   // builtin bcast
        int a;
        if(rk == 0) a = 7;
        comm.bcast(a, 0);
        std::cout << "rk " << rk << " a " << a << std::endl;
    }

    {   // container bcast
        std::vector<int> aa(2);
        if(rk == 0) {
            aa[0] = 3;
            aa[1] = 4;
        }
        comm.bcast(aa, 0);
        std::cout << "rk " << rk << " aa0 " << aa[0] << " aa1 " << aa[1] << std::endl;
    }

    {   // builtin alltoall
        std::vector<int> a(2), b(2);
        if(rk == 0) {
            a[0] = 1;
            a[1] = 3;
        }
        if(rk == 1) {
            a[0] = 2;
            a[1] = 4;
        }
        comm.alltoall(a, b);
        std::cout << " rk " << rk << b[0] << " " << b[1] << std::endl;
    }

    {   // container alltoall
        std::vector< std::vector<int> > a(2), b;
        if(rk == 0) {
            std::vector<int> tmp1{1, 5};
            std::vector<int> tmp2{3};
            a[0] = tmp1;
            a[1] = tmp2;
        }
        if(rk == 1) {
            std::vector<int> tmp1{2};
            std::vector<int> tmp2{4, 7};
            a[0] = tmp1;
            a[1] = tmp2;
        }
        comm.alltoall(a, b);
        if(rk == 1) {
            for(auto & item : b[0])
                std::cout << " test " << item << " ";
            std::cout << "sep" << std::endl;
            for (auto & item : b[1])
                std::cout << " test " << item << " ";
            std::cout << std::endl;
        }
    }

    {   // builtin allreduce
        int aaa;
        if(rk == 0) {
            aaa = 1;
        }
        if(rk == 1) {
            aaa = 2;
        }
        comm.allreduce(aaa);
        std::cout << " rk " << rk << " result " << aaa << std::endl;
    }

    {   // container allreduce
        std::vector<int> aaa(3);
        if(rk == 0) {
            aaa[0] = 1;
            aaa[1] = 2;
            aaa[2] = 3;
        }
        if(rk == 1) {
            aaa[0] = 3;
            aaa[1] = 2;
            aaa[2] = 1;
        }
        comm.allreduce(aaa);
        for(auto & item : aaa)
            std::cout << " rk " << rk << " result aaa " << item << std::endl;
    }

    {   // bcastring
        std::vector<int> a;
        if(rk == 0) {
            a.push_back(6);
            a.push_back(42);
        }
        if(rk == 1) {
            a.push_back(28);
            a.push_back(42);
            a.push_back(42);
            a.push_back(28);
            a.push_back(6);
        }
        std::set<int> result;
        auto func = [&](std::vector<int> tmp) {
            for(auto & stf : tmp)
                result.insert(stf);
        };
        comm.bcastring(a, func);
        for(auto & item : result) {
            std::cout << rk << " : "<< item << std::endl;
        }
    }

    {   // dict_type<size_t, int> isend
        if(rk == 0) {
            std::unordered_map<size_t, int> aa;
            aa[0] = 1;
            aa[1] = 2;
            MPI_Request req;
            req = comm.isend(aa, 1, 2014);
        } else if(rk == 1) {
            std::unordered_map<size_t, int> bb;
            comm.recv(bb, 0, 2014);
            for(auto & item : bb)
                std::cout << item.first << " * " << item.second << std::endl;
        }
    }

    {   // alltoall

    }

    return 0;
}
Exemplo n.º 27
0
int main ( void ) { www(); aaa(); return 0; }
Exemplo n.º 28
0
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Updates sent planes using but environment model server
	// @param planes Vector of found planes
	// @param scene_cloud point cloud of the scene
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	void DynModelExporter2::update(std::vector<Plane<float> > & planes, Normals &normals)
	{
		if (m_keep_tracking == 0)
			displayed_planes.clear();
		std::vector<PointCloud<pcl::PointXYZ>, Eigen::aligned_allocator<PointCloud<pcl::PointXYZ> > > planesInPCloud(planes.size());

		for (int i = 0; i < normals.m_points.rows; ++i)
		for (int j = 0; j < normals.m_points.cols; ++j)
		{
			Vec3f point = normals.m_points.at<Vec3f>(i, j);
			cv::Vec4f localPlane = normals.m_planes.at<cv::Vec4f>(i, j);
			Plane<float> aaa(localPlane[0], localPlane[1], localPlane[2], localPlane[3]);

			double dist = DBL_MAX;
			int chosen = -1;
			// find the best plane
			for (unsigned int a = 0; a < planes.size(); ++a)
			{
				if (planes[a].distance(point) < dist && planes[a].distance(point) < m_max_distance &&
					planes[a].isSimilar(aaa, m_max_plane_normal_dev, m_max_plane_shift_dev))
				{
					dist = planes[a].distance(point);
					chosen = a;
				}
			}

			// if there is good plane, insert point into point cloud
			if (chosen > -1)
			{
				PointXYZ pclpoint(point[0], point[1], point[2]);
				planesInPCloud[chosen].push_back(pclpoint);
			}
		}

		// Indexed in point cloud
		////////////////////////////////////////////////////////////////////////////////////////////////

		for (unsigned int j = 0; j < planesInPCloud.size(); ++j)
		{
			if (planesInPCloud[j].size() > 20)
			{
				double maxangle = DBL_MAX;
				double maxdist = DBL_MAX;
				int index = -1;
				for (unsigned int i = 0; i < displayed_planes.size(); ++i)
				{
					double angle = acos(((planes[j].a * displayed_planes[i].plane.a) + (planes[j].b * displayed_planes[i].plane.b) + (planes[j].c * displayed_planes[i].plane.c)));
					double xd = planes[j].d - displayed_planes[i].plane.d;
					xd = (xd > 0 ? xd : - xd);

					// Pretty nasty workaround... todo
					if (angle != angle) angle = 0.0;

					if (angle <= maxangle  && xd <= maxdist && angle < 0.2  && xd < 0.2)
					{
						maxangle = angle;
						maxdist = xd;
						index = i;
					}
				}

				if (index >= 0)
				{
					for (unsigned int i = 0; i < displayed_planes[index].marker.points.size(); ++i)
					{
						geometry_msgs::Point p = displayed_planes[index].marker.points[i];
						planesInPCloud[j].push_back(PointXYZ(p.x, p.y, p.z));
					}

					pcl::ModelCoefficientsPtr coefs(new pcl::ModelCoefficients());
					coefs->values.push_back(displayed_planes[index].plane.a);
					coefs->values.push_back(displayed_planes[index].plane.b);
					coefs->values.push_back(displayed_planes[index].plane.c);
					coefs->values.push_back(displayed_planes[index].plane.d);

					DynModelExporter2::createMarkerForConvexHull(planesInPCloud[j], coefs, displayed_planes[index].marker);
				}
				else
				{
					pcl::ModelCoefficientsPtr coefs(new pcl::ModelCoefficients());

					coefs->values.push_back(planes[j].a);
					coefs->values.push_back(planes[j].b);
					coefs->values.push_back(planes[j].c);
					coefs->values.push_back(planes[j].d);


//					std::cerr << planes[j].a << " ";
//					std::cerr << planes[j].b << " ";
//					std::cerr << planes[j].c << " ";
//					std::cerr << planes[j].d << std::endl;

					visualization_msgs::Marker marker;

					DynModelExporter2::createMarkerForConvexHull(planesInPCloud[j], coefs, marker);
					marker.id = displayed_planes.size()+1;
					marker.ns = "Normals";
					marker.pose.position.x = 0.0;
					marker.pose.position.y = 0.0;
					marker.pose.position.z = 0.0;
					marker.pose.orientation.x = 0.0;
					marker.pose.orientation.y = 0.0;
					marker.pose.orientation.z = 0.0;
					marker.pose.orientation.w = 1.0;
					marker.scale.x = 1;
					marker.scale.y = 1;
					marker.scale.z = 1;
					marker.color.r = 0.5;
					marker.color.g = 0.0;
					marker.color.b = 0.0;
					marker.color.a = 0.8;

					ExportedPlane newplane;
					newplane.id = index;
					newplane.marker = marker;
					newplane.plane = planes[j];
					displayed_planes.push_back(newplane);
				}
			}
		}
		std::cerr << displayed_planes.size() << std::endl;
	}
int main() {
	int number;
	int a, b, c, d;
	while (scanf("%d", &number) != EOF) {
		if (number <= 10) {
			if (number < 10) {
				a = number % 10;
				Single_digits1(a);
			}
			else if (number == 10) {
				printf("Ⅹ\n");
			}
		}
		else if (number <= 50) {
			if (number < 50) {
				b = number / 10;
				if (b == 1)
					printf("Ⅹ");
				else if (b == 2)
					printf("ⅩⅩ");
				else if (b == 3)
					printf("ⅩⅩⅩ");
				else if (b == 4)
					printf("ⅩL");
				c = number % 10;
				Single_digits1(c);
			}
			else if (number == 50) {
				printf("L\n");
			}
		}
		else if (number <= 100) {
			if (number < 100) {

				int a1 = number - 50;
				aaa(a1);
			}
			else if (number == 100)
				printf("C\n");
		}
		else if (number <= 500) {
			if (number < 500) {
				int vv;
				vv = number / 100;
				if (vv == 1) {
					printf("C");
				}
				else if (vv == 2) {
					printf("CC");

				}
				else if (vv == 3) {
					printf("CCC");
				}
				else if (vv == 4) {
					printf("CD");
				}
			}
			else if (number == 500)
				printf("D\n");
		}
		else if (number < 1000) {
		}
		else if (number < 4000) {
		}

	}

	return 0;
}
Exemplo n.º 30
0
int
main ()
{
    aaa (123);
    return 0;
}