dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #06760
Re: A general comment on bugs with uninitialized vectors
2008/3/25, Anders Logg <logg@xxxxxxxxx>:
> There are quite a few of these already (but they are missing in many
> places). For example, here is PETScMatrix::get:
>
> void PETScMatrix::get(real* block,
> uint m, const uint* rows,
> uint n, const uint* cols) const
> {
> dolfin_assert(A);
> MatGetValues(A,
> static_cast<int>(m),
> reinterpret_cast<int*>(const_cast<uint*>(rows)),
> static_cast<int>(n),
> reinterpret_cast<int*>(const_cast<uint*>(cols)),
> block);
> }
>
> Is this what you have in mind?
Looks good. Will dolfin_assert result in an exception or just kill the
application? An informative error message and stack trace is nice to
have. Will the code be removed in release builds or not?
--
Martin
Follow ups
References