Algorithms for Linear-Quadratic Optimization