Given two length- vectors and , we define the scalar product as the value obtained by multiplying each element of with the corresponding element of and summing up the products:
Given an matrix and a length- vector , we define the matrix-vector product as the dimensional vector , whose -th element is the scalar product of the -th row vector of with the vector :
For to be defined, the number of columns of must be equal to the length of .