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


Ignore:
Timestamp:
2016-05-31T14:44:29-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r4023 r4024  
    611611  (:documentation "Convert a symbolic polynomial SELF to infix form, using variables VARS. The default
    612612value of VARS is the corresponding slot value of SELF.")
     613  (:method :before ((self monom) &optional vars)
     614           "Check the length of variables VARS against the length of exponents."
     615           (with-slots (exponents)
     616               self
     617             (assert (= (length vars) (length exponents))
     618                     (vars exponents)
     619                     "Variables ~A and exponents ~A must have the same length." vars exponents)))
    613620  (:method ((self monom) &optional vars)
    614621    "Convert a monomial SELF to infix form, using variable VARS to build the representation."
     
    620627                                       (t (list `(expt ,var ,power)))))
    621628                       vars (coerce exponents 'list))))
    622         (cond ((endp (cdr m)) (car m))
     629        (print m)
     630        (cond ((endp m) 1)
     631              ((endp (cdr m)) (car m))
    623632              (t
    624633               (cons '* m))))))
     
    629638        self
    630639      (let ((m (call-next-method)))
     640        (print m)
    631641        (cond ;;((= coeff 1) m)
    632642              ;;((eql (car m) '*) (list* '* coeff (cdr m)))
Note: See TracChangeset for help on using the changeset viewer.