Generalized inner_product for Matrix<>
Edited SX virtual machine for clarity