Solutions¶
This page contains solutions for all exercises. Each solution is available as source code in the repository and often as a live example in Compiler Explorer.
- Back to exercises
- Running locally: Build solutions with
cmake -B build && cmake --build build(see setup guide)
Difficulty legend: 🟢 Beginner | 🟡 Intermediate | 🔴 Advanced
Basic Matrix and Vector Operations¶
1. Vector Creation and Access¶
🟢 Beginner | ⏱️ 5 min
- Source code: ex01.cpp
- Compiler Explorer: Open solution
2. Matrix Initialization¶
🟢 Beginner | ⏱️ 5 min
- Source code: ex02.cpp
- Compiler Explorer: Open solution
3. Basic Math Functions¶
🟢 Beginner | ⏱️ 10 min
- Source code: ex03.cpp
- Compiler Explorer: Open solution
4. Coefficient-wise Operations¶
🟡 Intermediate | ⏱️ 10 min
- Source code: ex04.cpp
- Compiler Explorer: Open solution
5. Matrix Operations¶
🟡 Intermediate | ⏱️ 10 min
- Source code: ex05.cpp
- Compiler Explorer: Open solution
6. Vector-Matrix Operations¶
🟡 Intermediate | ⏱️ 10 min
- Source code: ex06.cpp
- Compiler Explorer: Open solution
7. Special Matrix Operations¶
🟡 Intermediate | ⏱️ 15 min
- Source code: ex07.cpp
- Compiler Explorer: Open solution
Advanced Matrix Operations¶
8. Block Operations¶
🟡 Intermediate | ⏱️ 15 min
- Source code: ex08.cpp
- Compiler Explorer: Open solution
9. Row and Column Operations¶
🟡 Intermediate | ⏱️ 15 min
- Source code: ex09.cpp
- Compiler Explorer: Open solution
10. Resizing and Reshaping¶
🟡 Intermediate | ⏱️ 10 min
- Source code: ex10.cpp
- Compiler Explorer: Open solution
11. Concatenation¶
🟡 Intermediate | ⏱️ 15 min
- Source code: ex11.cpp
- Compiler Explorer: Open solution
12. Advanced Slicing¶
🔴 Advanced | ⏱️ 20 min
- Source code: ex12.cpp
- Compiler Explorer: Open solution
13. Linear Algebra Operations¶
🔴 Advanced | ⏱️ 20 min
- Source code: ex13.cpp
- Compiler Explorer: Open solution
14. Eigenvalues and Eigenvectors¶
🔴 Advanced | ⏱️ 20 min
- Source code: ex14.cpp
- Compiler Explorer: Open solution
Practical Applications¶
15. Image Processing Basics¶
🔴 Advanced | ⏱️ 30 min
- Source code: ex15.cpp
- Best run locally with compiled images (see setup guide)