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)))))))))