java – Store the coordinates of a sparse matrix in a hash table


Hello. It is necessary to multiply the sparse matrices. To do this, the coordinates of the non-zero elements of the sparse table must be stored in a hash table. How can this be done? Is it possible to do this: values = new HashTable<Integer, new HashTable<Integer, Integer>> where key of the table is a non-zero element, value is coordinates


Standard multiplication of sparse matrices in CSR format with explanations: True, you have to translate from simple C ++ … But if you need not just to illustrate the algorithm, but to make it work quickly with huge matrices, it is better to do without self-written code, it is probably even possible to connect C libraries …

Scroll to Top