I really like "const" usage, but isn't this too much?

Barry Smith bsmith at mcs.anl.gov
Wed Dec 3 18:17:53 CST 2008


    That is wierd; it seems strange that it would even compile.

     BTW: I think your new change
7 - v->unplacedarray = v->array; /* save previous array so reset can  
bring it back */ 8
- v->array = (PetscScalar *)a; 9 +
  if (a) { 10 + v->unplacedarray = v->array; /* save previous array so  
reset can bring it back */ 11
+ v->array = (PetscScalar *)a; 12 + }
is TOTALLY wrong. It is perfectly legitimate to place null arrays and  
one wants
them to behave just like regular place arrays (saving the previous  
array).
Why did you make this change and what was wrong with the way it was?

   Barry


On Dec 3, 2008, at 4:45 PM, Lisandro Dalcin wrote:

> VecPlaceArray(Vec vec,const PetscScalar array[])
> VecReplaceArray(Vec vec,const PetscScalar array[])
>
> -- 
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
>




More information about the petsc-dev mailing list