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 1201


Ignore:
Timestamp:
2015-06-11T10:48:54-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

Changed the first line to eliminate 'unsafe' Emacs variables

Location:
branches/f4grobner
Files:
21 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/.junk/parse.lisp

    r1061 r1201  
    115115
    116116
    117 (defun parse-string-to-alist (str vars)
    118   "Parse string STR and return a polynomial as a sorted association
    119 list of pairs (MONOM . COEFFICIENT). For example:
    120 (parse-string-to-alist \"[x^2-y^2+(-4/3)*u^2*w^3-5,y]\" '(x y u w))
    121  ([ (((0 0 2 3) . -4/3) ((0 2 0 0) . -1) ((2 0 0 0) . 1)
    122      ((0 0 0 0) . -5))
    123     (((0 1 0 0) . 1)))
    124 The functions PARSE-TO-SORTED-ALIST and PARSE-STRING-TO-SORTED-ALIST
    125 sort terms by the predicate defined in the ORDER package."
    126   (with-input-from-string (stream str)
    127     (parse-to-alist vars stream)))
    128117
    129118
    130 (defun parse-to-sorted-alist (vars &optional (order #'lex>) (stream t))
    131   "Parses streasm STREAM and returns a polynomial represented as
    132 a sorted alist. For example:
    133 (WITH-INPUT-FROM-STRING (S \"X^2-Y^2+(-4/3)*U^2*W^3-5\")
    134   (PARSE-TO-SORTED-ALIST '(X Y U W) S))
    135 returns
    136 (((2 0 0 0) . 1) ((0 2 0 0) . -1) ((0 0 2 3) . -4/3) ((0 0 0 0) . -5))
    137 and
    138 (WITH-INPUT-FROM-STRING (S \"X^2-Y^2+(-4/3)*U^2*W^3-5\")
    139   (PARSE-TO-SORTED-ALIST '(X Y U W) T #'GRLEX>) S)
    140 returns
    141 (((0 0 2 3) . -4/3) ((2 0 0 0) . 1) ((0 2 0 0) . -1) ((0 0 0 0) . -5))"
    142   (sort-poly (parse-to-alist vars stream) order))
    143 
    144 (defun parse-string-to-sorted-alist (str vars &optional (order #'lex>))
    145   "Parse a string to a sorted alist form, the internal representation
    146 of polynomials used by our system."
    147   (with-input-from-string (stream str)
    148     (parse-to-sorted-alist vars order stream)))
    149 
    150 (defun sort-poly-1 (p order)
    151   "Sort the terms of a single polynomial P using an admissible monomial order ORDER.
    152 Returns the sorted polynomial. Destructively modifies P."
    153   (sort p order :key #'first))
    154 
    155 ;; Sort a polynomial or polynomial list
    156 (defun sort-poly (poly-or-poly-list &optional (order #'lex>))
    157   "Sort POLY-OR-POLY-LIST, which could be either a single polynomial
    158 or a list of polynomials in internal alist representation, using
    159 admissible monomial order ORDER. Each polynomial is sorted using
    160 SORT-POLY-1."
    161   (cond
    162    ((eql poly-or-poly-list :syntax-error) nil)
    163    ((null poly-or-poly-list) nil)
    164    ((eql (car poly-or-poly-list) '[)
    165     (cons '[ (mapcar #'(lambda (p) (sort-poly-1 p order))
    166                      (rest poly-or-poly-list))))
    167    (t (sort-poly-1 poly-or-poly-list order))))
    168 
    169 
    170 
  • branches/f4grobner/5am-tests.lisp

    r1196 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/buchberger.lisp

    r580 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/compile-me.lisp

    r1075 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/criterion.lisp

    r484 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/f4.lisp

    r640 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/gb-postprocessing.lisp

    r501 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/gebauer-moeller.lisp

    r581 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/grobner-debug.lisp

    r468 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/grobner-wrap.lisp

    r516 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/ideal.lisp

    r994 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/monomial.lisp

    r1161 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/mx-grobner.lisp

    r1002 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/ngrobner-package.lisp

    r1073 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/ngrobner.lisp

    r997 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/order.lisp

    r946 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/pair-queue.lisp

    r638 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/polynomial.lisp

    r1189 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/priority-queue.lisp

    r609 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/ring-and-order.lisp

    r962 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/term.lisp

    r1154 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
  • branches/f4grobner/termlist.lisp

    r943 r1201  
    1 ;;; -*-  Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
     1;;; -*-  Mode: Lisp -*-
    22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    33;;;                                                                             
Note: See TracChangeset for help on using the changeset viewer.