Sparse matrix indexing optimization

The 4* is now stored in the table to avoid computing it in the loop
This commit is contained in:
Jean-Marc Valin 2021-07-06 17:05:07 -04:00
parent 2681822c18
commit 54abdb6f5d
4 changed files with 10 additions and 10 deletions

View file

@ -80,7 +80,7 @@ def printSparseVector(f, A, name):
qblock = AQ[j*4:(j+1)*4, i*8:(i+1)*8]
if np.sum(np.abs(block)) > 1e-10:
nb_nonzero = nb_nonzero + 1
idx = np.append(idx, j)
idx = np.append(idx, j*4)
vblock = qblock.transpose((1,0)).reshape((-1,))
W0 = np.concatenate([W0, block.reshape((-1,))])
W = np.concatenate([W, vblock])