behnamasadi/EigenDemo
About
Linear algebra, geometry and numerical optimization with Eigen and C++ — a 10-chapter tutorial with runnable examples (SVD, quaternions, SLAM, camera calibration, Levenberg-Marquardt)
LearningMeasured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalLinear Algebra With Eigen and C++
This repository contains my tutorials on mastering Matrix operation and numerical optimization with Eigen and C++.
Every chapter below is a written tutorial paired with a self-contained, compilable example in src/ — from
basic matrix arithmetic up to SVD-based camera calibration, point-cloud registration and sparse SLAM pose-graph solving.
Build and run
Requires a C++23 compiler (GCC 13+, Clang 17+, MSVC 2022), CMake >= 3.21 and
Ninja. Dependencies (Eigen 5, glm, orocos-kdl) are
declared in vcpkg.json and pinned by its builtin-baseline.
With vcpkg (Linux, Windows) — installs the pinned versions on first configure:
git clone https://github.com/behnamasadi/EigenDemo.git
cd EigenDemo
export VCPKG_ROOT=/path/to/vcpkg # Windows: $env:VCPKG_ROOT = "C:\path\to\vcpkg"
cmake --preset vcpkg
cmake --build --preset vcpkg-release
With system packages — Eigen 3.4 or 5; glm and orocos-kdl are optional:
sudo apt install libeigen3-dev libglm-dev liborocos-kdl-dev # Debian/Ubuntu
cmake --preset ninja-multi
cmake --build --preset ninja-multi-release
The binaries land in build/bin/Release/, one per example, so you can run any topic directly:
./build/bin/Release/singular_value_decomposition
./build/bin/Release/quaternion
./build/bin/Release/slam_pose_graph
The following is the outline of this repository:
Chapter 1 Introduction and Installation
Chapter 2 Matrix, Array and Vector Class
- Matrix Class
- Vector Class
- Array Class
- Initialization
- Accessing Elements (Coefficient)
- Casting Matrices
- Reshaping, Resizing, Slicing
- Tensor Module
Chapter 3 Matrix Operations
- Matrix Arithmetic
- Coefficient-Wise Operations
- Reductions
- Matrix Condition Number and Numerical Stability
- Check Matrices Similarity
- Broadcasting
Chapter 4 Advanced Eigen Operations
- Memory Alignment
- Passing Eigen objects by value to functions
- Aliasing
- Memory Mapping
- Unary Expression
- Eigen Functor
Chapter 5 Dense Linear Problems And Decompositions
- 1. Vector Space
- 2. Linear Equation
- 3. Solving Linear Equation
- 4. Matrices Decompositions
- 5. Linear Map
- 6. Span
- 7. Subspace
- 8. Range of a Matrix
- 9. Basis
- 10. Rank of Matrix
- 11. Dimension of the Column Space
- 12. Null Space (Kernel)
- 13. Nullity
- 14. Rank-nullity Theorem
- 15. The Determinant of The Matrix
- 16. Finding The Inverse of The Matrix
- 17. The Fundamental Theorem of Linear Algebra
- 18. Permutation Matrix
- 19. Augmented Matrix
Chapter 6 Sparse Matrices
Chapter 7 Geometry Transformation
- 1. Euler Angles
- 2. Global References and Local Tangent Plane Coordinates
- 3. Axis-angle Representation
- 4. Quaternions
- 5. Conversion between different representations
Chapter 8 Differentiation
Chapter 9 Numerical Optimization
- Newton's Method In Optimization
- Gauss-Newton Algorithm
- Quasi-Newton Method
- Curve Fitting
- Non Linear Least Squares
- Non Linear Regression
- Levenberg Marquardt
Chapter 10 Linear Algebra in Robotics
- Why decompositions matter
- Inverse Kinematics — the pseudo-inverse (SVD)
- Camera Calibration — DLT (SVD), projection decomposition (QR), Zhang (Cholesky)
- SLAM — least squares, QR vs Cholesky, and sparsity
- Point-Cloud Registration — Kabsch / Umeyama (SVD)
- PCA & Plane Fitting — eigendecomposition
- Further reading & related projects
Explore related projects
Loading…