Skip to content

How to make custom LinOp convertible to CSR? #1093

Answered by MarcelKoch
lahwaacz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @lahwaacz, I will try to address the points you have raised.

  1. Currently, our preconditioners expect that the matrix is in CSR format. If that is not the case, we try to convert the matrix into CSR format, which requires a copy. One exception is the Jacobi preconditioner with block_size=1 only reqiures that the diagonal can be extracted. We should improve our documentation to make this clear.
  2. If you want to implement a new LinOp type that is convertible to CSR, you have to implement the ConvertibleTo<Csr<value_type, index_type>> interface. This requires implementing the two functions void convert_to(Csr<value_type, index_type>* result) const and void move_to(Csr<value_type, index_type>*…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@lahwaacz
Comment options

@lahwaacz
Comment options

Answer selected by lahwaacz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1092 on August 18, 2022 13:04.