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 4346


Ignore:
Timestamp:
2016-06-06T13:26:28-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/symbolic-polynomial.lisp

    r4202 r4346  
    2121
    2222(defpackage "SYMBOLIC-POLYNOMIAL"
    23   (:use :cl :utils :monom :polynomial :infix :infix-printer)
     23  (:use :cl :utils :monom :polynomial :infix :infix-printer :ring)
    2424  (:export "SYMBOLIC-POLY" "READ-INFIX-FORM" "STRING->POLY" "POLY->STRING" "->INFIX")
    2525  (:documentation "Implements symbolic polynomials. A symbolic
     
    105105(defun read-poly (vars &key
    106106                         (stream t)
    107                          (order #'lex>))
     107                         (order #'lex>)
     108                         (coefficient-class 'rational-field))
    108109  "Reads an expression in prefix form from a stream STREAM.
    109110The expression read from the strem should represent a polynomial or a
     
    111112polynomial or list of polynomials is returned, with terms in each
    112113polynomial ordered according to monomial order ORDER."
    113   (poly-eval (read-infix-form :stream stream) vars order))
     114  (poly-eval (read-infix-form :stream stream) vars order coefficient-class))
    114115
    115116(defun string->poly (str vars
    116117                     &optional
    117                        (order #'lex>))
     118                       (order #'lex>)
     119                       (coefficient-class 'rational-field))
    118120  "Converts a string STR to a polynomial in variables VARS."
    119121  (with-input-from-string (s str)
    120     (let ((p-or-plist (read-poly vars :stream s :order order)))
     122    (let ((p-or-plist (read-poly vars :stream s :order order :coefficient-class coefficient-class)))
    121123      (etypecase p-or-plist
    122124        (poly (change-class p-or-plist 'symbolic-poly :vars vars))
     
    138140(defun string->alist (str vars
    139141                      &optional
    140                         (order #'lex>))
     142                        (order #'lex>)
     143                        (coefficient-class 'rational-field))
    141144  "Convert a string STR representing a polynomial or polynomial list to
    142145an association list (... (MONOM . COEFF) ...)."
    143   (poly->alist (string->poly str vars order)))
     146  (poly->alist (string->poly str vars order coefficient-class)))
    144147
    145148(defun poly-equal-no-sugar-p (p q)
Note: See TracChangeset for help on using the changeset viewer.