BUG: solve issue #2649.

The issue is similar to #473, multipliaction of a matrix and a
column-vector returns a row-vector. That solution is to convert 1d
array, list, tuple to matrix before multiplying. What causes #2649 is that
matrix will use dot function which is inherited from ndarray. My solution is
to use __mul__ function instead. It will throw an error when user try to
multiply a squre matrix and a 1d array.