Find inner product of matrices and polynomial vectors