csr_matrix column index order

96 views
Skip to first unread message

Roman

unread,
Sep 22, 2017, 4:56:06 AM9/22/17
to cusp-users

Hello Steven!

Please, can you tell about column index order in each row of csr matrix format in cusplibrary. According to the documentation [1]:
"The matrix entries within the same row must be sorted by column index"
Does it has influence on results of algorithms of matrix vector products?


[1] http://cusplibrary.github.io/classcusp_1_1csr__matrix.html#details

Steven Dalton

unread,
Sep 25, 2017, 9:43:04 AM9/25/17
to cusp-...@googlegroups.com
Hello Roman,

 In CSR format the column indices within each row are sorted by the column index. This ordering does not have any impact on some operations, such as sparse matrix-vector multiply, but it is used heavily during the conversion between formats and more complex operations, such as sparse matrix-sparse matrix multiply.

Steve

--
You received this message because you are subscribed to the Google Groups "cusp-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cusp-users+unsubscribe@googlegroups.com.
To post to this group, send email to cusp-...@googlegroups.com.
Visit this group at https://groups.google.com/group/cusp-users.
For more options, visit https://groups.google.com/d/optout.

Roman S

unread,
Sep 25, 2017, 3:09:02 PM9/25/17
to cusp-...@googlegroups.com
Hello, Steven.
Thank you for your answer. In my application I am collecting a matrix with unsorted column indices in each row. When I compare the resulting matricies collected by the apllication code compiled for the host and  for device they coincides well. But when I try to solve it by gmres method with scaled-bridson preconditioner of cusplibrary, it converges well for host and does not converges for the device compilation of the same code. Does the result may depend on column index order in each row?


25 сент. 2017 г. 16:43 пользователь "Steven Dalton" <sdal...@gmail.com> написал:

Roman

unread,
Sep 29, 2017, 12:18:11 PM9/29/17
to cusp-users
Hello Steven,

Is it possible some how to sort a column indices and values of each row of CSR matrix format on the device?

Thank you,
Roman

понедельник, 25 сентября 2017 г., 22:09:02 UTC+3 пользователь Roman написал:
Reply all
Reply to author
Forward
0 new messages