Minimal-dependency philosophy
The codebase is built on a minimal-dependency philosophy, relying primarily on the C++ standard library and a focused set of self-contained headers. This design choice ensures:- Portability: Minimal external requirements make integration straightforward
- Transparency: Clear dependency boundaries and predictable compilation
- Control: Users can opt into dependencies based on their specific needs
Core dependencies
MLPP requires only C++20 and optionally integrates with:- Eigen 3.4+: Linear algebra operations (recommended)
- Python3 + NumPy: Visualization support via matplotlib
- OpenCV: Computer vision integration
Header-only architecture
MLPP is structured as an interface library, meaning all functionality is provided through headers without requiring compilation of library binaries.Benefits of header-only design
No compilation required
No compilation required
Users include headers directly without building separate library binaries. This simplifies integration and eliminates ABI compatibility concerns.
Template-friendly
Template-friendly
Header-only design naturally supports generic programming with templates, enabling compile-time optimizations across the entire codebase.
Easy integration
Easy integration
Projects can include MLPP by adding a single include directory, making it trivial to integrate into existing build systems.
Module organization
The library is organized into logical modules, each exposing a concise interface:mlpp.h header.
Type system
MLPP defines a consistent type system across all modules:- Consistency: Uniform numeric types across the library
- Flexibility: Easy to change precision requirements globally
- Clarity: Explicit semantic meaning for numeric types
Design principles
Mathematical explicitness
Implementations closely follow mathematical formulations, making algorithms transparent and verifiable.
Predictable performance
Operations have clear complexity characteristics documented in code comments.
Independent modules
Each algorithm operates independently with minimal coupling between components.
Modern C++
Leverages C++20 features including concepts, ranges, and improved template metaprogramming.
Compile-time configuration
MLPP uses preprocessor definitions to enable optional features:MLPP_HAS_EIGEN: Eigen integration availableMLPP_WITH_PYPLOT: Matplotlib visualization enabledMLPP_HAS_OPENCV: OpenCV support compiled in