Boost logo

Boost Users :

From: abir basak (abirbasak_at_[hidden])
Date: 2007-04-04 10:00:30


Hi,
  I have a ublas vector (or it can be std::vector also). Where I want to
perform certain operation as a rotating basis.
The program below illustrates it.
std::vector<int> v;
v+=1,2,3,4,5,6,7,8,9;
ublas::vector<int> v1(v.size());
std::copy(v.begin(),v.end(),v1.begin());
std::cout<<ublas::sum(ublas::subrange(v1,1,3))<<std::endl;
std::cout<<ublas::sum(ublas::subrange(v1,7,2))<<std::endl;

In the first case I got a sum for [1 ,3) ,
I also want to get a sum for [7, 2) in a wrapped (circular )way.
So is there any range functionality provides it in that way ?
I also want some std algorithms to perform over some iterator adapter in
a wrapped way .I can write such iterators , but are they already exist
in boost ?

Thanks
abir basak

-- 
Abir Basak, Member IEEE
Software Engineer, Read Ink Technologies
B. Tech, IIT Kharagpur
email: abir_at_[hidden]
homepage: www.abirbasak.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net