Added implementations to SparseMatrix.rb