-Copyright (c) 2004-2006 Gary Warren King (gwking@metabang.com)
+Copyright (c) 2004-2007 Gary Warren King (gwking@metabang.com)
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
-;;; -*- Mode: Lisp; package: CL-USER; Syntax: Common-lisp; Base: 10 -*-
-
-#|
-
-|#
+;;; -*- Mode: Lisp; package: cl-user; Syntax: Common-lisp; Base: 10 -*-
(in-package :common-lisp-user)
(defpackage #:asdf-cl-graph-test (:use #:cl #:asdf))
:licence "MIT Style License"
:description "Tests for CL-Graph"
- :components ((:module "unit-tests"
- :components ((:file "package")
- (:file "test-graph" :depends-on ("package"))
- (:file "test-graph-container" :depends-on ("test-graph"))
- (:file "test-connected-components" :depends-on ("test-graph"))
- (:file "test-graph-metrics" :depends-on ("test-graph"))
- (:file "test-graph-algorithms" :depends-on ("test-graph"))
- ))
+ :components ((:module
+ "unit-tests"
+ :components
+ ((:file "package")
+ (:file "test-graph" :depends-on ("package"))
+ (:file "test-graph-container" :depends-on ("test-graph"))
+ (:file "test-connected-components" :depends-on ("test-graph"))
+ (:file "test-graph-metrics" :depends-on ("test-graph"))
+ (:file "test-graph-algorithms" :depends-on ("test-graph"))
+ ))
- (:module "dev"
- :components ((:static-file "notes.text"))))
-
- :in-order-to ((test-op (load-op cl-graph-test)))
+ (:module
+ "dev"
+ :components
+ ((:static-file "notes.text"))))
:depends-on (cl-graph lift))
-
-;;; ---------------------------------------------------------------------------
-
-(defmethod perform :after ((op test-op ) (c (eql (find-system 'cl-graph-test))))
- (describe
- (funcall
- (intern (symbol-name '#:run-tests) '#:lift)
- :suite (intern (symbol-name '#:cl-graph-test) '#:cl-graph-test))))
-
-;;; ---------------------------------------------------------------------------
-
-(defmethod perform :after ((o load-op) (c (eql (find-system 'cl-graph-test))))
- )
-
-(defmethod operation-done-p ((o test-op) (c (eql (find-system 'cl-graph-test))))
- ;; testing is never done...
- (values nil))
-;;; -*- Mode: Lisp; package: CL-USER; Syntax: Common-lisp; Base: 10 -*-
+;;; -*- Mode: Lisp; package: cl-user; Syntax: Common-lisp; Base: 10 -*-
-#|
-
-|#
-
-(in-package :common-lisp-user)
+(in-package #:common-lisp-user)
(defpackage #:asdf-cl-graph (:use #:cl #:asdf))
(in-package #:asdf-cl-graph)
(asdf:operate 'asdf:load-op 'asdf-system-connections)
(defsystem cl-graph
- :version "0.8"
+ :version "0.8.1"
:author "Gary Warren King <gwking@metabang.com>"
:maintainer "Gary Warren King <gwking@metabang.com>"
:licence "MIT Style License"
:description "Graph manipulation utilities for Common Lisp"
- :components ((:module "dev"
- :components ((:file "package")
- (:file "api"
- :depends-on ("package"))
- (:file "macros"
- :depends-on ("package"))
- (:file "graph"
- :depends-on ("api" "macros"))
- (:file "graph-container"
- :depends-on ("graph"))
- (:file "graph-matrix"
- :depends-on ("graph"))
- (:file "graph-metrics"
- :depends-on ("graph"))
- (:file "graph-algorithms"
- :depends-on ("graph"))
+ :components ((:module
+ "dev"
+ :components
+ ((:file "package")
+ (:file "api"
+ :depends-on ("package"))
+ (:file "macros"
+ :depends-on ("package"))
+ (:file "graph"
+ :depends-on ("api" "macros"))
+ (:file "graph-container"
+ :depends-on ("graph"))
+ (:file "graph-matrix"
+ :depends-on ("graph"))
+ (:file "graph-metrics"
+ :depends-on ("graph"))
+ (:file "graph-algorithms"
+ :depends-on ("graph"))
- (:static-file "notes.text")
+ (:static-file "notes.text")
- (:module "graphviz" :depends-on ("graph")
- :components ((:file "graphviz-support")))))
- (:module "website"
- :components ((:module "source"
- :components ((:static-file "index.lml"))))))
-
+ (:module "graphviz" :depends-on ("graph")
+ :components ((:file "graphviz-support")))))
+ (:module
+ "website"
+ :components
+ ((:module "source"
+ :components ((:static-file "index.lml"))))))
+ :in-order-to ((test-op (load-op cl-graph-test)))
+ :perform (test-op :after (op c)
+ (describe
+ (funcall (intern (symbol-name '#:run-tests) :lift)
+ :suite '#:cl-graph-test)))
:depends-on (metatilities
- cl-containers
- metabang-bind
- cl-mathstats
- asdf-system-connections ; makes ASDF-Install get this automatically
- ))
+ cl-containers
+ metabang-bind
+ cl-mathstats
+ ;; makes ASDF-Install get this automatically
+ asdf-system-connections
+ ))
-;;; ---------------------------------------------------------------------------
+(defmethod operation-done-p
+ ((o test-op) (c (eql (find-system 'cl-graph))))
+ (values nil))
+#+asdf-system-connections
(asdf:defsystem-connection cl-graph-and-cl-variates
:requires (cl-graph cl-variates)
- :components ((:module "dev"
- :components ((:file "graph-and-variates")
- (:file "graph-generation"
- :depends-on ("graph-and-variates"))))))
+ :components ((:module
+ "dev"
+ :components
+ ((:file "graph-and-variates")
+ (:file "graph-generation"
+ :depends-on ("graph-and-variates"))))))
+#+asdf-system-connections
(asdf:defsystem-connection cl-graph-and-cl-graphviz
:requires (cl-graph cl-graphviz)
- :components ((:module "dev"
- :components
- ((:module "graphviz"
- :components
- ((:file "graphviz-support-optional")))))))
+ :components ((:module
+ "dev"
+ :components
+ ((:module "graphviz"
+ :components
+ ((:file "graphviz-support-optional")))))))
+#+asdf-system-connections
(asdf:defsystem-connection cl-graph-and-metacopy
:requires (cl-graph metacopy)
- :components ((:module "dev"
- :components ((:file "copying")))))
+ :components ((:module
+ "dev"
+ :components ((:file "copying")))))
+The only reasons we rely on cl-mathstats are
+
+; /Users/gwking/.fasls/allegro-8.0m-macosx-x86/Users/gwking/darcs/cl-graph/dev/graphviz/graphviz-support.fasl
+Warning: While compiling these undefined functions were referenced:
+ cl-graph::matrix-trace from position 7424 in
+ /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
+ cl-graph::matrix-multiply from position 7424 in
+ /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp, 7827 in
+ /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
+ cl-graph::normalize-matrix from position 7424 in
+ /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
+
+;;; move to l0-arrays? or metatilities?
+ cl-graph:: sum-of-array-elements from position 7424 in
+ /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp, 7827 in
+ /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
+ cl-graph::combination-count from position 5742 in
+ /Users/gwking/darcs/cl-graph/dev/graph-metrics.lisp
+
+some other things might be +e+, degrees->radians and radians->degrees,
+ combination-count, permutation-count, sum-of-array-elements
+
+
+- Use samep in samep for associative containers
+
optimize : find-edge-between-vertexes-if
+(defmethod find-edge-between-vertexes-if ((graph graph-container)
+ (vertex-1 graph-container-vertex)
+ (value-2 t)
+ fn
+ &key error-if-not-found?)
+ (let ((v2 (find-vertex graph value-2 error-if-not-found?)))
+ (when v2
+ (find-edge-between-vertexes-if
+ graph vertex-1 v2 fn
+ :error-if-not-found? error-if-not-found?))))
+
+;;; ---------------------------------------------------------------------------
+
+(defmethod find-edge-between-vertexes-if ((graph graph-container)
+ (value-1 t)
+ (vertex-2 graph-container-vertex)
+ fn
+ &key error-if-not-found?)
+ (let ((v1 (find-vertex graph value-1 error-if-not-found?)))
+ (when v1
+ (find-edge-between-vertexes-if
+ graph v1 vertex-2 fn
+ :error-if-not-found? error-if-not-found?))))
+
+
+Hmm, should probably write a macro that created all four method [ (t t), (t vertex), (vertex t) and (vertex vertex)] magically...
+
Should have delete-item-at-1
(defpackage #:cl-graph
(:use #:common-lisp #:metatilities #:cl-containers
- #:metabang.bind #:metabang.math)
+ #:metabang.bind)
(:nicknames #:metabang.graph)
(:documentation "CL-Graph is a Common Lisp library for manipulating graphs and running graph algorithms.")