0

I'm working on a project that is trying to optimize the time it takes to solve a dense matrix. Right now, matrices are being processed within C++ and as it stands there are no plans to change that. Looking at the CHOLMOD user manual and examples folder, I can't seem to find anything that shows a matrix not being read in from stdin or from a file.

Is there a way to convert an existing matrix (of type double *) to a cholmod_dense or some form that CHOLMOD can recognize so that I can solve for it?

Alternatively if there is some form that my matrices must be in before being converted, what form should that be in and is there a way to do it without temporarily writing results to a file and then reading it back into a cholmod_dense matrix?

Kami Kaze
  • 2,069
  • 15
  • 27
Alex
  • 2,145
  • 6
  • 36
  • 72
  • Maybe check cholmod's [docs](http://www.openflipper.org/svnrepo/OpenFlipper/tags/Animation/2010-09-10-Before-Cleanup/MacOS/Libs/cholmod/CHOLMOD/Doc/UserGuide.pdf)? And why you want to use a solver targeting sparse-matrices on dense ones? Why not stick to LAPACK and co.? – sascha Feb 06 '17 at 09:46
  • @sascha I've checked cholmod's docs. Unfortunately the only thing I'm seeing is reading in a matrix from a file. The only in-place ways to create a dense matrix seem to be pre-written routines to create a dense matrix of all zeroes or ones. Is there something I'm missing? Also, we've used LAPACK in the past and had decent speed, but ended up writing our own special implementation that was faster in our case. Despite this, solving a dense matrix is still the slowest part, so we are just trying new libraries out. :) – Alex Feb 06 '17 at 17:55
  • What? Your code was faster than LAPACK? This would surprise me. Did you analyze why? Was this benchmarked correctly? – sascha Feb 06 '17 at 18:11
  • Ah, and what you are looking for starts at page 8, bottom point 4: ```cholmod_dense``` (yeah, it's not nice, but it looks doable)! – sascha Feb 06 '17 at 18:15
  • 1
    @sascha Sorry, I realize what I said was misleading about it being faster. The solver is probably not faster than LAPACK, however loading libraries, checking, and allocating/de-allocating the matrices using LAPACK ended up taking a significant portion of time compared to just allocating/de-allocating and solving for the matrices with type `double*` inside the program. – Alex Feb 06 '17 at 18:27

0 Answers0