← Back to team overview

dolfin team mailing list archive

Re: array(), getRow() etc

 

On Tue, 2006-07-04 at 08:51 +0200, Anders Logg wrote:
> On Mon, Jul 03, 2006 at 04:12:12PM +0200, Garth N. Wells wrote:
> 
> > Anyone know anything about controlling template instantiation? I'd like
> > to compile an object files for a set of uBlasMatrix types, e.g.
> > 
> >   class uBlasDenseMatrix : uBlasMatrix<ublas_matrix> {};
> > 
> > Garth
> 
> It looks to me that this should be straightforward. The following
> should compile
> 
> uBlasDenseMatrix.h:
> 
>     class uBlasDenseMatrix : public uBlasMatrix<ublas_dense_matrix>
>     {
>         void foo();
>     }
> 
> uBlasDenseMatrix.cpp:
> 
>     void uBlasDenseMatrix::foo() {}
> 
> Or is that not the problem?
> 

Not quite. Doing it like this, the function uBlasDenseMatrix::foo is
compiled into an object file, but the member functions of
uBlasMatrix<ublas_dense_matrix> are not. They are compiled every time 
a uBlasDenseMatrix is declared (worst case scenario), or the compiler
tries to do some magic. I had hoped to compile the common matrix types
into the library.

Garth


> /Anders
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev



References