rename common_matrix_impl to matrix_base
use dot instead of operator * for 1-d matrix multiplication