Boost logo

Ublas :

From: Stephen Gross (sgross_at_[hidden])
Date: 2007-03-21 17:21:35


Ok, I got a working example together. For the sake of others who may want to do
the same thing, I'm posting my example so it will show up in the mailing list
archive:

--Steve

//====================================================
   ublas::vector<double> vct(10);
   ublas::indirect_array<> idx(3);

   for(int i = 0; i < 10; ++i) vct(i) = i;

   idx[0] = 9; idx[1] = 5; idx[2] = 7;

   ublas::vector_indirect<uvec> p = project (vct, idx);

   std::cout << vct << std::endl << p << std::endl;

   p[1] = 11;

   std::cout << vct << std::endl << p << std::endl;
//====================================================