VariableBlockCompressedRowStorage
VariableBlockCompressedRowStorage is a memory‑efficient storage format for block‑sparse matrices where blocks are aligned along contiguous row and column ranges. This format is particularly useful when the matrix structure naturally groups into rectangular blocks with varying sizes.
The indices must be contiguous ranges for VBCRS, and no sanity check is performed during construction.
Below you will find a compact, step‑by‑step guide that shows how to
- Build a VBCRS matrix from a list of blocks and their starting indices.
- Multiply it with vectors (including transposes).
- Convert it from a
BlockSparseMatrix. - Convert it to a
SparseMatrixCSC.
Constructing a VariableBlockCompressedRowStorage
The key difference from BlockSparseMatrix is that VBCRS only needs the first index of each contiguous range rather than the full list of indices.
B = BlockSparseMatrix(blocks, testindices, trialindices, sizematrix)11250×11250 BlockSparseMatrix{ComplexF64} with 2637526 non-zero entries
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⣿⣿⣛⢘⡇⡃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠅⠭⠅⠀⠀⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⠀⠀
⠀⣛⢘⣿⣿⣳⣧⡄⠀⠀⡀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⢰⠿⠁⠀⠀
⠀⠭⠩⠽⣾⢿⣷⣠⣀⢀⢢⡆⠂⠀⠀⠀⠀⠁⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠀⢺⢿⣷⣿⣰⣆⡀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⠨⠭⠁⠀⠈⠀⠀⠀⠀
⠀⠀⠀⠀⠠⠠⣐⢛⣻⣿⣿⣮⡅⣭⠀⠀⠀⠀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠈⠉⠉⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠨⠉⠈⠹⠎⠿⢿⣷⣶⣒⣘⠃⠸⠅⠀⠘⠀⠀⠀⠀⠀⠀⡀⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠘⠃⠛⢸⢻⣿⣿⣵⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠅⠅⠅⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠶⠘⠑⠻⠻⣦⣰⣀⡀⣸⠃⠀⠀⠀⠀⠀⠁⠁⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⡅⡅⠀⠀⡥⠀⠀⠀⠀⠄⠖⠆⠀⠀⠐⢺⣿⣿⣇⠛⠀⢀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀
⠀⠁⠁⠀⠀⠁⠀⠀⠀⠀⠀⣀⠀⠀⠀⣀⣨⣭⠙⣿⣿⡄⠶⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⢀⢠⡍⢿⣷⣆⢰⣶⠚⠃⠀⠀⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠐⠀⢈⣙⣻⣾⣛⣀⠀⠀⠀⣤⠀⠄⠀⠀⠀⠸⠀⠀⠘⠘⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠛⠛⢸⠻⣦⣠⣀⢀⢠⠀⠀⠀⠀⠀⠈⠀⠀⠈⠈⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⠅⠅⠅⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⢺⢿⣷⣿⣰⢀⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠈⠁⠁⠁⠀⠀⠀⠀⠀⢀⠀⠀⣤⠀⣐⢛⣻⢿⣷⠸⠏⠇⠀⠀⠠⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡀⡀⡀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠄⠀⠀⠀⠰⡶⠆⣿⣿⣿⣭⣭⠿⠿⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡆⡆⡇⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠁⡟⣿⢻⣶⣶⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⡀⠀⠀⠀⠀⡀⣧⡟⠘⠛⠿⣧⣾⠷⢆⣶⠀
⠀⠀⢀⣴⡖⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠃⠀⠀⢾⡟⣿⣿⡍⣭⠀
⠀⠀⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠀⠀⠀⠀⣒⠀⡂⠀⠀⠀⠀⠀⠀⠀⠀⠀⢨⣵⡇⣭⣿⣿⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Here, testindices[1] and trialindices[1] show contiguous ranges for the first block
testindices[1], trialindices[1]([1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 36, 37, 38, 39, 40, 41, 42, 43, 44, 45])Now we can construct the VBCRS matrix by passing only the first index of each contiguous range
V = VariableBlockCompressedRowStorage(
blocks, first.(testindices), first.(trialindices), sizematrix
)11250×11250 VariableBlockCompressedRowStorage{ComplexF64} with 2637526 non-zero entries
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⣿⣿⣛⢘⡇⡃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠅⠭⠅⠀⠀⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⠀⠀
⠀⣛⢘⣿⣿⣳⣧⡄⠀⠀⡀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⢰⠿⠁⠀⠀
⠀⠭⠩⠽⣾⢿⣷⣠⣀⢀⢢⡆⠂⠀⠀⠀⠀⠁⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠀⢺⢿⣷⣿⣰⣆⡀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⠨⠭⠁⠀⠈⠀⠀⠀⠀
⠀⠀⠀⠀⠠⠠⣐⢛⣻⣿⣿⣮⡅⣭⠀⠀⠀⠀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠈⠉⠉⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠨⠉⠈⠹⠎⠿⢿⣷⣶⣒⣘⠃⠸⠅⠀⠘⠀⠀⠀⠀⠀⠀⡀⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠘⠃⠛⢸⢻⣿⣿⣵⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠅⠅⠅⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠶⠘⠑⠻⠻⣦⣰⣀⡀⣸⠃⠀⠀⠀⠀⠀⠁⠁⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⡅⡅⠀⠀⡥⠀⠀⠀⠀⠄⠖⠆⠀⠀⠐⢺⣿⣿⣇⠛⠀⢀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀
⠀⠁⠁⠀⠀⠁⠀⠀⠀⠀⠀⣀⠀⠀⠀⣀⣨⣭⠙⣿⣿⡄⠶⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⢀⢠⡍⢿⣷⣆⢰⣶⠚⠃⠀⠀⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠐⠀⢈⣙⣻⣾⣛⣀⠀⠀⠀⣤⠀⠄⠀⠀⠀⠸⠀⠀⠘⠘⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠛⠛⢸⠻⣦⣠⣀⢀⢠⠀⠀⠀⠀⠀⠈⠀⠀⠈⠈⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⠅⠅⠅⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⢺⢿⣷⣿⣰⢀⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠈⠁⠁⠁⠀⠀⠀⠀⠀⢀⠀⠀⣤⠀⣐⢛⣻⢿⣷⠸⠏⠇⠀⠀⠠⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡀⡀⡀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠄⠀⠀⠀⠰⡶⠆⣿⣿⣿⣭⣭⠿⠿⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡆⡆⡇⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠁⡟⣿⢻⣶⣶⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⡀⠀⠀⠀⠀⡀⣧⡟⠘⠛⠿⣧⣾⠷⢆⣶⠀
⠀⠀⢀⣴⡖⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠃⠀⠀⢾⡟⣿⣿⡍⣭⠀
⠀⠀⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠀⠀⠀⠀⣒⠀⡂⠀⠀⠀⠀⠀⠀⠀⠀⠀⢨⣵⡇⣭⣿⣿⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
V now behaves like a regular matrix but with significantly reduced storage overhead compared to storing full index arrays.
Matrix–Vector Products
@time V * x
@time V' * x
@time transpose(V) * x 0.182496 seconds (660.95 k allocations: 32.417 MiB, 97.91% compilation time)
0.129202 seconds (209.61 k allocations: 10.331 MiB, 29.85% gc time, 96.89% compilation time)
0.086860 seconds (203.05 k allocations: 10.015 MiB, 95.31% compilation time)All three operations are implemented in pure Julia and respect the block‑sparsity, with cache-friendly access patterns due to the compressed row storage layout.
Converting Between Formats
You can directly convert a BlockSparseMatrix to VBCRS format when the index structure satisfies the contiguity requirement
B = BlockSparseMatrix(blocks, testindices, trialindices, sizematrix)
V = VariableBlockCompressedRowStorage(B)11250×11250 VariableBlockCompressedRowStorage{ComplexF64} with 2637526 non-zero entries
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⣿⣿⣛⢘⡇⡃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠅⠭⠅⠀⠀⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⠀⠀
⠀⣛⢘⣿⣿⣳⣧⡄⠀⠀⡀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⢰⠿⠁⠀⠀
⠀⠭⠩⠽⣾⢿⣷⣠⣀⢀⢢⡆⠂⠀⠀⠀⠀⠁⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠀⢺⢿⣷⣿⣰⣆⡀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⠨⠭⠁⠀⠈⠀⠀⠀⠀
⠀⠀⠀⠀⠠⠠⣐⢛⣻⣿⣿⣮⡅⣭⠀⠀⠀⠀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠈⠉⠉⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠨⠉⠈⠹⠎⠿⢿⣷⣶⣒⣘⠃⠸⠅⠀⠘⠀⠀⠀⠀⠀⠀⡀⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠘⠃⠛⢸⢻⣿⣿⣵⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠅⠅⠅⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠶⠘⠑⠻⠻⣦⣰⣀⡀⣸⠃⠀⠀⠀⠀⠀⠁⠁⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⡅⡅⠀⠀⡥⠀⠀⠀⠀⠄⠖⠆⠀⠀⠐⢺⣿⣿⣇⠛⠀⢀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀
⠀⠁⠁⠀⠀⠁⠀⠀⠀⠀⠀⣀⠀⠀⠀⣀⣨⣭⠙⣿⣿⡄⠶⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⢀⢠⡍⢿⣷⣆⢰⣶⠚⠃⠀⠀⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠐⠀⢈⣙⣻⣾⣛⣀⠀⠀⠀⣤⠀⠄⠀⠀⠀⠸⠀⠀⠘⠘⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠛⠛⢸⠻⣦⣠⣀⢀⢠⠀⠀⠀⠀⠀⠈⠀⠀⠈⠈⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠨⠅⠅⠅⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⢺⢿⣷⣿⣰⢀⡀⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠈⠁⠁⠁⠀⠀⠀⠀⠀⢀⠀⠀⣤⠀⣐⢛⣻⢿⣷⠸⠏⠇⠀⠀⠠⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡀⡀⡀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠄⠀⠀⠀⠰⡶⠆⣿⣿⣿⣭⣭⠿⠿⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⡆⡆⡇⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠁⡟⣿⢻⣶⣶⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⡀⠀⠀⠀⠀⡀⣧⡟⠘⠛⠿⣧⣾⠷⢆⣶⠀
⠀⠀⢀⣴⡖⠀⠀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⠃⠀⠀⢾⡟⣿⣿⡍⣭⠀
⠀⠀⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠀⠀⠀⠀⣒⠀⡂⠀⠀⠀⠀⠀⠀⠀⠀⠀⢨⣵⡇⣭⣿⣿⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Sometimes you need a SparseMatrixCSC. The conversion is straightforward
V = VariableBlockCompressedRowStorage(
blocks, first.(testindices), first.(trialindices), sizematrix
)
s = sparse(V)11250×11250 SparseArrays.SparseMatrixCSC{ComplexF64, Int64} with 2637526 stored entries:
⎡⢿⣷⣿⠀⠿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠇⢿⠇⠀⠀⠀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡀⠀⎤
⎢⠛⠛⢻⣶⣧⣧⡄⠀⠀⡀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⣴⡟⠃⠀⎥
⎢⠿⠇⠭⣿⢿⣷⣆⣀⢀⠂⡆⠂⠀⠀⠀⠀⠃⠛⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠉⠈⢹⢻⣶⣰⣀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⢰⢸⠀⠀⠁⠀⠀⠀⎥
⎢⠀⠀⠀⠠⠠⠐⠐⢺⣿⣿⡇⣭⢭⠀⠀⠀⠀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠘⠐⠐⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠉⠨⠉⠉⠉⡍⣭⢿⣷⣰⣒⣐⠂⠰⠆⠀⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠃⠓⢰⢺⣿⣿⣵⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠅⠅⠅⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⠘⠑⠻⠻⣦⣰⠀⡀⣸⠃⠀⠀⠀⠀⠀⠁⠁⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⣭⣅⠀⠀⣭⠀⠀⠀⠀⠄⠰⠆⠀⠀⠐⠚⣿⣿⣇⠛⠀⢀⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⎥
⎢⠉⠁⠀⠀⠉⠀⠀⠀⠀⠀⢀⠀⠀⠀⣀⣨⣭⠙⣿⣿⡄⠶⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⢀⢠⡍⢿⣷⣆⢲⣶⠚⠃⠀⠀⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠐⠀⢨⣙⣻⣾⣫⣤⠀⠀⠠⢤⠠⠀⠀⠀⠀⠼⠀⠀⠛⠛⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠛⠋⣾⠻⣦⣠⣀⣀⣤⠀⠀⠀⠀⠀⠈⠀⠀⠈⠉⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠅⠅⠅⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⢺⢿⣷⣷⣶⢀⡀⡀⠀⠀⠀⠀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠁⠁⠁⠀⠀⠀⠀⠀⢀⠀⠀⣆⠀⣼⢹⣿⣿⣿⣰⠟⠆⠀⠀⡂⡀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⢀⣀⣀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠂⠀⠀⠀⠰⣴⠞⠿⣧⣯⣥⠍⠃⠋⠀⠀⠀⎥
⎢⠀⠀⠀⢀⠀⠀⣐⣒⢐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠈⠁⠏⣿⢿⣷⡧⠀⣀⠀⠀⠀⎥
⎢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡄⡀⠀⠀⠀⠠⠠⠧⠁⠉⠋⢿⣷⡿⣖⢐⣒⎥
⎢⠀⢠⣴⠿⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠋⠀⠀⠘⢻⢯⡿⣯⣬⣭⎥
⎣⠀⠈⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⣿⠀⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⢰⡆⣿⢿⣷⎦The VBCRS format is particularly memory‑efficient for this storage pattern, as it only stores the starting index of each contiguous block range rather than explicit lists of all indices.