close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Changeset 2432 for branches/f4grobner


Ignore:
Timestamp:
2015-06-19T08:07:07-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/order.lisp

    r2431 r2432  
    4141(proclaim '(optimize (speed 3) (space 0) (safety 0) (debug 0)))
    4242
    43 (defgeneric order (p q &optional start end))
    44 
    4543;; pure lexicographic
    46 (defmethod lex> ((p monom) (q monom) &optional (start 0) (end (monom-dimension  p)))
    47   "Return T if P>Q with respect to lexicographic order, otherwise NIL.
     44(defgeneric lex> (p q &optional start end)
     45  (:method ((p monom) (q monom) &optional (start 0) (end (monom-dimension  p)))
     46    "Return T if P>Q with respect to lexicographic order, otherwise NIL.
    4847The second returned value is T if P=Q, otherwise it is NIL."
    49   (declare (type fixnum start end))
    50   (do ((i start (1+ i)))
    51       ((>= i end) (values nil t))
    52     (cond
    53      ((> (r-elt p i) (r-elt q i))
    54       (return-from lex> (values t nil)))
    55      ((< (r-elt p i) (r-elt q i))
    56       (return-from lex> (values nil nil))))))
     48    (declare (type fixnum start end))
     49    (do ((i start (1+ i)))
     50        ((>= i end) (values nil t))
     51      (cond
     52        ((> (r-elt p i) (r-elt q i))
     53        (return-from lex> (values t nil)))
     54        ((< (r-elt p i) (r-elt q i))
     55         (return-from lex> (values nil nil)))))))
    5756
    5857;; total degree order , ties broken by lexicographic
    59 (defmethod grlex> ((p monom) (q monom) &optional (start 0) (end (monom-dimension  p)))
    60   "Return T if P>Q with respect to graded lexicographic order, otherwise NIL.
     58(defgeneric grlex> (p q &optional start end)
     59  (:method ((p monom) (q monom) &optional (start 0) (end (monom-dimension  p)))
     60    "Return T if P>Q with respect to graded lexicographic order, otherwise NIL.
    6161The second returned value is T if P=Q, otherwise it is NIL."
    62   (declare (type monom p q) (type fixnum start end))
    63   (let ((d1 (r-total-degree p start end))
    64         (d2 (r-total-degree q start end)))
    65     (declare (type fixnum d1 d2))
    66     (cond
    67       ((> d1 d2) (values t nil))
    68       ((< d1 d2) (values nil nil))
    69       (t
    70         (lex> p q start end)))))
     62    (declare (type monom p q) (type fixnum start end))
     63    (let ((d1 (r-total-degree p start end))
     64          (d2 (r-total-degree q start end)))
     65      (declare (type fixnum d1 d2))
     66      (cond
     67        ((> d1 d2) (values t nil))
     68        ((< d1 d2) (values nil nil))
     69        (t
     70         (lex> p q start end))))))
    7171
    7272
Note: See TracChangeset for help on using the changeset viewer.