Linear algebra and optimization