Open GoogleCodeExporter opened 8 years ago
Hi,
The problem with the example is that the row indices have to be ordered, for
example:
for(uint32_t j = 0; j < ELEMENTS; j++) {
A_host.row_indices[j] = j / 2;
A_host.column_indices[j] = j % 2;
A_host.values[j] = 1;
}
This will give the correct result.
Maybe it would be good to have a way to automatically check for the correctness
of COO matrices as this problem has happened several times.
Cheers,
Filipe
Original comment by filipe.c...@gmail.com
on 2 Apr 2012 at 11:26
Checking format correctness has non-trivial cost, so we couldn't have it
enabled all the time. However, one thing we could do is apply
assert_is_valid_matrix [1] to the appropriate arguments when some CUSP_DEBUG
compilation mode was enabled. The format verification in cusp/verify.h is
fairly rigorous [2], so it could lessen the number of such reports.
[1] http://code.google.com/p/cusp-library/source/browse/cusp/verify.h
[2]
http://code.google.com/p/cusp-library/source/browse/cusp/detail/verify.inl#96
Original comment by wnbell
on 3 Apr 2012 at 1:44
Aaaah... sorry about that! Right there in the doxygen too: "The matrix entries
must be sorted by row index." Thanks for the help.
Original comment by robert.c...@gmail.com
on 3 Apr 2012 at 1:56
Original issue reported on code.google.com by
robert.c...@gmail.com
on 2 Apr 2012 at 10:31