Changeset 3598 for branches/f4grobner
- Timestamp:
- 2015-09-05T18:32:35-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/5am-monom.lisp
r3597 r3598 148 148 "Term basics" 149 149 (with-fixture term-context () 150 (is (= ( r-dimension m) 3))151 (is (= ( r-elt m 2) 3))150 (is (= (monom-dimension m) 3)) 151 (is (= (monom-elt m 2) 3)) 152 152 (is (= (r-total-degree m) 6)) 153 153 (is (= (r-sugar m) 6)) 154 (is (equalp ( r->list z) '(0 0 0)) "Trivial term is a vector of 0's")155 (is ( r-equalp (r*m n) m*n))156 (is ( r-equalp (r/n m) n/m))157 (is ( r-equalp (right-tensor-product-by m n) m-tensor-n))154 (is (equalp (monom->list z) '(0 0 0)) "Trivial term is a vector of 0's") 155 (is (universal-equalp (multiply m n) m*n)) 156 (is (universal-equalp (divide n m) n/m)) 157 (is (universal-equalp (right-tensor-product-by m n) m-tensor-n)) 158 158 (signals 159 159 (error "EXPONENTS must have length DIMENSION") 160 160 (make-instance 'term :dimension 3 :exponents '(1 2 3 4 5 6) :coeff 77)) 161 (is-true ( r-divides-p m n))162 (is-false ( r-divides-p n m))163 (is (r-equalp ( r-gcd m n) m))164 (is (r-equalp ( r-lcm m n) n))165 (is-true ( r-depends-p m 0))161 (is-true (divides-p m n)) 162 (is-false (divides-p n m)) 163 (is (r-equalp (universal-gcd m n) m)) 164 (is (r-equalp (universal-lcm m n) n)) 165 (is-true (depends-p m 0)) 166 166 (signals 167 167 (error "Index out of bounds") 168 ( r-depends-p m 3))168 (depends-p m 3)) 169 169 ) 170 170 (with-fixture term-context () 171 (is ( r-equalp (multiply-by m n) m*n)))171 (is (universal-equalp (multiply-by m n) m*n))) 172 172 (with-fixture term-context () 173 (is ( r-equalp (divide-by n m) n/m)))173 (is (universal-equalp (divide-by n m) n/m))) 174 174 (with-fixture term-context () 175 (is ( r-equalp (unary-minus m) m-uminus))))175 (is (universal-equalp (unary-minus m) m-uminus)))) 176 176 177 177 … … 186 186 "Monom/term conversion" 187 187 (with-fixture monom/term-conversion-context () 188 (is ( r-equalp (change-class term 'monom) monom)))188 (is (universal-equalp (change-class term 'monom) monom))) 189 189 (with-fixture monom/term-conversion-context () 190 (is ( r-equalp (change-class monom 'term) promoted-monom))))190 (is (universal-equalp (change-class monom 'term) promoted-monom)))) 191 191 192 192 (test monom/term-copy 193 193 "Monom/term copy" 194 194 (with-fixture monom/term-conversion-context () 195 (is ( r-equalp (copy-instance monom) monom))196 (is ( r-equalp (copy-instance term) term)))195 (is (universal-equalp (copy-instance monom) monom)) 196 (is (universal-equalp (copy-instance term) term))) 197 197 ) 198 198 … … 202 202 (term2 (make-instance 'term :exponents '(4 5) :coeff 3)) 203 203 (term1-left-tensor-by-term2 (make-instance 'term :exponents '(4 5 1 2 3) :coeff 12))) 204 (is ( r-equalp (left-tensor-product-by term1 term2) term1-left-tensor-by-term2))))204 (is (universal-equalp (left-tensor-product-by term1 term2) term1-left-tensor-by-term2)))) 205 205 206 206 (test term-contract … … 208 208 (let ((term (make-instance 'term :exponents '(1 2 3) :coeff 4)) 209 209 (term-contracted (make-instance 'term :exponents '(2 3) :coeff 4))) 210 (is ( r-equalp (left-contract term 1) term-contracted))))210 (is (universal-equalp (left-contract term 1) term-contracted)))) 211 211 212 212
Note:
See TracChangeset
for help on using the changeset viewer.