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 2085


Ignore:
Timestamp:
2015-06-17T19:40:55-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r2084 r2085  
    260260    (plusp (elt exponents k))))
    261261
    262 (defmacro monom-map (fun m &rest ml &aux (result `(copy-seq ,m)))
    263   "Map function FUN of one argument over the powers of a monomial M.
    264 Fun should map a single FIXNUM argument to FIXNUM.  Return a sequence
    265 of results."
    266   `(map-into ,result ,fun ,m ,@ml))
    267 
    268 (defun monom-append (m1 m2 &aux (dim (+ (length m1) (length m2))))
    269   (declare (type monom m1 m2) (fixnum dim))
    270   (concatenate `(monom ,dim) m1 m2))
    271 
    272 (defun monom-contract (m k)
     262(defmethod tensor-mul ((m1 monom) (m2 monom)
     263                       &aux (dim (+ (dimension m1) (dimension m2))))
     264  (declare (fixnum dim))
     265  (make-instance 'monom :dim dim
     266                 :exponents (concatenate 'vector exponents1 exponents2)))
     267
     268(defmethod contract ((m monom) k)
    273269  "Drop the first K variables in monomial M."
    274   (declare (type monom m) (fixnum k))
    275   (subseq m k))
     270  (declare (fixnum k))
     271  (with-slots (dim exponents)
     272      m
     273    (setf dim (- dim k)
     274          exponents (subseq exponents k))))
    276275
    277276(defun make-monom-variable (nvars pos &optional (power 1)
Note: See TracChangeset for help on using the changeset viewer.