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


Ignore:
Timestamp:
2016-05-31T18:01:24-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r4036 r4053  
    5454           "MAKE-POLY-VARIABLE"
    5555           "MAKE-POLY-CONSTANT"
     56           "MAKE-ZERO-FOR"
     57           "MAKE-UNIT-FOR"
    5658           "UNIVERSAL-EXPT"
    5759           "UNIVERSAL-EQUALP"
     
    607609  (let ((m (mapcar #'(lambda (x) (->sexp x vars))
    608610                   (poly-termlist self))))
    609     (cons ((endp m) 0)
     611    (cond ((endp m) 0)
    610612          ((endp (cdr m)) (car m))
    611613          (t (cons '+ m)))))
     
    670672         (otherwise
    671673          (error "Cannot evaluate as polynomial: ~A" expr)))))))
     674
     675(defgeneric make-zero-for (self)
     676  (:method ((self poly))
     677    (make-instance 'poly :dimension (poly-dimension self))))
     678
     679(defgeneric make-unit-for (self)
     680  (:method ((self poly))
     681    (make-poly-constant (poly-dimension self) 1)))
     682   
Note: See TracChangeset for help on using the changeset viewer.