ufuncs, iterators

Simon Burton simon at arrowtheory.com
Thu Aug 18 21:12:48 CDT 2005


On Thu, 18 Aug 2005 20:50:12 -0500 (CDT)
Barry Smith <bsmith at mcs.anl.gov> wrote:

> 
>   Simon,
> 
>    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
> first.

Yes, it would be an error, that sounds the best to me.

> 
>    Barry
> 
> 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. 

OK, I will think about this. But what would be the strategy for doing all these
linear algebra operations ? Swap to/from Mat/DA objects ?

Simon.

> 
>    In Matlab   matrix == 2-d array == matrix (in my opinion a terrible design 
>                                              decision) 
>    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.
> > 
> > 


-- 
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940
http://arrowtheory.com 




More information about the petsc-dev mailing list