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 3910 for branches


Ignore:
Timestamp:
2016-05-29T20:08:59-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/pair-queue.lisp

    r3909 r3910  
    2727
    2828(defpackage "PAIR-QUEUE"
    29   (:use :cl :priority-queue :monomial :order :polynomial :utils)
     29  (:use :cl :priority-queue :monom :polynomial :utils)
    3030  (:export "SUGAR-PAIR-KEY"
    3131           "PAIR"
     
    5050(in-package :pair-queue)
    5151
    52 (defun sugar-pair-key (p q &aux (lcm (monom-lcm (poly-lm p) (poly-lm q)))
    53                                 (d (monom-sugar lcm)))
     52(defun sugar-pair-key (p q &aux (lcm (universal-lcm (leading-monomial p) (leading-monomial q)))
     53                                (d (sugar lcm)))
    5454  "Returns list (S LCM-TOTAL-DEGREE) where S is the sugar of the S-polynomial of
    5555polynomials P and Q, and LCM-TOTAL-DEGREE is the degree of LCM(LM(P),LM(Q))."
    5656  (declare (type poly p q) (type monom lcm) (type fixnum d))
    5757  (cons (max
    58          (+  (- d (monom-sugar (poly-lm p))) (poly-sugar p))
    59          (+  (- d (monom-sugar (poly-lm q))) (poly-sugar q)))
     58         (+  (- d (sugar (leading-monomial p))) (poly-sugar p))
     59         (+  (- d (sugar (leading-monomial q))) (poly-sugar q)))
    6060        lcm))
    6161
     
    133133    ((minimal-lcm :minimal-lcm $minimal_lcm)
    134134     (setf *pair-key-function* #'(lambda (p q)
    135                                    (monom-lcm (poly-lm p) (poly-lm q)))
     135                                   (universal-lcm (leading-monomial p) (leading-monomial q)))
    136136           *pair-order* #'reverse-monomial-order))
    137137    ((minimal-total-degree :minimal-total-degree $minimal_total_degree)
    138138     (setf *pair-key-function* #'(lambda (p q)
    139139                                   (monom-total-degree
    140                                     (monom-lcm (poly-lm p) (poly-lm q))))
     140                                    (universal-lcm (leading-monomial p) (leading-monomial q))))
    141141           *pair-order* #'<))
    142142    ((minimal-length :minimal-length $minimal_length)
Note: See TracChangeset for help on using the changeset viewer.