|
#include "stdafx.h"
#include "../include/Segments.h"
namespace mycell{
void GridSegments::merge_grid(int nGrid)
{
for(std::vector<GridSegment>::iterator it=begin();it!=end();++it){
_ASSERT(it->first<=it->second);
if(nGrid>=it->first && nGrid<=it->second){
return;
}else if(nGrid==it->first-1){
--(it->first);
return;
}else if(nGrid==it->second+1){
++(it->second);
return;
}
}
push_back(GridSegment(nGrid,nGrid));
}
}//namespace mycell
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
My name is Yanxueming,i live in Chengdu China.Graduated from UESTC in 1999.