← Back to team overview

dolfin team mailing list archive

Re: SWIG and uBlas

 

On Mon, Jul 10, 2006 at 02:26:19PM +0200, Garth N. Wells wrote:

> My first implementation of DenseMatrix worked something like this. I
> changed it later because it didn't seem very elegant given that uBlas is
> written in C++. Also, it's not possible to access member functions of
> uBlasMatrixImplementation without a wrapper function or directly working
> with the pointer to uBlasMatrixImplementation. 

Why is it a problem to work with the pointer? Isn't it a good idea to
work with uBlasMatrix if you want to use the GenericMatrix interface,
and to work with uBlasMatrixImplementation (or
ublas_sparse_matrix/ublas_dense_matrix) if you want to use the uBlas
interface?

> 
> Would it help if rather than having 
> 
>    typedef uBlasMatrix<ublas_sparse_matrix> uBlasSparseMatrix;
> 
> we have 
> 
>    class  uBlasSparseMatrix : uBlasMatrix<ublas_sparse_matrix> {};?
> 
> Garth
> 

This doesn't help unfortunately. uBlasMatrix<ublas_sparse_matrix> is
not instantiable without knowing what ublas_sparse_matrix is. The
result is that SWIG ignores it and uBlasSparseMatrix becomes empty.

  Johan


Follow ups

References