[petsc-users] Whether can one set the row and col sizes of a Mat to zero when creating it?

Yujie recrusader at gmail.com
Mon May 10 16:41:42 CDT 2010


Dear Barry,

Thank you for your reply.

One can create an array with zero sizes. When he wants to set the
values of the array, he can use
"
for(i=0; i<m;++i)
"
he doesn't need to consider whether the size of the array is zero
since "loop for" can handle it even if the size of the array is zero.

Whether is the operation done for Mat and Vec? I mean
one can use
"
Mat(Vec)SetValues()
"
regardless of the size of Mat and Vec.

Thanks again.

Regards,
Yujie

On Mon, May 10, 2010 at 4:16 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>  Yes, Mats and Vecs can have zero sizes. They are just like other Mats and Vecs but with no space allocated for data.
>
>  Since these are not commonly used they may have glitches, let us know about them and we will fix them.
>
>   Barry
>
> On May 10, 2010, at 4:08 PM, Yujie wrote:
>
>> Dear PETSc developers,
>>
>> Whether can one set the row and col sizes of a Mat to zero when creating it?
>> How about a Vec?
>>
>> If we can, how about the object of Mat and Vec? thanks a lot.
>>
>> Regards,
>> Yujie
>
>


More information about the petsc-users mailing list