Skip to content

Instantly share code, notes, and snippets.

View pmelanson's full-sized avatar
💭
😠 rancorous

Patrick Melanson pmelanson

💭
😠 rancorous
  • Seattle, WA
View GitHub Profile
@pmelanson
pmelanson / gauss.rb
Last active August 29, 2015 14:14 — forked from trishume/gauss.rb
# Step-By-Step Gaussian Elimination on Augmented Matrices
# By Tristan Hume
require "rational"
def reduce_down(mat)
# Use each row going down to cancel lower rows
# Each iteration of this loop is one step
rows = mat.length
(0..rows-2).each do |ri1|