(uiop:define-package :st-buchberger/src/vector (:mix :cl) (:export #:vector+ #:vector- #:vector-zero-p #:vector-equal-p #:vector>)) (in-package :st-buchberger/src/vector) (defun vector+ (v1 v2) "Returns the sum of the two vectors V1 and V2." (map 'vector #'+ v1 v2)) (defun vector- (v1 v2) "Returns the difference of the two vectors V1 and V2." (map 'vector #'- v1 v2)) (defun vector-zero-p (v) "Returns T if every compoment in V is zero." (every #'zerop v)) (defun vector-equal-p (v1 v2) "Returns T if both vectors V1 and V2 have the same components, NIL otherwise." (equalp v1 v2)) (defun vector> (v1 v2) "Returns T if every component in V1 is greater than the corresponding component in V2, NIL otherwise." (notany #'zerop (vector- v1 v2)))