CSR Sparse Matrix Query

Dr. Timothy Stitt timothy.stitt at ichec.ie
Sat Apr 21 06:50:21 CDT 2007

Hi all,

I have just begun to use PETSc and I have already ran into a problem. 
Apologies if this has been dealt with before.

My code currently generates its own non-distributed Hamiltonian sparse 
matrix in CSR format (due to the large size of the dense 
representation). I want to exploit PETSc's (actually SLEPc's) 
eigensolver routines and hence I need to convert my CSR representation 
into PETSc CSR representation for use by the eigensolver. 

 From reading the documentation I am under the impression that you 
initially supply the dense matrix to the PETSc matrix routines for 
conversion to PETSc CSR representation. In my case I do not generate the 
dense matrix. I would be grateful if someone could guide me on to how to 
create a PETSC sparse matrix from my own in-code generated sparse matrix.

Thanks in advance for any assistance that can be provided.



Dr. Timothy Stitt <timothy_dot_stitt_at_ichec.ie>
HPC Application Consultant - ICHEC (www.ichec.ie)

Dublin Institute for Advanced Studies
5 Merrion Square - Dublin 2 - Ireland

+353-1-6621333 (tel) / +353-1-6621477 (fax) / +353-874195427 (mobile)

More information about the petsc-users mailing list