本文整理汇总了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;
}
示例2: GetLog
bool GetLog(bool ma_success) const { return g->GetLog(ma_success); }
示例3: GetDisplay
bool GetDisplay(bool ma_success) const { return g->GetDisplay(ma_success); }
示例4: GetName
const RichBool::detail::String& GetName(size_t idx) const
{ return idx==GetSize() ? GetLevelName(2) : g->GetName(idx); }
示例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;
}
示例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;
}
示例7: SetLog
void SetLog(bool b) const { g->SetLog(b); }
示例8: SetDisplay
void SetDisplay(bool b) const { g->SetDisplay(b); }
示例10: crea
__declspec(dllexport ) bool WINAPI crea()
{
return g.crea();
}
示例12: DeleteEdge
__declspec(dllexport ) bool WINAPI DeleteEdge(int a,int b)
{
return g.Delete_Edge(a,b);
}
示例13: CaminoMinimo
__declspec(dllexport ) bool WINAPI CaminoMinimo(int s,int t)
{
return g.camino_minimo_prim(s,t);
}
示例14: DeleteNode
__declspec(dllexport ) bool WINAPI DeleteNode(int n)
{
return g.Delete_Node(n);
}
示例15: InsertEdge
__declspec(dllexport ) bool WINAPI InsertEdge(double p,int a,int b)
{
return g.Insert_Edge(p,a,b);
}