Linear programming with matrix variables