Extension of the Ruby Matrix class