PetscTruth bool?

Lisandro Dalcin dalcinl at gmail.com
Wed Sep 24 09:27:21 CDT 2008


On Wed, Sep 24, 2008 at 10:51 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>   Since C++ has bool and C99 has bool, should PetscTruth be changed to be
> defined to be bool? Instead of int.

You mean instead of an enumeration, C++ is a bit more strict than C in
this point. At this point I'm +0 on this, but perhaps you could
elaborate a bit more the rationale for the change?


>
> Should we go further and simply remove PetscTruth and use bool directly in
> its place? (logical in Fortran).
>

Well, not sure again. In the same spirit, we could introduce
'PetscIndex' for integers that works as indices in vectors and
matrices, and plain 'int' for other things, like an iteration counter.

In short, such changes are more or less good, of course users will cry
porting their codes, and we have to update a lot of code. But anyway
PETSc developers never hesitate to do that if really needed. The
question is if such changes would really pay in the long term.



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