changeset 641:e093f8fcd640

Simpler way to create a sub-matrix.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 05 Apr 2008 00:00:24 +0200
parents a5f51b2f3fb2
children 885828ebed92
files viff/test/test_matrix.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/viff/test/test_matrix.py	Sat Apr 05 00:00:03 2008 +0200
+++ b/viff/test/test_matrix.py	Sat Apr 05 00:00:24 2008 +0200
@@ -38,10 +38,7 @@
             subsets = generate_subsets(frozenset(range(n)), size)
             for rows in subsets:
                 for columns in subsets:
-                    sub = Matrix(size, size)
-                    for i, row in enumerate(rows):
-                        for j, column in enumerate(columns):
-                            sub[i, j] = mat[row, column]
+                    sub = Matrix([[mat[r, c] for r in rows] for c in columns])
                     if sub.determinant() == 0:
                         return False
         return True