On Sun, Oct 18, 2009 at 6:17 PM, Benoit Jacob
<jacob.benoit.1@xxxxxxxxx> wrote:
(...) So I
think that the name useThreshold was a bit bad. How about renaming it
to setThreshold (so it's clear that it's a permanent change) and then
allow
lu.setThreshold(x).rank()
?
That sounds good.
It's just a habit that I have, to make variables protected, just in
case some day someone wants to inherit. It actually happens in
practice when people want to adjust the API e.g. to make porting
easier (I know that Thomas subclassed Matrix in the past).
Yes, I did that too.
Why should the destructor be virtual here? Is it important, in our
context, to allow referring to Derived objects as objects of the base
(here LU) type?
Because when somebody derives and calls delete on the base class the derived class's destructor will not be called - and we can't safeguard this case by making LU's destructor private. We need it to be public. Anyways, currently there is no harm done.
- Hauke