14 #include <myramath/multifrontal/symbolic/detail/Graph.h> 15 #include <myramath/multifrontal/symbolic/detail/VertexCut.h> 19 #include <myramath/multifrontal/symbolic/detail/vcut.h> 22 #include <tests/myratest.h> 27 ADD_TEST(
"vcut1",
"[symbolic]")
30 graph.push_vertex( Graph::Vertex(0,1) );
35 VertexCut cut = vcut(graph);
37 REQUIRE(cut.group[0]==2);
41 ADD_TEST(
"vcut2",
"[symbolic]")
44 graph.push_vertex( Graph::Vertex(0,2) );
45 graph.push_vertex( Graph::Vertex(1,1) );
47 graph.push_edge( Graph::Edge(0,1) );
50 graph.push_edge( Graph::Edge(1,0) );
54 VertexCut cut = vcut(graph);
56 REQUIRE(cut.group[0]!=2);
57 REQUIRE(cut.group[1]==2);
61 ADD_TEST(
"vcut3",
"[symbolic]")
64 graph.push_vertex( Graph::Vertex(0,1) );
65 graph.push_vertex( Graph::Vertex(1,1) );
66 graph.push_vertex( Graph::Vertex(2,1) );
68 graph.push_edge( Graph::Edge(0,1) );
71 graph.push_edge( Graph::Edge(1,0) );
72 graph.push_edge( Graph::Edge(1,2) );
75 graph.push_edge( Graph::Edge(2,1) );
79 VertexCut cut = vcut(graph);
81 REQUIRE(cut.group[0]!=2);
82 REQUIRE(cut.group[1]==2);
83 REQUIRE(cut.group[2]!=2);
84 REQUIRE(cut.group[0]!=cut.group[2]);
88 ADD_TEST(
"vcut_structured",
"[symbolic][.]")
91 Graph graph = make_Graph(P);
93 VertexCut cut = vcut(graph);
95 myra::out() <<
"cut.weight[0|2|1] = " << cut.weight[0] <<
"|" << cut.weight[2] <<
"|" << cut.weight[1] << std::endl;
96 REQUIRE(cut.weight[2] < cut.weight[0]);
97 REQUIRE(cut.weight[2] < cut.weight[1]);
Range/Iterator types associated with Pattern.
Holds the nonzero pattern of a sparse matrix.
Definition: Pattern.h:55
Container class for a sparse nonzero pattern, used in reordering/symbolic analysis.
Helper routines for reordering/filling 2D structured grids. Used by many unit tests.