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


Ignore:
Timestamp:
2015-06-17T19:58:44-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/ring.lisp

    r2097 r2098  
    4949(in-package :ring)
    5050
    51 #|
    52 
    53 (defstruct (ring)
    54   "Defines a RING structure, whose fields
    55 are common ring operations necessary to implement
    56 Groebner bases."
    57   (parse #'identity :type function)
    58   (unit #'identity :type function)
    59   (zerop #'identity :type function)
    60   (add #'identity :type function)
    61   (sub #'identity :type function)
    62   (uminus #'identity :type function)
    63   (mul #'identity :type function)
    64   (div #'identity :type function)
    65   (lcm #'identity :type function)
    66   (ezgcd #'identity :type function)
    67   (gcd #'identity :type function))
    68 
    69 (defparameter +ring-of-integers+
    70   (make-ring
    71    :parse #'identity
    72    :unit #'(lambda () 1)
    73    :zerop #'zerop
    74    :add #'+
    75    :sub #'-
    76    :uminus #'-
    77    :mul #'*
    78    :div #'/
    79    :lcm #'lcm
    80    :ezgcd #'(lambda (x y &aux (c (gcd x y))) (values c (/ x c) (/ y c)))
    81    :gcd #'gcd
    82    )
    83   "The ring of integers.")
    84 |#
    85 
    86 (defgeneric ring-parse (object)
     51(defgeneric parse (object)
    8752  (:method ((object t)) object))
    8853
    89 (defgeneric ring-unit-for (object)
     54(defgeneric unit-for (object)
    9055  (:method ((self number)) 1))
    9156
    92 (defgeneric ring-zerop (object)
     57(defgeneric zerop (object)
    9358  (:method ((self number)) (zerop self)))
    9459
    95 (defgeneric ring-add (x y)
     60(defgeneric add (x y)
    9661  (:method ((x number) (y number)) (+ x y)))
    9762
    98 (defgeneric ring-mul (x y)
     63(defgeneric mul (x y)
    9964  (:method ((x number) (y number)) (* x y)))
    10065
    101 (defgeneric ring-tensor-mul (x y))
     66(defgeneric tensor-mul (x y))
    10267
    103 (defgeneric ring-div (x y)
     68(defgeneric div (x y)
    10469  (:method ((x number) (y number)) (/ x y)))
    10570
    106 (defgeneric ring-lcm (x y)
     71(defgeneric lcm (x y)
    10772  (:method ((x integer) (y integer)) (lcm x y)))
    10873
    109 (defgeneric ring-ezgcd (x y)
     74(defgeneric ezgcd (x y)
    11075  (:method ((x integer) (y integer)
    11176            &aux (c (gcd x y)))
    11277    (values c (/ x c) (/ y c))))
    11378
    114 (defgeneric ring-gcd (x y)
     79(defgeneric gcd (x y)
    11580  (:method ((x integer) (y integer))
    11681    (gcd x y)))
Note: See TracChangeset for help on using the changeset viewer.