← Back to team overview

dolfin team mailing list archive

Re: Python and std::vector (again)

 

On Sun, Mar 07, 2010 at 12:11:53PM +0000, Garth N. Wells wrote:
> I've added the function
>
>   GenericVector::sum(const std::vector<uint>& rows)
>
> which will sum the given row entries. But, frustratingly, it doesn't
> work through Python. I can't pass a list or numpy array to it. I get the
> error
>
> TypeError: in method 'GenericVector_sum', argument 2 of type
> 'std::vector< dolfin::uint > const &'
>
> How can I pass a list of integers to this function from Python? It seems
> that we haven't resolved passing std::vector from Python to C++
> satisfactorily.
>
> Garth

Why std::vector? I thought we discussed replacing it with
dolfin::Array in the interface so that it would map easily to Python
which would let us remove the std::vector typemaps.

--
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References