← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Some more uBlasMatrix clean-ups.

 

On Fri, Apr 25, 2008 at 05:12:34PM -0500, Matthew Knepley wrote:
> On Fri, Apr 25, 2008 at 5:09 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
> >
> >
> >  Anders Logg wrote:
> >  > Why should the functions be virtual?
> >  >
> >
> >  This was discussed the other day (brought up by Ola)
> >
> >    http://www.fenics.org/pipermail/dolfin-dev/2008-April/007496.html
> >
> >  and has been implemented for a few functions in various la classes. I
> >  was indifferent before to it, but now I see a benefit with the matrix
> >  classes. If it's clear to me that a function is a virtual function, I
> >  know that it can't be inlined and there will be some overhead which is
> >  important to know for some operations.
> 
> One reason that inheritance is outmoded. Templated methods could be
> inlined, whereas virtual methods cannot.
> 
>   Matt

I think templates are overrated, hard to use, hard to debug and they
add to the compile time by not allowing separation of declarations and
definitions into .h and .cpp files.

-- 
Anders


References