On Tue, 24 Jun 2008, Lisandro Dalcin wrote:
Well, that's not completelly true. What's wrong with building a type name from pieces in a temporary char[] (non-const) buffer, and pass it to XXXSetType() ?? Of course, PETSc internals will have to deal with the implementation detail of VecType, but the majority of USER code would be alleviated of such a detail.
You mean - instead of:
MatType t;
PetscMalloc(256*sizeof(char),&t); PetscStrcpy(t,"mytypenamepart1"); PetscStrcat(t,"someadditionalpart"); MatSetType(mat,t); <<<<<<<< do:
char *t;
PetscMalloc(256*sizeof(char),&t); PetscStrcpy(t,"mytypenamepart1"); PetscStrcat(t,"someadditionalpart"); MatSetType((MatType)mat,t);
I think this would handle only part of the problem. I'm ok with this impl. [to keep userinterface clean] There is the other issue of who does the free() on this malloc() [but I guess this issue exists in both of the above impls]. Satish
participants (1)
-
Satish Balay