def hcat(y)
      unless self.dims[0] == y.dims[0]
        raise ArgumentError, "Matrices must have same number of rows"
      end
      DoubleMatrix.concat_horizontally(self, y)
    end
def hcat(y)
      unless self.dims[0] == y.dims[0]
        raise ArgumentError, "Matrices must have same number of rows"
      end
      DoubleMatrix.concat_horizontally(self, y)
    end
Return a new matrix which consists of the _self_ and _y_ side by
 side.  In general the hcat method should be used sparingly as it
 creates a new matrix and copies everything on each use. You
 should always ask yourself if an array of vectors or matrices
 doesn't serve you better. That said, you _can_ do funny things
 with +inject+. For example,

   a = mat[1,2,3]
   [a, 2*a, 3*a].inject {|s,x| s = s.hcat(x)}
   => 1.0  2.0  3.0
      2.0  4.0  6.0
      3.0  6.0  9.0