ufuncs, iterators

S V N Vishwanathan vishy at mail.rsise.anu.edu.au
Thu Aug 18 21:41:19 CDT 2005


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

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

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

I am not sure I understand the fine difference. As far as we are
concerned, all the operations which we are doing (point wise addition,
addition, multiplication etc.) are on the linear operator. But it might
be that my thought process is conditioned by years of Matlab/Octave
use. Can you maybe make this more explicit i.e. which situations would
you use a DA array and when would you use a Mat object?


More information about the petsc-dev mailing list