Matrix computation test in Ruby