Plaster
New
List
Login
text
default
anonymous
2024.01.20 00:25:11
(loop for dim in '(2 2 3) do (loop for spacedim in '(2 3 3) do (with-type-templates ((%triangulation "triangulation-$dim-$spacedim>")) (with-function-templates ((%n-cells "n-cells<$triangulation>") (%hyper-cube "hyper-cube<$triangulation>") (%hyper-shell "hyper-shell<$triangulation>")) `(progn (defmethod n-cells ((tria ,%triangulation)) (,%n-cells tria)) (defmethod print-object ((tria ,%triangulation) stream) (print-unreadable-object (tria stream :type t) (format stream "~@<~A cells~:@>" (%n-cells tria)))) (defmethod make-hyper-cube ((tria ,%triangulation) &key (left 0d0) (right 1d0) colorize) (%hyper-cube tria left right colorize) tria) ,@(when (= dim spacedim) `((defmethod make-hyper-shell ((tria ,%triangulation) &key center inner-radius outer-radius (n-cells 0) colorize) (%hyper-shell tria center inner-radius outer-radius n-cells colorize) tria))))))))
Raw
Annotate
Repaste
Edit