permaviss.gauss_mod_p.gauss_mod_p

gauss_mod_p.py

This module implements Gaussian elimination by columns modulo a prime number p.

Functions

gauss_col(A, p) This function implements the Gaussian elimination by columns.
permaviss.gauss_mod_p.gauss_mod_p._index_pivot(l)[source]

Returns the pivot of a 1D array

Parameters:l (list(int)) – List of integers to compute pivot from.
Returns:Index of last nonzero entry on l. Returns -1 if the list is zero.
Return type:int
permaviss.gauss_mod_p.gauss_mod_p.gauss_col(A, p)[source]

This function implements the Gaussian elimination by columns.

A is reduced by left to right column additions. The reduced matrix has unique column pivots.

Parameters:
  • A (Numpy Array) – Matrix to be reduced
  • p (int(prime)) – Prime number. The corresponding field will be Z mod p.
Returns:

  • R (Numpy Array) – Reduced matrix by left to right column additions.
  • T (Numpy Array) – Matrix recording additions performed, so that AT = R