viff

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 diff
     1.1 --- a/viff/test/test_matrix.py	Sat Apr 05 00:00:03 2008 +0200
     1.2 +++ b/viff/test/test_matrix.py	Sat Apr 05 00:00:24 2008 +0200
     1.3 @@ -38,10 +38,7 @@
     1.4              subsets = generate_subsets(frozenset(range(n)), size)
     1.5              for rows in subsets:
     1.6                  for columns in subsets:
     1.7 -                    sub = Matrix(size, size)
     1.8 -                    for i, row in enumerate(rows):
     1.9 -                        for j, column in enumerate(columns):
    1.10 -                            sub[i, j] = mat[row, column]
    1.11 +                    sub = Matrix([[mat[r, c] for r in rows] for c in columns])
    1.12                      if sub.determinant() == 0:
    1.13                          return False
    1.14          return True