How libigl/eigen works
Project Type and Purpose
• Eigen is a C++ library meant for linear algebra computations. Its purpose is to provide a wide range of mathematical functionality—including but not limited to dense and sparse matrices, solvers (LU, QR, Cholesky, eigenvalue algorithms, etc.), geometry modules, and even some unsupported experimental features (like tensor operations and auto-differentiation).
File Structure to Identify Main Components
• Core Library Modules:
• “Eigen/Core”, “Eigen/Dense”: These contain the essential vector and matrix definitions and operations.
• “Eigen/Sparse”, “Eigen/SparseCore”, “Eigen/SparseLU”, “Eigen/SparseQR”, etc.: Represent the sparse matrix functionality.
• “Eigen/Cholesky”, “Eigen/QR”, “Eigen/SVD”, “Eigen/Eigenvalues”: These directories provide various matrix factorizations and solvers.
• “Eigen/Geometry”: Contains the modules for geometric transformations using matrices and quaternions.
• “Eigen/IterativeLinearSolvers”, “Eigen/LU”, “Eigen/Jacobi”, etc.: More specialized solvers and algorithms.
• Supporting Code and Configuration:
• Build and configuration files such as “CMakeLists.txt” and numerous “cmake” subdirectories.
• Documentation (“doc” folder) and examples/demos (“demos” folder) that show how to use the library.
• Test directories (“test”, “bench”, “failtest”) that ensure correctness and performance.
• Unstable/Experimental Components:
• “unsupported”: Contains modules that are experimental or not part of the official core but extend functionality (e.g., tensor support, auto-differentiation).
Relationship and Interactions
• The core modules depend on one another. For example, the “Core” module supplies the basic types that every other module (solvers, geometry, iterative methods) will use.
• Solver modules like “Cholesky”, “QR”, “SVD”, and “Eigenvalues” use and extend the capabilities of the Core/dense module.
• The sparse modules have their own substructure (such as “SparseCore” and specialized sparse solver routines) and often interface with the dense modules.
• Build configuration (via CMake and cmake scripts) underpins the whole library, integrating testing, benchmarking, and demo executions.
• Documentation and example directories are separate from the library’s runtime components but are crucial for understanding and verifying usage.