From: Gary King Date: Fri, 28 Apr 2006 15:31:31 +0000 (-0400) Subject: Replaced some code that depends on copying X-Git-Url: http://repo.macrolet.net/gitweb/?p=cl-graph.git;a=commitdiff_plain;h=3e6caf777362fbe61b76b305e9b4aa1e80a60bc4 Replaced some code that depends on copying darcs-hash:20060428153131-3cc5d-76226c2d88872ed830374f4c5b974819a26aa688.gz --- diff --git a/dev/copying.lisp b/dev/copying.lisp index edb5dbe..e20961a 100644 --- a/dev/copying.lisp +++ b/dev/copying.lisp @@ -19,3 +19,9 @@ (metacopy:defcopy-methods graph-container-edge :copy-all t) +(defmethod generate-directed-free-tree ((graph basic-graph) (root basic-vertex)) + (let ((new-graph (metacopy:copy-thing graph))) + (empty! new-graph) + (nilf (contains-undirected-edge-p new-graph)) + (neighbors-to-children new-graph root) + (values new-graph))) \ No newline at end of file diff --git a/dev/graph-container.lisp b/dev/graph-container.lisp index 0865b2f..f7f09ad 100644 --- a/dev/graph-container.lisp +++ b/dev/graph-container.lisp @@ -20,7 +20,7 @@ DISCUSSION initial-contents-mixin basic-graph container-uses-nodes-mixin) - () + ((vertex-pair->edge (make-container 'simple-associative-container) r)) (:default-initargs :vertex-class 'graph-container-vertex :directed-edge-class 'graph-container-directed-edge diff --git a/dev/graph.lisp b/dev/graph.lisp index b2c1cf3..7143e6c 100644 --- a/dev/graph.lisp +++ b/dev/graph.lisp @@ -222,18 +222,6 @@ something is putting something on the vertexes plist's &allow-other-keys) (remf args :edge-class) (remf args :edge-type) - - #| I removed 'em, gwk - - ;;; I added these - jjm - (remf args :vertex-test) - (remf args :vertex-key) - (remf args :edge-key) - (remf args :edge-test) - (remf args :force-new?) - -|# - (assert (or (null edge-type) (eq edge-type :directed) (eq edge-type :undirected)) nil @@ -256,7 +244,6 @@ something is putting something on the vertexes plist's :graph graph :vertex-1 vertex-1 :vertex-2 vertex-2 args)) - ;;; --------------------------------------------------------------------------- (defmethod make-graph ((graph-type symbol) &rest args &key &allow-other-keys) @@ -804,16 +791,6 @@ something is putting something on the vertexes plist's ;;; --------------------------------------------------------------------------- -#+COPYING -(defmethod generate-directed-free-tree ((graph basic-graph) (root basic-vertex)) - (let ((new-graph (copy-top-level graph))) - (empty! new-graph) - (nilf (contains-undirected-edge-p new-graph)) - (neighbors-to-children new-graph root) - (values new-graph))) - -;;; --------------------------------------------------------------------------- - (defmethod generate-directed-free-tree ((graph basic-graph) root) (generate-directed-free-tree graph (find-vertex graph root)))