Flattened Sparse Matrix vs Function Notation For Research Papers

51 Views Asked by At

I am currently working on writing a report for my research project, which involves flattened sparse matrices in the mathematics. Basically, I have multi-dimensional tensors of the form $ D \in \mathbb{Z}^{|A|\times |B|\times |C|} $, where $ A = \{a_i\}_{i=1}^{|A|} $, $B = \{b_i\}_{i=1}^{|B|}$, and $ C = \{c_i\}_{i=1}^{|C|} $.

I use the notation $ D[a, b, c] $ to represent the value of the matrix for the ath, bth, and cth location in all dimensions, respectively. However, the matrix $ D $ is sparse, and because only certain pairs of $ {a_i, b_j, c_k} $ are meaningful (thus having non-zero value in $ D[i, j, k] $), and the value for the others are zero.

I thought of two different ways of expressing this matrix. The first one is to define it as a multi-dimensional sparse matrix. The second one is to define it as a function as $ D: {S} \rightarrow \mathbb{R} $, where $ S $ is the set mapped to non-zero values.

I am also planning to implement the math I described in the paper in code, and I would like to make the code as similar as possible to the notation. I feel like it is more reasonable to use the sparse matrix notation in that case, however, I am not sure if I make it more confusing.