[petsc-users] Dense multiply Sparse

Jed Brown jedbrown at mcs.anl.gov
Fri May 25 08:49:05 CDT 2012


No, its not okay.

I think MatGetArray needs to be removed. Pretty much any use of it is
wrong. It is not even the right thing for dense matrices because they
should be distributed differently than PETSc does now.
On May 25, 2012 8:44 AM, "Hui Zhang" <mike.hui.zhang at hotmail.com> wrote:

> A new question: can I use MatSetValues in the following way?
>
> MatGetArray(A,&a);
> a[0]= 1;
> MatSetValues(A,...);    /* in particular, is this allowed inside
> GetArray/RestoreArray? */
> MatRestoreArray(A,&a);
>
> Thanks!
> Hui
>
> On May 14, 2012, at 2:29 PM, Barry Smith wrote:
>
> >
> >   If B is 50% dense then store it in a dense format. It will be much
> faster and the extra memory is minimal.  Even 30% dense.
> >
> >   Barry
> >
> > On May 14, 2012, at 5:13 AM, Hui Zhang wrote:
> >
> >> I have two matrices A and B stored in sparse format.  While A is really
> sparse, B is relatively
> >> dense (say non-zeros entries about 50%).  Now to multiply the two
> matrices, among
> >>
> >>     A*B
> >> or
> >>    (B^T * A^T)^T
> >>
> >> which is better, or no big difference ?
> >>
> >> Thanks!
> >>
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120525/ec261eaa/attachment.html>


More information about the petsc-users mailing list