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 wrap: on
line diff
--- a/viff/test/test_matrix.py	Mon Mar 31 13:48:03 2008 +0200
+++ b/viff/test/test_matrix.py	Tue Apr 01 14:50:49 2008 +0200
@@ -54,3 +54,14 @@
         for i in range(1, 6):
             m = hyper(i, Zp)
             self.assertTrue(self.is_hyper(m))
+
+    def test_not_hyper(self):
+        """Check a non-hyper-invertible matrix."""
+        Zp = GF(11)
+        # This is an invertible matrix, but it is not hyper-invertible
+        # since none of the three the upper 2x2 matrices are
+        # invertible.
+        m = Matrix([[Zp(2), Zp(3), Zp(4)],
+                    [Zp(4), Zp(6), Zp(9)],
+                    [Zp(3), Zp(5), Zp(8)]])
+        self.assertFalse(self.is_hyper(m))