Changeset 2425 for branches/f4grobner
- Timestamp:
- 2015-06-19T07:57:13-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/order.lisp
r1938 r2425 28 28 29 29 (defpackage "ORDER" 30 (:use :cl : monom)30 (:use :cl :ring :monom) 31 31 (:export "LEX>" 32 32 "GRLEX>" … … 42 42 43 43 ;; pure lexicographic 44 (def un lex> (p q&optional (start 0) (end (monom-dimension p)))44 (defmethod lex> ((p monom) (q monom) &optional (start 0) (end (monom-dimension p))) 45 45 "Return T if P>Q with respect to lexicographic order, otherwise NIL. 46 46 The second returned value is T if P=Q, otherwise it is NIL." … … 49 49 ((>= i end) (values nil t)) 50 50 (cond 51 ((> ( monom-elt p i) (monom-elt q i))51 ((> (r-elt p i) (r-elt q i)) 52 52 (return-from lex> (values t nil))) 53 ((< ( monom-elt p i) (monom-elt q i))53 ((< (r-elt p i) (r-elt q i)) 54 54 (return-from lex> (values nil nil)))))) 55 55 … … 81 81 (declare (type fixnum i)) 82 82 (cond 83 ((< ( monom-elt p i) (monom-elt q i))83 ((< (r-elt p i) (r-elt q i)) 84 84 (return-from revlex> (values t nil))) 85 ((> ( monom-elt p i) (monom-elt q i))85 ((> (r-elt p i) (r-elt q i)) 86 86 (return-from revlex> (values nil nil)))))) 87 87 … … 109 109 (declare (type fixnum i)) 110 110 (cond 111 ((> ( monom-elt p i) (monom-elt q i))111 ((> (r-elt p i) (r-elt q i)) 112 112 (return-from invlex> (values t nil))) 113 ((< ( monom-elt p i) (monom-elt q i))113 ((< (r-elt p i) (r-elt q i)) 114 114 (return-from invlex> (values nil nil)))))) 115 115 … … 136 136 (declare (type monom p q) (type fixnum start end)) 137 137 (cond 138 ((> ( monom-elt p start) (monom-elt q start))138 ((> (r-elt p start) (r-elt q start)) 139 139 (values t nil)) 140 ((< ( monom-elt p start) (monom-elt q start))140 ((< (r-elt p start) (r-elt q start)) 141 141 (values nil nil)) 142 142 (t
Note:
See TracChangeset
for help on using the changeset viewer.