viff

changeset 630:d497fab5e1ec

Test for is_hyper helper method.
author Martin Geisler <mg@daimi.au.dk>
date Tue, 01 Apr 2008 14:50:49 +0200
parents 31d157dedca9
children 979fbf411c6e
files viff/test/test_matrix.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/viff/test/test_matrix.py	Mon Mar 31 13:48:03 2008 +0200
     1.2 +++ b/viff/test/test_matrix.py	Tue Apr 01 14:50:49 2008 +0200
     1.3 @@ -54,3 +54,14 @@
     1.4          for i in range(1, 6):
     1.5              m = hyper(i, Zp)
     1.6              self.assertTrue(self.is_hyper(m))
     1.7 +
     1.8 +    def test_not_hyper(self):
     1.9 +        """Check a non-hyper-invertible matrix."""
    1.10 +        Zp = GF(11)
    1.11 +        # This is an invertible matrix, but it is not hyper-invertible
    1.12 +        # since none of the three the upper 2x2 matrices are
    1.13 +        # invertible.
    1.14 +        m = Matrix([[Zp(2), Zp(3), Zp(4)],
    1.15 +                    [Zp(4), Zp(6), Zp(9)],
    1.16 +                    [Zp(3), Zp(5), Zp(8)]])
    1.17 +        self.assertFalse(self.is_hyper(m))