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

CholmodSupport and asserting CCS

Tags: None
(comma "," separated)
fari81
Registered Member
Posts
6
Karma
0
OS

CholmodSupport and asserting CCS

Sun Jul 24, 2011 5:33 am
Hello,

I'm using the Eigen/CholmodSupport in the development branch, and noticed that the viewAsCholmod does not check if Eigen::SparseMatrix uses Compressed Column Storage, and allows matrices of type Eigen::RowMajor to be wrapped as cholmod_sparse as well.

As far as I know, cholmod_sparse only support Compressed Column Storage (see page 8 of cholmod documentation). Using viewAsCholmod with an Eigen::RowMajor matrix will result in wrong results and possibly memory access violation. Perhaps it is a good idea to add an assert statement to ensure that viewAsCholmod is only used with Eigen::ColMajor and not Eigen::RowMajor.

Thanks,

fari
dmbates
Registered Member
Posts
24
Karma
0
OS
I believe you are correct that Cholmod assumes CCS and this should be checked. If you look at the viewAsCholmod template for the MatrixBase<Derived> case you will see that there is such a check in that version. It should probably go into the sparse version too.

On another matter I have been debugging an application that uses the CholmodDecomposition class and managed to convince myself that the memory problems I am seeing are in part due to the implementation of the solve methods for that class. I believe that they produce a Map<Matrix<...> > or MappedSparseMatrix<...> result with pointers to the contents of cholmod_dense or cholmod_sparse objects that are subsequently freed. I have sent a couple of messages to the eigen mailing list about this.


Bookmarks



Who is online

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