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 2145 for branches/f4grobner


Ignore:
Timestamp:
2015-06-17T21:30:09-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/ring.lisp

    r2141 r2145  
    3434(defpackage "RING"
    3535  (:use :cl)
    36   (:shadow "GCD" "LCM" "ZEROP" "+" "-" "*" "/" "EXPT")
    37   (:export "PARSE"
    38            "UNIT-FOR"
    39            "ZEROP"
    40            "+"
    41            "-"
    42            "*"
    43            "+"
    44            "/"
    45            "EXPT"
    46            "LCM"
    47            "EZGCD"
    48            "GCD"
    49            "TOTAL-DEGREE"
    50            "DIMENSION"
    51            "SUGAR"
    52            "DIVIDES-P"   
    53            "DIVIDES-LCM-P"
    54            "LCM-DIVIDES-LCM-P"
    55            "LCM-EQUAL-LCM-P"
    56            "DIVISIBLE-BY-P"
    57            "REL-PRIME-P"   
    58            "EQUAL-P"           
    59            "DEPENDS-P"     
    60            "TENSOR-MUL"
    61            "CONTRACT"
    62            "ELT"))       
     36  (:export "R-PARSE"
     37           "R-UNIT-FOR"
     38           "R-ZEROP"
     39           "R+"
     40           "R-"
     41           "R*"
     42           "R+"
     43           "R/"
     44           "R-EXPT"
     45           "R-LCM"
     46           "R-EZGCD"
     47           "R-GCD"
     48           "R-TOTAL-DEGREE"
     49           "R-DIMENSION"
     50           "R-SUGAR"
     51           "R-DIVIDES-P"   
     52           "R-DIVIDES-LCM-P"
     53           "R-LCM-DIVIDES-LCM-P"
     54           "R-LCM-EQUAL-LCM-P"
     55           "R-DIVISIBLE-BY-P"
     56           "R-REL-PRIME-P"   
     57           "R-EQUALP"         
     58           "R-DEPENDS-P"     
     59           "R-TENSOR-MUL"
     60           "R-CONTRACT"))       
    6361
    6462(in-package :ring)
    6563
    66 (defgeneric unit-for (object)
     64(defgeneric r-unit-for (object)
    6765  (:method ((self number)) 1))
    6866
    69 (defgeneric zerop (object)
     67(defgeneric r-zerop (object)
    7068  (:method ((self number)) (cl:zerop self)))
    7169
    72 (defgeneric + (x y)
     70(defgeneric r+ (x y)
    7371  (:method ((x number) (y number)) (cl:+ x y)))
    7472
    75 (defgeneric - (x y)
     73(defgeneric r- (x y)
    7674  (:method ((x number) (y number)) (cl:- x y)))
    7775
    78 (defgeneric * (x y)
     76(defgeneric r* (x y)
    7977  (:method ((x number) (y number)) (cl:* x y)))
    8078
    81 (defgeneric tensor-times (x y))
     79(defgeneric r-tensor-product (x y))
    8280
    83 (defgeneric / (x y)
     81(defgeneric r/ (x y)
    8482  (:method ((x number) (y number)) (cl:/ x y)))
    8583
    86 (defgeneric lcm (x y)
     84(defgeneric r-lcm (x y)
    8785  (:method ((x integer) (y integer)) (cl:lcm x y)))
    8886
    89 (defgeneric expt (x y)
     87(defgeneric r-expt (x y)
    9088  (:method ((x integer) (y integer)) (cl:expt x y)))
    9189
    92 (defgeneric ezgcd (x y)
     90(defgeneric r-ezgcd (x y)
    9391  (:method ((x integer) (y integer)
    94             &aux (c (cl:gcd x y)))
    95     (values c (cl:/ x c) (cl:/ y c))))
     92            &aux (c (gcd x y)))
     93    (values c (/ x c) (/ y c))))
    9694
    97 (defgeneric gcd (x y)
     95(defgeneric r-gcd (x y)
    9896  (:method ((x integer) (y integer))
    9997    (cl:gcd x y)))
    10098
    101 (defgeneric dimension (object))
     99(defgeneric r-dimension (object))
    102100
    103 (defgeneric total-degree (object &optional start end))
     101(defgeneric r-total-degree (object &optional start end))
    104102
    105 (defgeneric divides-p (object1 object2)
     103(defgeneric r-divides-p (object1 object2)
    106104  (:method ((object1 integer) (object2 integer))
    107105    (cl:zerop (rem object2 object1)))
    108106  (:documentation "Returns T if OBJECT1 divides OBJECT2"))
    109107
    110 (defgeneric divides-lcm-p (object1 object2 object3)
     108(defgeneric r-divides-lcm-p (object1 object2 object3)
    111109  (:documentation "Returns T if OBJECT divides LCM(OBJECT2, OBJECT3), NIL otherwise."))
    112110
    113 (defgeneric lcm-divides-lcm-p (object1 object2 object3 object4)
     111(defgeneric r-lcm-divides-lcm-p (object1 object2 object3 object4)
    114112  (:documentation "Returns T if LCM(OBJECT1,OBJECT2) divides LCM(OBJECT3,OBJECT4), NIL otherwise."))
    115113
    116 (defgeneric lcm-equal-lcm-p (object1 object2 object3 object4)
     114(defgeneric r-lcm-equal-lcm-p (object1 object2 object3 object4)
    117115  (:documentation "Returns T if object LCM(OBJECT1,OBJECT2) equals LCM(OBJECT3,OBJECT4), NIL otherwise."))
    118116
    119 (defgeneric equal-p (object1 object2)
     117(defgeneric r-equalp (object1 object2)
    120118  (:method ((object1 t) (object2 t)) (equalp object1 object2))
    121119  (:documentation "Equality using deep comparison of object slots."))
    122120
    123 (defgeneric elt (object index))
     121(defgeneric r-elt (object index))
     122(defgeneric (setf r-elt) (object index))
    124123
Note: See TracChangeset for help on using the changeset viewer.