LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Performance of Set Sparse Matrix Row

Solved!
Go to solution

I am new to the MASM (Multicore and Sparse Matrix) Toolkit.  I am impressed at the speed of the solution compared with my previous code which used a dense matrix solver.  For example, a matrix which took 93 sec to solve in dense form took only 72 msec to solve in sparse form. Smiley Happy

 

However, I now have a noticeable increase in the time required to build the matrix.  To build the dense matrix took only 180 msec, but to build the sparse matrix takes 9.7 sec.  Of course, I am happy to trade the 9.7 sec to build the sparse matrix for the 93 sec to solve the dense matrix.  But I am wondering whether I am using the sparse VIs most efficiently.  The Profile tool shows that the "Set Sparse Matrix Row (DBL).vi" requires the lion's share of the time to run my program.

 

I have attached a screen shot of the part of my code where I am building the matrix. Can anyone see a faster way to build the sparse matrix?

0 Kudos
Message 1 of 3
(3,153 Views)
Solution
Accepted by topic author StevePR

Do not have MASM, does it have Set element function - instead of set row?

Just 4 elements per row, others are zeros if I am not mistaken.

Message 2 of 3
(3,133 Views)

Thanks Alexander_Sobolev!  Good catch. Using the Set Element (4 times per loop) is about 8 - 10 times faster than using the Set Row in this application.

0 Kudos
Message 3 of 3
(3,110 Views)