I have always dealt with vector - matrix multiplication where the vector is the right multiplicand, but I am not sure how to apply the product between a matrix and a vector when the vector is the left multiplicand.
I have the following example
$$\beta = \begin{pmatrix} \beta_0 & \beta_1 \end{pmatrix} \in \mathbb{R}^{1 \times 2}$$
and a general matrix
$$A = \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22}\end{pmatrix} \in \mathbb{R}^{2 \times 2}$$
What would be the algorithm to multiply $\beta \cdot A$? Of course the result is a $1 \times 2$ row vector.
So essentially you wish to compute: $$ \begin{pmatrix} \beta_0&\beta_1 \end{pmatrix} \begin{pmatrix} a_{11}&a_{12}\\ a_{21}&a_{22} \end{pmatrix}.$$ This equals the following: $$\begin{pmatrix} a_{11}\beta_0+a_{21}\beta_1&a_{12}\beta_0+a_{22}\beta_1 \end{pmatrix} . $$ Hopefully it is clear how the multiplication works.