Re: [eigen] API change proposal

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


What I forgot to say: Although it doesn't look nice, in- and output may be 
confused, ..., I vote because of type-safety for

bool solve(const Matrix& b, Matrix& result)

If a user then calls

solve(a, *b)

with b a wild pointer, the error is in his code - and not in Eigen.

And solve (at least in 2.0.3) doesn't check if result == 0, so you cannot pass 
null. The function will crash shooting with wild pointers.

Greetings,
Markus

> > > Tim Hutt wrote:
> > > > 2009/7/24 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> > > >> You can pass null, right? The function will simply return. What else
> > > >> could happen?
> > > >
> > > > Obviously you never used gnome back in the day! Segfaults left right
> > > > and centre. Just because it is a good idea to check for NULL doesn't
> > > > mean every function does it in practice.
> > >
> > > very true. it can happen and hence it WILL happen that pointers go
> > > unchecked.
> > >
> > > its ridiculous to use pointers if you can - without any differences /
> > > limitations - also use non-const references.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/