Changeset 1019 for branches/f4grobner/parse.lisp
- Timestamp:
- 2015-06-10T06:50:55-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/parse.lisp
r1018 r1019 255 255 (ring (ro-ring ring-and-order)) 256 256 (n (length vars)) 257 (basis ( monom-basis(length vars))))257 (basis (variable-basis ring (length vars)))) 258 258 "Evaluate an expression EXPR as polynomial by substituting operators 259 259 + - * expt with corresponding polynomial operators and variables VARS … … 324 324 325 325 ;; Return the standard basis of the monomials in n variables 326 (defun monom-basis (n &aux 327 (basis 328 (copy-tree 329 (make-list n :initial-element 330 (list (cons 331 (make-list 332 n 333 :initial-element 0) 334 1)))))) 326 (defun variable-basis (ring n &aux (basis (make-list n))) 335 327 "Generate a list of monomials ((1 0 ... 0) (0 1 0 ... 0) ... (0 0 ... 1) 336 328 which correspond to linear monomials X1, X2, ... XN." 337 329 (dotimes (i n basis) 338 (setf (elt (caar (elt basis i)) i) 1)))330 (setf (elt basis i) (make-variable ring n i))))
Note:
See TracChangeset
for help on using the changeset viewer.