Skip to content
Projects

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)

Learning

How these counts are measured

Measured 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

Original

Linear Algebra With Eigen and C++

CI
Linux GCC/Clang Windows MSVC Links CodeQL OpenSSF Scorecard

Stack
C++23 Eigen 3.4 | 5 CMake Platforms

Repository
License Last commit Commit activity Contributors Issues Pull requests Top language Code size Stars Forks

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

Chapter 3 Matrix Operations

Chapter 4 Advanced Eigen Operations

Chapter 5 Dense Linear Problems And Decompositions

Chapter 6 Sparse Matrices

Chapter 7 Geometry Transformation

Chapter 8 Differentiation

Chapter 9 Numerical Optimization

Chapter 10 Linear Algebra in Robotics

Explore related projects

Loading…