当前位置: 首页>>代码示例>>C++>>正文


C++ G类代码示例

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


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

示例1: main

int main()
{
  const Point<2> p1(0.0, 0.0), p2(1.0, 1.0);
  dealii::Triangulation<2> triangulation;
  dealii::GridGenerator::hyper_rectangle(triangulation, p1, p2);
  triangulation.refine_global(num_levels);

  const F<2> f;
  const G<2> g;

  // Create a TensorFunction from two scalar Functions
  const auto psi = internal::TensorFunctionFromScalarFunctions<2>(f, g);

  // Generate a bunch of random poins in the unit square
  std::random_device device;
  std::mt19937 rng;
  rng.seed(device());
  std::uniform_real_distribution<> u(0, 1);

  const size_t num_points = 32;
  std::vector<Point<2> > points(num_points);
  for (size_t k = 0; k < num_points; ++k) {
    points[k][0] = u(rng);
    points[k][1] = u(rng);
  }

  // Check that the TensorFunction and its coordinate functions agree at a
  // few points
  for (size_t k = 0; k < num_points; ++k) {
    const Point<2>& p = points[k];
    const Tensor<1, 2> v = psi.value(p);
    Tensor<1, 2> w;
    w[0] = f.value(p);
    w[1] = g.value(p);

    check((v - w).norm() < 1.0e-15);
  }

  return 0;
}
开发者ID:danshapero,项目名称:icepack,代码行数:40,代码来源:tensor_function_utils.cpp

示例2: GetLog

		bool GetLog(bool ma_success) const { return g->GetLog(ma_success); }
开发者ID:MarkVanPeteghem,项目名称:ModAssert,代码行数:1,代码来源:group.hpp

示例3: GetDisplay

		bool GetDisplay(bool ma_success) const { return g->GetDisplay(ma_success); }
开发者ID:MarkVanPeteghem,项目名称:ModAssert,代码行数:1,代码来源:group.hpp

示例4: GetName

		const RichBool::detail::String& GetName(size_t idx) const
		{ return idx==GetSize() ? GetLevelName(2) : g->GetName(idx); }
开发者ID:MarkVanPeteghem,项目名称:ModAssert,代码行数:2,代码来源:group.hpp

示例5: main

int main(){
    int cnt = 1;
    while(cin >> r >> x1 >> y01 >> x2 >> y2, r||x1||y01||x2||y2){
	cnr.clear();
	if(y2 <= 0){
	    y2 *= -1; y01 *= -1;
	    swap(y01, y2);
	}
	if(x2 <= 0){
	    x2 *= -1; x1 *= -1;
	    swap(x1, x2);
	}
	cnr.pb(P(x1,y01)); cnr.pb(P(x2,y01));
	cnr.pb(P(x2,y2)); cnr.pb(P(x1,y2));
	if(y01 < 0){
	    rep(i,4) cnr[i] = rotate(cnr[i], PI/2);
	    P tmp = cnr[3];
	    rep(i,3) cnr[i+1] = cnr[i];
	    cnr[0] = tmp;
	}
	x1 = cnr[0].real(); y01 = cnr[0].imag();
	x2 = cnr[2].real(); y2 = cnr[2].imag();
	w = x2 - x1; h = y2 - y01;
	cerr << "Case" << cnt++ << ": ";
	if(x1 < 0) solve1();
	else solve2();
    }
    return 0;
}
开发者ID:hadrori,项目名称:hadrori.github.io,代码行数:29,代码来源:1177_.cpp

示例6: main

int main ()
{
	int n;
	cin >> n;
	for (int i = 0 ; i < n ; i ++)
	{
		string line = ConsoleReadLine ();
		if (line == "")
		    line = ConsoleReadLine ();
		vector <string> splitted = vector <string> (Split (line, " ->"));
		int from = atoi (splitted [0].c_str ());
		for (int i = 1 ; i < (int)splitted.size () ; i ++)
		{
			int to = atoi (splitted [i].c_str ());
			graph.addEdge (from, to, 0);
		}
	}
	visited = new bool [n];
	for (int i = 0 ; i < n ; i ++)
		DFS (i);
	if (no_result)
		cout << "No cycles found\n";
	else
	    for (auto& x : output)
		cout << x;
	delete[] visited;
}
开发者ID:Alex-Tsvetanov,项目名称:Informatics,代码行数:27,代码来源:Problem+03.+Graph+Cycles.cpp

示例7: SetLog

		void SetLog(bool b) const { g->SetLog(b); }
开发者ID:MarkVanPeteghem,项目名称:ModAssert,代码行数:1,代码来源:group.hpp

示例8: SetDisplay

		void SetDisplay(bool b) const { g->SetDisplay(b); }
开发者ID:MarkVanPeteghem,项目名称:ModAssert,代码行数:1,代码来源:group.hpp

示例9: length

 length() { return p.size(); }
开发者ID:0day-ci,项目名称:gcc,代码行数:1,代码来源:pr61033.C

示例10: crea

__declspec(dllexport ) bool WINAPI crea()
{
	return g.crea();
}
开发者ID:rgap,项目名称:City-Routes-Planner,代码行数:4,代码来源:LibreriaC.cpp

示例11: ack

    void ack() {
	foo( 0 );
    }
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:3,代码来源:ns25.c

示例12: DeleteEdge

__declspec(dllexport ) bool WINAPI DeleteEdge(int a,int b)
{
	return g.Delete_Edge(a,b);
}
开发者ID:rgap,项目名称:City-Routes-Planner,代码行数:4,代码来源:LibreriaC.cpp

示例13: CaminoMinimo

__declspec(dllexport ) bool WINAPI CaminoMinimo(int s,int t)
{
	return g.camino_minimo_prim(s,t);
}
开发者ID:rgap,项目名称:City-Routes-Planner,代码行数:4,代码来源:LibreriaC.cpp

示例14: DeleteNode

__declspec(dllexport ) bool WINAPI DeleteNode(int n)
{
	return g.Delete_Node(n);
}
开发者ID:rgap,项目名称:City-Routes-Planner,代码行数:4,代码来源:LibreriaC.cpp

示例15: InsertEdge

__declspec(dllexport ) bool WINAPI InsertEdge(double p,int a,int b)
{
	return g.Insert_Edge(p,a,b);
}
开发者ID:rgap,项目名称:City-Routes-Planner,代码行数:4,代码来源:LibreriaC.cpp


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