Linear Algebra and Optimization for Machine Learning: A Textbook