So, you want to multiply your sparse array by a not-sparse vector @p. Seems straightforward enough:
my @r = (0) x scalar(@p) ; for my $i (0..$#row_index) { $r[$row_index[$i]-1] += $realval[$i] * $p[$col_index[$i]-1] ; } ;
In reply to Re: Sparse Matrix Multiplication Problem
by gone2015
in thread Sparse Matrix Multiplication Problem
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |