ufuncs, iterators

Barry Smith bsmith at mcs.anl.gov
Thu Aug 18 20:50:12 CDT 2005


   There is not because what does MatSet() mean for a sparse matrix?
Make it dense, just set all the current nonzeros, error? You tell us,
I could live with either of the later two but don't really like the


BTW: possibly related note, are you using dense matrices sometimes
to represent "just" 2-arrays; that is, not as representations of linear
operators. If so, I do not think this is the correct approach! Conceptually
PETSc Mat's are linear operators I think it would be a big mistake to 
overload them as 2-arrays also. The "correct" approach is to use the 
DACreate2d() construct for handling 2-d arrays; With the DA the values
are stored into Vecs but there is additional information about 
the two array structure; it can be decomposed nicely in parallel and
one can set/access values with the usual two i,j indices. Of course if 
they are being used as operators ignore this. 

   In Matlab   matrix == 2-d array == matrix (in my opinion a terrible design 
   in PETSc    matrix (dense) != 2-d array , the are completely different 
                                             beasts mathematically


On Fri, 19 Aug 2005, Simon Burton wrote:

> Is there a way to simulate a MatSet (like VecSet)  ?
> Simon.

More information about the petsc-dev mailing list