further about MatGetSubMatrices()

Barry Smith bsmith at mcs.anl.gov
Wed Dec 24 13:18:03 CST 2008


On Dec 23, 2008, at 5:36 PM, Yujie wrote:

> Dear Matthew:
>
> The question is that I can't sort the IS. Because I need extract the  
> matrix according to the index of IS. I have tried to use  
> MatPermute(). However, there is not MPIDense-based. I am wondering  
> why MatGetSubMatrices() need use the sorted IS.
>

    Because its damn hard to do the getsubmatrices if they are not  
sorted.

   Why not sort the IS in your call and then use that renumbering when  
it is needed in your code? An ordering is just a naming
of each value so once it is sorted that is just giving you a new  
naming and you can use that new naming everywhere.

    Barry

> Thanks a lot.
> Regards,
>
> Yujie
>
>
> On Tue, Dec 23, 2008 at 2:06 PM, Matthew Knepley <knepley at gmail.com>  
> wrote:
> You can sort them with ISSort.
>
>   Matt
>
> On Tue, Dec 23, 2008 at 12:35 PM, Yujie <recrusader at gmail.com> wrote:
> Hi, PETSc developer
>
> I am using MatGetSubMatrices() for my application. Because I need to  
> exact several matrices from the old one according to my index sets.  
> These index sets are not sorted. To MPIDense matrix, it didn't work.  
> could you give me some help? thanks a lot.
>
> Happy holiday:).
>
> Regards,
>
> Yujie
>
>
>
>
> -- 
> What most experimenters take for granted before they begin their  
> experiments is infinitely more interesting than any results to which  
> their experiments lead.
> -- Norbert Wiener
>




More information about the petsc-users mailing list