Sparse Ax = b with WebAssembly text format
A wasm module is defined with wat
Within the module, two components are defined:
A, x, and b are stored in the linear memory.
- shared linear memory
- sparse_mul function
A is sparse format: row, col, val, row, col, val, ...
x and b are dense format: x0,x1,x2,x3,x4, ...
sparse_mul inputs the offset address of A,x,b, and the number of entries in A.
it adds A*x to b (within the linear memory)
test: matrix of ones multiplied by sparse identity matrix
x = [1,1,1].
A = [0,0,1, 1,1,0, 2,2,0]
A*x = ...