45#ifndef DOXYGEN_SHOULD_SKIP_THIS
54 if (ref.size() != test.size()) {
GUM_ERROR(OperationNotAllowed,
"Graphs of different sizes") }
55 for (
const NodeId node: ref.asNodeSet()) {
56 if (!test.existsNode(node)) {
57 GUM_ERROR(InvalidNode,
"Test doesn't contain all nodes from ref")
74 for (
const Arc& arc: ref.arcs()) {
75 if (test.existsArc(arc)) {
77 }
else if (test.existsArc(arc.head(), arc.tail())) {
83 for (
const Arc& arc: test.arcs()) {
84 if (!ref.existsArc(arc) && !ref.existsArc(arc.head(), arc.tail())) { ++
_wrong_arc_none_; }
92 if (ref.size() != test.size()) {
GUM_ERROR(OperationNotAllowed,
"Graphs of different sizes") }
93 for (
const NodeId node: ref.asNodeSet()) {
94 if (!test.existsNode(node)) {
95 GUM_ERROR(InvalidNode,
"Test doesn't contain all nodes from ref")
112 for (
const Edge& edge: ref.edges()) {
113 if (test.existsEdge(edge)) {
119 for (
const Edge& edge: test.edges()) {
128 if (ref.size() != test.size()) {
GUM_ERROR(OperationNotAllowed,
"Graphs of different sizes") }
129 for (
const NodeId node: ref.asNodeSet()) {
130 if (!test.existsNode(node)) {
131 GUM_ERROR(InvalidNode,
"Test doesn't contain all nodes from ref")
147 for (
const Arc& arc: ref.arcs()) {
148 if (test.existsArc(arc)) {
150 }
else if (test.existsArc(arc.head(), arc.tail())) {
152 }
else if (test.existsEdge(arc.tail(), arc.head())) {
158 for (
const Edge& edge: ref.edges()) {
159 if (test.existsEdge(edge)) {
161 }
else if (test.existsArc(edge.first(), edge.second())
162 || test.existsArc(edge.second(), edge.first())) {
168 for (
const Arc& arc: test.arcs()) {
169 if (!ref.existsArc(arc) && !ref.existsArc(arc.head(), arc.tail())
170 && !ref.existsEdge(arc.tail(), arc.head())) {
174 for (
const Edge& edge: test.edges()) {
175 if (!ref.existsEdge(edge) && !ref.existsArc(edge.first(), edge.second())
176 && !ref.existsArc(edge.second(), edge.first())) {
Base class for all oriented graphs.
Base class for partially directed acyclic graphs.
double _true_edge_
Confusion matrix.
~StructuralComparator()
destructor
double recall() const
compare two DiGraphs
double precision_skeleton() const
Measures for the skeleton, aka graph without orientations.
double precision() const
Measures for the graphs.
double recall_skeleton() const
compare two DiGraphs
StructuralComparator()
default constructor
double f_score_skeleton() const
compare two DiGraphs
void compare(const DiGraph &ref, const DiGraph &test)
compare two DiGraphs
double f_score() const
compare two DiGraphs
Base class for undirected graphs.
#define GUM_ERROR(type, msg)
Size NodeId
Type for node ids.
gum is the global namespace for all aGrUM entities
A class for comparing graphs based on their structures.