Why the sparse pattern of a sparse matrix changed
3 次查看(过去 30 天)
显示 更早的评论
I'm building a sparse matrix through the mex function. Both the Ir and Jc properties are appointed in the mex function A. Later, this sparse matrix is returned to matlab, and is further transferred to another mex function B together with other parameters to assemble a large matrix.
For one test case, part of the Jc property of the created sparse matrix in the mex function A is as follows:
368
392
416
440
464
488
512
But when this sparse matrix is further transferred to mex function B, this part is altered and is as follows:
368
392
416
440
463
487
511
Actually, after this sparse matrix is established, I did no alternation about it. I want to know what may case this.
4 个评论
Bruno Luong
2021-4-11
You MUST NOT store 0 elements internally. Use spok I indicate bellow to check if your mex-build result is valid.
采纳的回答
Bruno Luong
2021-4-11
1 个评论
James Tursa
2024-1-28
Note that Tim Davis's spok function has been removed from the FEX. You can use my replacement function sarek instead:
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!