%module li_std_vectora %include std_vectora.i %{ #include #include #include %} %template(vector_i) std::vector >; %template(matrix_i) std::vector >,std::allocator > > >; %inline { typedef std::vector >, std::allocator > > > imatrix; std::vector vident(const std::vector >& v) { return v; } imatrix mident(const imatrix& v) { return v; } } %template(DoubleVector) std::vector >; %inline %{ typedef float Real; %} namespace std { %template(RealVector) vector >; } %inline %{ double average(std::vector > v) { return std::accumulate(v.begin(),v.end(),0.0)/v.size(); } std::vector > half(const std::vector >& v) { std::vector w(v); for (unsigned int i=0; i >;