|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
Classes | |
| struct | min_dim_test |
| Stops recursion when min(rows, cols) <= threshold. More... | |
| struct | max_dim_test |
| Stops recursion when max(rows, cols) <= threshold. More... | |
| struct | max_dim_test_static |
| Compile-time threshold version of max_dim_test. More... | |
| class | recursator |
| Wraps a matrix and provides quad-tree subdivision for block-recursive algorithms. More... | |
Functions | |
| constexpr bool | is_power_of_2 (std::size_t n) |
| True if n is a power of 2. | |
| constexpr std::size_t | first_part (std::size_t n) |
| Largest power of 2 that is <= n (for n >= 1). | |
| constexpr std::size_t | outer_bound (std::size_t n) |
| Smallest power of 2 that is >= n. | |
| template<typename Matrix, typename Function, typename BaseCaseTest> | |
| void | for_each (recursator< Matrix > rec, Function &&fn, const BaseCaseTest &is_base) |
| Recursively apply function to all base-case sub-regions of the recursator. | |
| constexpr std::uint64_t | lsb_mask (unsigned n) |
| Create a mask with the lowest N bits set. | |
| constexpr std::uint64_t | row_major_mask (unsigned k) |
| Row-major mask for block size K: interleaved bit pattern, the bits [i + k, i + 2k) for i = 0, 2k, 4k, ... below 64. | |
| constexpr std::uint64_t | col_major_mask (unsigned k) |
| Column-major mask for block size K: complement of row-major. | |
Variables | |
| constexpr std::uint64_t | morton_z_mask = UINT64_C(0x5555555555555555) |
| Morton Z-order mask: alternating bits for row/column interleaving Bit 0 = column, Bit 1 = row, Bit 2 = column, Bit 3 = row, ... | |
| constexpr std::uint64_t | morton_mask = ~morton_z_mask |
| Complement of morton_z_mask (row bits in Z-order). | |
| constexpr std::uint64_t | doppled_2_row_mask = row_major_mask(1) |
| Doppled row-major: blocks of 2 bits for row indices. | |
| constexpr std::uint64_t | doppled_2_col_mask = col_major_mask(1) |
| constexpr std::uint64_t | doppled_4_row_mask = row_major_mask(2) |
| Doppled with block size 4. | |
| constexpr std::uint64_t | doppled_4_col_mask = col_major_mask(2) |
| constexpr std::uint64_t | doppled_16_row_mask = row_major_mask(4) |
| Doppled with block size 16. | |
| constexpr std::uint64_t | doppled_16_col_mask = col_major_mask(4) |
| constexpr std::uint64_t | doppled_32_row_mask = row_major_mask(5) |
| Doppled with block size 32. | |
| constexpr std::uint64_t | doppled_32_col_mask = col_major_mask(5) |
| constexpr std::uint64_t | doppled_64_row_mask = row_major_mask(6) |
| Doppled with block size 64. | |
| constexpr std::uint64_t | doppled_64_col_mask = col_major_mask(6) |
| constexpr std::uint64_t | doppled_128_row_mask = row_major_mask(7) |
| Doppled with block size 128. | |
| constexpr std::uint64_t | doppled_128_col_mask = col_major_mask(7) |
|
constexpr |
Column-major mask for block size K: complement of row-major.
|
constexpr |
Largest power of 2 that is <= n (for n >= 1).
| void mtl::recursion::for_each | ( | recursator< Matrix > | rec, |
| Function && | fn, | ||
| const BaseCaseTest & | is_base ) |
Recursively apply function to all base-case sub-regions of the recursator.
|
constexpr |
True if n is a power of 2.
|
constexpr |
Create a mask with the lowest N bits set.
|
constexpr |
Smallest power of 2 that is >= n.
Above the largest power of 2 a size_t holds (2^63 on 64-bit) there is none: std::bit_ceil is undefined there, so it is rejected (issue 877).
|
constexpr |
Row-major mask for block size K: interleaved bit pattern, the bits [i + k, i + 2k) for i = 0, 2k, 4k, ... below 64.
For K=1: 0xAAAA... (odd bits set – row index bits) For K=2: 0xCCCC... (pairs of bits for row) For K >= 32 there is one block, clipped at bit 63 (K = 33: bits 33..63); for K >= 64 none (0). K = 0 has no blocks and the loop did not advance: it is rejected, which in a constant expression is a compile error (issue 877).
|
inlineconstexpr |
|
inlineconstexpr |
Doppled with block size 128.
|
inlineconstexpr |
|
inlineconstexpr |
Doppled with block size 16.
|
inlineconstexpr |
|
inlineconstexpr |
Doppled row-major: blocks of 2 bits for row indices.
|
inlineconstexpr |
|
inlineconstexpr |
Doppled with block size 32.
|
inlineconstexpr |
|
inlineconstexpr |
Doppled with block size 4.
|
inlineconstexpr |
|
inlineconstexpr |
Doppled with block size 64.
|
inlineconstexpr |
Complement of morton_z_mask (row bits in Z-order).
|
inlineconstexpr |
Morton Z-order mask: alternating bits for row/column interleaving Bit 0 = column, Bit 1 = row, Bit 2 = column, Bit 3 = row, ...