Function that multiplies the scalar and a matrix.
Loads the "*=" operator. Scalar f is multiplied with matrix A by A *= f