I have a question about how the covert_to function works. #1515
-
Hello, I'm working on implementing the I/O of a data structure to use ginkgo. To convert from the internal structure of my simulator, I am implementing the The problem is, depending on how the COO matrix is generated, we found that it does not convert to the CSR matrx data format. Let's define the type as follows
Let's take
If we proceed with the conversion as above, if we check ConvertMtx with the debugger, we can see that it is compressed normally with However, the internal data type is a COO matrix made up of std::vectors, so I assumed that was the case and converted the matrix to three std::vectors and printed them out.
I put the rows, cols, and values of A.mtx into three std::vectors as shown above, and then used gko::array::view to recreate the COO Matrix, coomtx.
However, when we convert this As in the experiment above, we observed that the success of the conversion depends on how the matrix is created. Could there be something wrong with the implementation? What am I missing that is preventing it from working properly? I used |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The matrix dimensions you are setting here:
are not the correct ones. Instead of |
Beta Was this translation helpful? Give feedback.
The matrix dimensions you are setting here:
are not the correct ones. Instead of
gko::dim<2>(Arow.size(), Acol.size())
it should beCOOA->get_size()
. Right nowcoomtx
has as many rows as it has non-zero elements, which leads to the wrong Csr matrix.