Package viff :: Module matrix
[hide private]
[frames] | no frames]

Module matrix

source code

Matrix operations. This module contains basic matrix operations as well as a function to build square hyper-invertible matrices. The matrix implementation provides operator overloading and works with any type that acts like a number, including viff.field.GF256 and viff.field.GF elements.
Classes [hide private]
  Matrix
A matrix.
Functions [hide private]
 
hyper(n, field)
Makes an n times n hyper-invertible square matrix.
source code
Function Details [hide private]

hyper(n, field)

source code 

Makes an n times n hyper-invertible square matrix. The matrix entries will belong to field.

A hyper-invertible matrix is a matrix where every sub-matrix is invertible. A sub-matrix consists of an arbitrary subset of the rows and columns of the original matrix (and is not necessarily a contiguous region).

>>> from field import GF
>>> Zp = GF(47)
>>> print hyper(2, Zp)
[[{46}  {2}]
 [{45}  {3}]]
>>> print hyper(3, Zp)
[[ {1} {44}  {3}]
 [ {3} {39}  {6}]
 [ {6} {32} {10}]]