On Mon, Aug 4, 2008 at 10:53 PM, Ahmed El Zein 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, MAT_FINAL_ASSEMBLY); CHKER
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 non
Looks fine to me. I removed the gratuitous C++ and changed
#include to
#include
Do the PETSc examples work?
Barry
anlext2wls165:ksp/examples/tutorials] bsmith% ./ex1 -mat_view |& more
row 0: (1, 0.1) (5, 0.5) (7, 0.7)
row 1: (3, 1.1) (4, 1.2)
row 2: (1, 1.7) (3, 1.9) (6, 2.2)
st one MatAssembly() call versus a
> Begin and End call?
>
> btw fixing this did not affect the problem I had.
>
> Ahmed
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL:
<http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20080804/b4305472/attachment.pgp>
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
>> wrote:
>>> my code looks like:
>>> ierr = MatCreate(PETSC_COMM_WOR
On Aug 4, 2008, at 11:01 AM, Ahmed El Zein wrote:
>>
> Shouldn't that be the opposite? Isn't the whole idea of an
> interface, to
> have a set of functions that will work on all matrix types, regardless
> of implementation.
Yes. However GetIJ and GetArray are NOT in any way natural for
all
On Mon, Aug 4, 2008 at 9:58 AM, Ahmed El Zein 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 wrote:
>> > I am working on a project where I would like to copy a sparse matrix in
>> > CSR format.
>> >
>> > I have tried MatGetRow()
>>>
>>>
>>>
>> Make sure this is a MPI_SeqAIJ matrix.
> I thought that this would work with any seqaij matrix. does it have to
> be MPISEQAIJ or can it just be MATSEQAIJ?
>>
Sorry, my mistake. Yes a MATSEQAIJ matrix.
Barry
>>It is only valid to access this data after you have put t
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
On Mon, 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 m
10 matches
Mail list logo