Typed Linear Algebra - How to Not Crash on Mars
summary
An open source C++ library composes MPUnunits quantity types with existing backends (std::linalg/std::mdspan/Eigen/IGEN), using template metaprogramming, customization points and an element_cast to compute element types from two index type lists (n+m types suffice). Benchmarks show zero runtime cost with mdspan/Eigen but a big slowdown when storing elements in std::tuple; compilation time spikes (a 32×32 product compiles in ~16s vs <3s baseline) and larger sizes exhaust memory. Element-assignment via reinterpret_cast is undefined behavior and remains unsolved.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:27Mars Climate Orbiter failure
- 8:58Buckingham Pi theorem
- 14:00Strongly typed linear algebra library
- 21:55Matrix class constructors
- 31:49Typed matrix algorithms
- 40:59Integration with Igen and BLAS
- 47:47Memory ownership in matrices
- 57:22Element access pitfalls
- 1:06:59Performance benchmarks
- 1:14:48Future work in typed linear algebra
- 1:22:12Q&A
related talks
01h 18mC++ and Linear Algebra
01h 15mstd::linalg: Linear Algebra Coming to Standard C++
01h 00mIntroducing a matrix class to the C++ standard library
57mGraphBLAS: Building a C++ Matrix API for Graph Algorithms
28mFunctional Sparse Tensor Compilation
32mCompilation of Dynamic Sparse Tensor Algebra
01h 31mPast, Present and Future of Randomized Numerical Linear Algebra II
32mImmutable Arrays Help Mutating Arrays More Efficiently
