how do you access the nonzero elements in SeqAIJ matrices

2008-08-05 Thread Ahmed El Zein
On Mon, 2008-08-04 at 07:57 -0500, Barry Smith wrote: On Aug 4, 2008, at 3:14 AM, Ahmed El Zein wrote: I am working on a project where I would like to copy a sparse matrix in CSR format. I have tried MatGetRow() which works OK but I would really like to get pointers to the 3

how do you access the nonzero elements in SeqAIJ matrices

2008-08-05 Thread Ahmed El Zein
On Mon, 2008-08-04 at 04:17 -0500, Matthew Knepley wrote: On Mon, Aug 4, 2008 at 3:14 AM, Ahmed El Zein ahmed at azein.com wrote: I am working on a project where I would like to copy a sparse matrix in CSR format. I have tried MatGetRow() which works OK but I would really like to get

how do you access the nonzero elements in SeqAIJ matrices

2008-08-05 Thread Zi-Hao Wei
On Mon, Aug 4, 2008 at 10:53 PM, Ahmed El Zein ahmed at azein.com wrote: my code looks like: ierr = MatCreate(PETSC_COMM_WORLD,A); CHKERRQ(ierr); ierr = MatSetSizes(A,M,N,M,N); CHKERRQ(ierr); ierr = MatSetType(A, MATSEQAIJ); CHKERRQ(ierr); ierr = MatAssemblyBegin(A,

how do you access the nonzero elements in SeqAIJ matrices

2008-08-05 Thread Ahmed El Zein
On Mon, 2008-08-04 at 10:38 -0500, Matthew Knepley wrote: On Mon, Aug 4, 2008 at 9:58 AM, Ahmed El Zein ahmed at azein.com wrote: On Mon, 2008-08-04 at 04:17 -0500, Matthew Knepley wrote: On Mon, Aug 4, 2008 at 3:14 AM, Ahmed El Zein ahmed at azein.com wrote: I am working on a project

how do you access the nonzero elements in SeqAIJ matrices

2008-08-05 Thread Ahmed El Zein
On Mon, 2008-08-04 at 23:13 +0800, Zi-Hao Wei wrote: On Mon, Aug 4, 2008 at 10:53 PM, Ahmed El Zein ahmed at azein.com wrote: my code looks like: ierr = MatCreate(PETSC_COMM_WORLD,A); CHKERRQ(ierr); ierr = MatSetSizes(A,M,N,M,N); CHKERRQ(ierr); ierr = MatSetType(A, MATSEQAIJ);

how do you access the nonzero elements in SeqAIJ matrices

2008-08-05 Thread Ahmed El Zein
On Mon, 2008-08-04 at 11:14 -0500, Barry Smith wrote: Send us the code. This is suppose to be easy stuff. I have attached the code. Ahmed Barry On Aug 4, 2008, at 11:09 AM, Ahmed El Zein wrote: On Mon, 2008-08-04 at 23:13 +0800, Zi-Hao Wei wrote: On Mon, Aug 4, 2008 at 10:53 PM,

how do you access the nonzero elements in SeqAIJ matrices

2008-08-05 Thread Ahmed El Zein
I downloaded and recompiled the latest PETSc release and it is working fine now. Thank you all for you time and your help. Ahmed On Mon, 2008-08-04 at 13:14 -0500, Barry Smith wrote: Looks fine to me. I removed the gratuitous C++ and changed #include private/matimpl.h to #include

how do you access the nonzero elements in SeqAIJ matrices

2008-08-04 Thread Ahmed El Zein
I am working on a project where I would like to copy a sparse matrix in CSR format. I have tried MatGetRow() which works OK but I would really like to get pointers to the 3 arrays directly. I also tried MatGetRowIJ() which allows me to get the i and j arrays but I can't see how to access the

how do you access the nonzero elements in SeqAIJ matrices

2008-08-04 Thread Matthew Knepley
On Mon, Aug 4, 2008 at 3:14 AM, Ahmed El Zein ahmed at azein.com wrote: I am working on a project where I would like to copy a sparse matrix in CSR format. I have tried MatGetRow() which works OK but I would really like to get pointers to the 3 arrays directly. I also tried MatGetRowIJ()

how do you access the nonzero elements in SeqAIJ matrices

2008-08-04 Thread Barry Smith
On Aug 4, 2008, at 3:14 AM, Ahmed El Zein wrote: I am working on a project where I would like to copy a sparse matrix in CSR format. I have tried MatGetRow() which works OK but I would really like to get pointers to the 3 arrays directly. I also tried MatGetRowIJ() which allows me to

how do you access the nonzero elements in SeqAIJ matrices

2008-08-04 Thread Matthew Knepley
On Mon, Aug 4, 2008 at 9:58 AM, Ahmed El Zein ahmed at azein.com wrote: On Mon, 2008-08-04 at 04:17 -0500, Matthew Knepley wrote: On Mon, Aug 4, 2008 at 3:14 AM, Ahmed El Zein ahmed at azein.com wrote: I am working on a project where I would like to copy a sparse matrix in CSR format. I

how do you access the nonzero elements in SeqAIJ matrices

2008-08-04 Thread Barry Smith
Send us the code. This is suppose to be easy stuff. Barry On Aug 4, 2008, at 11:09 AM, Ahmed El Zein wrote: On Mon, 2008-08-04 at 23:13 +0800, Zi-Hao Wei wrote: On Mon, Aug 4, 2008 at 10:53 PM, Ahmed El Zein ahmed at azein.com wrote: my code looks like: ierr =

how do you access the nonzero elements in SeqAIJ matrices

2008-08-04 Thread Alex Peyser
It's to let you interleave calls. You can call MatAssemblyBegin as soon as you've finished assembling the matrix, but you need not call MatAssemblyEnd until you require more operations on A. So you can build A (call Begin), build B (call Begin), build a vector x and b, and only call