Changeset 2808 for branches/f4grobner
- Timestamp:
- 2015-06-20T22:08:23-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/ring.lisp
r2720 r2808 74 74 75 75 (defgeneric r-zerop (object) 76 (:method ((self number)) (zerop self))) 76 (:method ((self number)) (zerop self)) 77 (:documentation "Tests whether a ring element is 0.")) 77 78 78 79 (defgeneric r+ (x y) 79 (:method ((x number) (y number)) (+ x y))) 80 (:method ((x number) (y number)) (+ x y)) 81 (:documentation "Adds ring elements.")) 80 82 81 83 (defgeneric r- (x y) 82 (:method ((x number) (y number)) (- x y))) 84 (:method ((x number) (y number)) (- x y)) 85 (:documentation "Subtracts ring elements.")) 83 86 84 87 (defgeneric r* (x y) 85 (:method ((x number) (y number)) (* x y))) 88 (:method ((x number) (y number)) (* x y)) 89 (:documentation "Multiplies ring elements.")) 86 90 87 (defgeneric r-tensor-product (x y)) 91 (defgeneric r-tensor-product (x y) 92 (:documentation "Takes a tensor product of two objects.")) 88 93 89 94 (defgeneric r/ (x y) 90 (:method ((x number) (y number)) (/ x y))) 95 (:method ((x number) (y number)) (/ x y)) 96 (:documentation "Divides ring elements.")) 91 97 92 98 (defgeneric r-lcm (x y) 93 (:method ((x integer) (y integer)) (lcm x y))) 99 (:method ((x integer) (y integer)) (lcm x y)) 100 (:documentation "Returns the least common multiple of ring elements.")) 94 101 95 102 (defgeneric r-expt (x y) 96 (:method ((x integer) (y integer)) (expt x y))) 103 (:method ((x integer) (y integer)) (expt x y)) 104 (:documentation "Raises X to power Y.")) 97 105 98 106 (defgeneric r-ezgcd (x y) 99 107 (:method ((x integer) (y integer) 100 108 &aux (c (gcd x y))) 101 (values c (/ x c) (/ y c)))) 109 (values c (/ x c) (/ y c))) 110 (:documentation "Solves the diophantine system: X=C*X1, Y=C*X2, C=GCD(X,Y)")) 102 111 103 112 (defgeneric r-gcd (x y)
Note:
See TracChangeset
for help on using the changeset viewer.