# CHOLMOD implementation

I am working on a domain decomposition code in C that uses CHOLMOD to approximate grid values for a PDE in each sub-domain. The issue I have is that the methods use Matrix Market format, which is not an issue in general, but I already have a method that computes a 2D array which is the sparse matrix A in the Ax=b solve. I am not sure how I could either convert that into a sparse matrix using a method in CHOLMOD or if there was a way to save a Matrix Market text file on each loop call and somehow put it into A = cholmod_read_sparse or something else. Any insight would be much appreciated!

I do hope that your A that you assemble is a sparse matrix. Otherwise the use of sparse cholesky factorizations would not make sense. Then, if you didn't do this during the assembling process, you should turn it into a sparse matrix format as soon as possible.
Then -- and not knowing in what environment you are so that I can only guess -- it will be more efficient to pass the matrix directly to cholmod which will convert it for you (at least in the python interface) without doing the saving/loading step using the matrix market format.
• OK, I don't know C. But there are many formats of sparse matrices and there are definitely routines out there for your problem. Maybe you reformulate your question a bit towards how to construct a sparse matrix in C (for use in CHOLMOD) – Jan Aug 8 '16 at 13:45