Theory and algorithms for semidefinite programming