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


Ignore:
Timestamp:
2016-05-28T01:53:28-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r3827 r3828  
    605605(defgeneric ->infix (self &optional vars)
    606606  (:method ((self monom) &optional vars)
    607     (with-slots (exponents dimension)
    608     (makelist-1 (exp (elt i vars) ( elt i exponents)) i 0 dimension))))
     607    (with-slots (exponents)
     608        self
     609      (cons '*
     610            (mapcan #'(lambda (var power)
     611                        (cond ((= power 0) nil)
     612                              ((= power 1) (list var))
     613                              (t (list `(expt ,var ,power)))))
     614                    vars (coerce exponents 'list)))))
     615  (:method ((self term) &optional vars)
     616    (with-slots (exponents coeff)
     617        self
     618      (cons '* coeff
     619            (mapcan #'(lambda (var power)
     620                        (cond ((= power 0) nil)
     621                              ((= power 1) (list var))
     622                              (t (list `(expt ,var ,power)))))
     623                    vars (coerce exponents 'list))))))
Note: See TracChangeset for help on using the changeset viewer.