simplify Floyd-Warshall logic
Fix LinearAlgebra.cc (hopefully- it still needs tests)