]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/math/matrices/laplace/laplace.factor
classes: use check-instance in a few places, to remove duplication.
[factor.git] / extra / math / matrices / laplace / laplace.factor
index a38d152c68ab28545fb27015481930f78af5c342..1d8f8468e7eb2296f952c4c2734caf2e1ba5b49d 100644 (file)
@@ -29,12 +29,7 @@ INSTANCE: missing immutable-sequence
         v* [ odd? [ neg ] when ] map-index sum
     ] if ;
 
-ERROR: not-a-square-matrix matrix ;
-
-: check-square-matrix ( matrix -- matrix )
-    dup square-matrix? [ not-a-square-matrix ] unless ; inline
-
 PRIVATE>
 
 : determinant ( matrix -- x )
-    check-square-matrix 0 swap laplace-expansion ;
+    square-matrix check-instance 0 swap laplace-expansion ;