]> gitweb.factorcode.org Git - factor-unmaintained.git/blobdiff - graph-theory/reversals/reversals.factor
unmaintained: New home for misfit Factor vocabularies.
[factor-unmaintained.git] / graph-theory / reversals / reversals.factor
diff --git a/graph-theory/reversals/reversals.factor b/graph-theory/reversals/reversals.factor
new file mode 100644 (file)
index 0000000..1ea1a3f
--- /dev/null
@@ -0,0 +1,22 @@
+! Copyright (C) 2008 William Schlieper <schlieper@unc.edu>
+! See http://factorcode.org/license.txt for BSD license.
+
+USING: accessors kernel graph-theory ;
+
+IN: graph-theory.reversals
+
+TUPLE: reversal graph ;
+
+GENERIC: reverse-graph ( graph -- reversal )
+
+M: graph reverse-graph reversal boa ;
+
+M: reversal reverse-graph graph>> ;
+
+INSTANCE: reversal graph
+
+M: reversal vertices
+    graph>> vertices ;
+
+M: reversal adj?
+    swapd graph>> adj? ;