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 1019


Ignore:
Timestamp:
2015-06-10T06:50:55-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/parse.lisp

    r1018 r1019  
    255255                      (ring (ro-ring ring-and-order))
    256256                      (n (length vars))
    257                       (basis (monom-basis (length vars))))
     257                      (basis (variable-basis ring (length vars))))
    258258  "Evaluate an expression EXPR as polynomial by substituting operators
    259259+ - * expt with corresponding polynomial operators and variables VARS
     
    324324
    325325;; 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)))
    335327  "Generate a list of monomials ((1 0 ... 0) (0 1 0 ... 0) ... (0 0 ... 1)
    336328which correspond to linear monomials X1, X2, ... XN."
    337329  (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.