Couple of SCIRun5 questions. #2205
Replies: 1 comment
-
You have the first part exactly, #rows, #cols, #nonzero elements. Then SCIRun saves the outer indices (row counters) first, then the inner indices (columns), then the nonzero values. The “8” is there since the rows and columns are stored in an index form that specifies the width of the index variable in bytes (this is more crucial for the binary representation, but it uses the same code at the matrix level). The row accumulator vector should end in the number of nonzero elements (56 in this case), but the initial zero is extraneous—we may only write that for some ancient backward compatibility requirement. It’s not counting row index position, but # of zeros in each row (as partial sums). Since there is exactly one nonzero in every row, you get all the numbers from 1 to 56. The next vector has the column indices of each value, so that’s essentially the mapping in this case. Then the value vector is written in floating point, so no “8” printed—it’s always an 8-byte double—and these are just 1s so no decimal part is printed there either. If you hook up a CreateMatrix module to ConvertMatrixType (set to Sparse) to a WriteMatrix (saving as SCI ASCII), you can experiment with small example matrices to see how the format works. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a couple of questions regarding SCIRun5:
Any help in understanding these points would be much appreciated.
Thanks,
Peter.
^Please note that I had to change the filename extensions to be able to upload them.
simple-mesh.txt
test-cube.txt
Beta Was this translation helpful? Give feedback.
All reactions