This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Effects of SparseMatrix sorted inner vector

Tags: None
(comma "," separated)
Registered Member
Eigen's documentation for sparse matrices states that "the elements of a given inner vector are guaranteed to be always sorted by increasing inner indices" ( This fact allows more efficient access and insert operations, but it causes issues when I try to use an Eigen::Map for sparse matrix types when the underlying storage does not follow the above ordering rules ( However, I realized that not all member functions of Eigen::SparseMatrix rely on the assumption of increasing inner indices; for example, the toDense method. Is there a comprehensive list of such functions? If they are not too many, I would then try to reimplement them for my codebase.

As a side note, I would be happy if there was an option to enable different inner index orders (increasing/decreasing/unordered) for sparse matrices :)


Who is online

Registered users: Bing [Bot], Google [Bot], kesang, Yahoo [Bot]