how to combine several matrice into one matrix

Yujie recrusader at gmail.com
Sat Apr 19 18:08:50 CDT 2008


Dear Barry:

Regarding my method,






On 4/18/08, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>
>   For dense matrices only.
>
>   You can call MatGetArray() on A and then do direct copies of the arrays.
>
>  Barry
>
> On Apr 18, 2008, at 8:40 PM, Yujie wrote:
>
> Hi, everyone
> >
> > Assuming there are A1(M*N) A2(M*N) A3(M*N), I want to get
> >     A1
> > A=A2
> >     A3
> >
> > My method is
> >
> > MatGetArray(A1,&a1);
> > MatSetValues(A,a1);
> > MatGetArray(A2,&a2);
> > MatSetValues(A,a2);
> > MatGetArray(A3,&a3);
> > MatSetValues(A,a3);
> >
> > Is there any better methods for it? The above codes are slow. thanks a
> > lot.
> >
> > Regards,
> > Yujie
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080419/92b77745/attachment.htm>


More information about the petsc-users mailing list