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


Ignore:
Timestamp:
2016-06-17T11:15:54-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial-sugar.lisp

    r4504 r4505  
    55the sugar value which does not assume that the object is a result of any prior calculations.")
    66  (:method ((object monom))
     7    "Static sugar of a monom OBJECT is simply the total degree."
    78    (total-degree object))
    89  (:method ((object poly))
    9     (with-slots (termlist)
     10    "Static sugar of a poly OBJECT is the maximum sugar of its terms."
     11  (with-slots (termlist)
    1012        object
    1113      (loop for trm in termlist maximize (sugar trm)))))
     
    1618(defclass monom-with-sugar (monom sugar) ())
    1719
     20(defmethod print-object ((self monom-with-sugar) stream)
     21  (print-unreadable-object (self stream :type t :identity t)
     22    (with-accessors ((exponents monom-exponents) (value sugar-value))
     23        self
     24      (format stream "EXPONENTS=~A SUGAR=~A"
     25              exponents value))))
     26
     27
    1828(defmethod shared-initialize :after ((self monom-with-sugar) slot-names &rest initargs &key)
    1929  "Initialize sugar value based on the exponents."
     
    2131  (setf (slot-value self 'value) (static-sugar self)))
    2232
     33(defclass term-with-sugar (term sugar) ())
    2334
     35(defmethod print-object ((self term-with-sugar) stream)
     36  (print-unreadable-object (self stream :type t :identity t)
     37    (with-accessors ((exponents monom-exponents) (value sugar-value) (coeff term-coeff))
     38        self
     39      (format stream "EXPONENTS=~A COEFF=~A SUGAR=~A"
     40              exponents coeff value))))
Note: See TracChangeset for help on using the changeset viewer.