Skip to content

Instantly share code, notes, and snippets.

View nrenga's full-sized avatar

Narayanan Rengaswamy nrenga

View GitHub Profile
@nrenga
nrenga / g2rref.m
Last active May 30, 2022 20:39 — forked from esromneb/g2rref.m
matlab's rref function modified to operate in gf(2)
% This is a modified version of matlab's building rref which calculates
% row-reduced echelon form in gf(2). Useful for linear codes.
% Tolerance was removed because yolo, and because all values
% should only be 0 or 1. @benathon
function [Arref, M, N, rnk] = g2rref(A)
%G2RREF Reduced row echelon form in gf(2).
% R = RREF(A) produces the reduced row echelon form of A in gf(2).
%
% Class support for input A: