X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=dev%2Fgraph-metrics.lisp;h=95dfe8a725b42a1919ffe2b95df2df640235df1d;hb=000a31e8bb29016b2f5c6f41146bca3385cecf99;hp=4a70726beab185ff0c540b027624120124b82ebe;hpb=438d1e0593dc62fe7b975a5865ec27955afcb7a1;p=cl-graph.git diff --git a/dev/graph-metrics.lisp b/dev/graph-metrics.lisp index 4a70726..95dfe8a 100644 --- a/dev/graph-metrics.lisp +++ b/dev/graph-metrics.lisp @@ -9,8 +9,15 @@ Author: Gary King DISCUSSION |# -(in-package metabang.graph) +(in-package #:metabang.graph) +(eval-always + (import '(cl-mathstats:matrix-trace + cl-mathstats:sum-of-array-elements + cl-mathstats:matrix-multiply + cl-mathstats:normalize-matrix + cl-mathstats:combination-count + ))) (defun vertex-degree-counts (g) "Returns an associative-container mapping edge-counts to the number of vertexes with that edge-count." @@ -67,7 +74,7 @@ DISCUSSION &key (edge-size (constantly 1))) "Prints a summary of vertex degrees in `graph` to standard-out. Both the average degree of all vertexes and the average degree between all pairs of vertex classes \(as determined by the vertex-classifier\) will be printed. The `edge-size` parameter is passed on to `vertex-degree` to allow for weighted edges." - (bind ((counts (node-counts graph :key vertex-classifier)) + (let ((counts (node-counts graph :key vertex-classifier)) (kinds (collect-elements counts :transform #'first))) (format t "~%Vertex counts: ") (loop for (kind count) in counts do