-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.lisp
More file actions
31 lines (27 loc) · 1.16 KB
/
Copy pathdebug.lisp
File metadata and controls
31 lines (27 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(load "matrix.lisp")
(load "symbolic.lisp")
(load "conservation.lisp")
(defpackage :ct (:use :cl)
(:shadowing-import-from :conservation-spectral
:make-graph :graph-add-edge :build-laplacian
:graph-edges :graph-vertices :graph-n
:vertex-attribute :edge-from :edge-to :edge-weight
:vertex :edge)
(:shadowing-import-from :conservation-matrix
:make-matrix :matrix-ref :matrix-set :make-vec
:matrix-vector-multiply :vector-dot))
(in-package :ct)
(format t "Creating graph~%")
(let ((g (conservation-spectral:make-graph 3)))
(format t "Graph created: ~a~%" g)
(conservation-spectral:graph-add-edge g 0 1 :weight 1.0d0)
(format t "Added edge~%")
(conservation-spectral:graph-add-edge g 1 2 :weight 1.0d0)
(conservation-spectral:graph-add-edge g 0 2 :weight 1.0d0)
(format t "Edges: ~a~%" (conservation-spectral:graph-edges g))
(format t "Building Laplacian~%")
(let ((L (conservation-spectral:build-laplacian g)))
(format t "L[0][0] = ~f~%" (conservation-matrix:matrix-ref L 0 0))
(format t "L[0][1] = ~f~%" (conservation-matrix:matrix-ref L 0 1))
(format t "L[1][1] = ~f~%" (conservation-matrix:matrix-ref L 1 1))))
(sb-ext:exit)