1. 程式人生 > >block compressed sparse row (BSR) matrix format

block compressed sparse row (BSR) matrix format

在這裡插入圖片描述

assume the size of block is 2

values  =  [1 0 2 1 6 7 8 2 1 4 5 1 4 3 0 0 7 2 0 0]
columns  = [0   1   1   1   2]
rowIndex = [0   2   3   5]

rowIndex[i] records the offset (in block) for each block-row i. i \in [0, blockrows]

rowIndex[i+1] - rowIndex[i] is the number of non-zero block in block-row i. rowIndex[blockrows] is the number of non-zero blocks in total.

columns[i] records the column’s index for the i-th non-zero block. columns has the same size of non-zero blocks.

values stores the non-zero blocks in row-major.