From c89b0054ab1cd2401da4f35a2cbfbeae142dae10 Mon Sep 17 00:00:00 2001 From: Gerd Heber Date: Mon, 3 Aug 2015 17:40:37 -0500 Subject: [PATCH] Added the SHOW-STRUCTURE function for simplicial sets from the Handbook p. 143. --- package.lisp | 1 + src/simplicial-sets.lisp | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/package.lisp b/package.lisp index f9e56a4..9ea85c1 100644 --- a/package.lisp +++ b/package.lisp @@ -479,6 +479,7 @@ NDGNR NFACE REMOVE-BIT + SHOW-STRUCTURE SMST ;; smith.lisp diff --git a/src/simplicial-sets.lisp b/src/simplicial-sets.lisp index b7c3a74..a1b2cd3 100644 --- a/src/simplicial-sets.lisp +++ b/src/simplicial-sets.lisp @@ -490,3 +490,25 @@ (declare (type gmsm gmsm)) (unless (check-faces cmpr face dmns gmsm) (setf rslt nil)))))) + + +(DEFUN SHOW-STRUCTURE (smst dmns) + (declare + (type simplicial-set smst) + (fixnum dmns)) + "--------------------------------------------------------------[function-doc] +SHOW-STRUCTURE +Args: (smst dmns) +Shows the structure of the simplicial set SMST (i.e., generators and faces) +from dimension 0 up to and including dimension DMNS. +------------------------------------------------------------------------------" + (when (<= 0 dmns) + (dotimes (i (1+ dmns)) + (format t "~2%Dimension = ~D:" i) + (case i + (0 (format t "~2%~8TVertices : ~8T~A" (basis smst 0))) + (otherwise + (dolist (s (basis smst i)) + (format t "~2%~8TSimplex : ~A~2%~16TFaces : ~A" + s (mapcar #'(lambda (j) (face smst j i s)) + ( 0 i)))))))))