
Hi, I have n arrays of float and I need to take median of all the values. I have a nifty templatized implementation median(start stop) and I don't have the space to make a copy of all the arrays. Well I do most of the times but I like zero-copy implementations. So I was thinking that I could use an itarator that spans multiple ranges. Something like Vector<float a,b>; [fill them] Multiple_range_iterator<vector<float::iterator> start(a.end(),b.begin()), stop(start); start = a.begin(); stop = b.end(); cout << median(start, stop); Of course this needs to be extended to n ranges. The intended meaning is that incrementing start would apply the increment operator of the argument type until it reaches a.end(), where it would jump straight to b.begin(). You can imagine how random jumps and comparisons are defined. I guess < would bring trouble. Well, the question is: has anyone seen anything like this? Does it make sense? Should I start from iterator_adaptor? Any suggestions (no, "go get another job" is not admissible)? Thanks Antonio

"Piccolboni, Antonio" <Antonio_Piccolboni@affymetrix.com> writes:
Well, the question is: has anyone seen anything like this? Does it make sense? Should I start from iterator_adaptor? Any suggestions (no, "go get another job" is not admissible)? Thanks
I think you should start with http://tinyurl.com/49o8j. Cheers, -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (2)
-
David Abrahams
-
Piccolboni, Antonio