Boost logo

Ublas :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2006-12-08 02:23:00

pinacle wrote:

> Thanks Fres and Gunter. This is exactly what I want. But the code listed
> below gives me an error on the "project" line due to the ambiguous
> overloading as:

> [...]

> Could you please point out how to solve this problem?

Well, it was really long time ago and unfortunately we never wrote any
documentation and I forgot almost everything.

But it seems to me that you must use indirect_array<> class for
indexing. Function project() is in vector_proxy.hpp declared as

   template<class V, class A>
   vector_indirect<V, indirect_array<A> > project
      (V &data, const indirect_array<A> &ia)

Class indirect_array<> is defined in storage.hpp and there is a "forward
declaration" in fwd.hpp:

   template<class A = unbounded_array<std::size_t> >
      class indirect_array;

So, I think that your code should be something like:

   ublas::vector<double> vct(10);
   ublas::indirect_array<> idx(3);
   // ...
   project (vct, idx);

Hope this helps. Regards,