33 if(
this == &other )
return true;
35 if( (*this).Part() == other.Part() &&
36 (*this).Segment() == other.Segment() &&
37 (*this).Layer() == other.Layer() &&
38 (*this).Strip() == other.Strip() )
48 cout <<
"part overflow:\t" << part << endl;
60 cout <<
"segment overflow:\t" << segment << endl;
72 cout <<
"layer overflow:\t" << layer << endl;
83 if( strip > STRIP_INBOX_MAX || strip < 0 ) {
84 cout <<
"strip overflow:\t" << strip << endl;
102 for(
unsigned int i=0; i<aCol.size(); i++ ) {
103 if( part == aCol[i]->
Part() &&
104 segment == aCol[i]->
Segment() &&
105 layer == aCol[i]->
Layer() &&
106 strip == aCol[i]->
Strip() )
115 for(
unsigned int i=0; i<aCol.size(); i++ ) {
116 if( (*
this) == (*aCol[i]) )
return i;
124 for(
unsigned int i=0; i<aClusterCol.size(); i++ ) {
125 if( (*this).IsInCol ( aClusterCol[i] ) )
return i;
136 for(
unsigned int i=0; i<aCol.size(); i++ ) {
137 if( (*
this) == (*aCol[i]) )
num ++;
146 if( (*this).Part() == other.Part() &&
147 (*this).Segment() == other.Segment() )
156 if( (*this).Part() == other.Part() &&
157 (*this).Segment() == other.Segment() &&
158 (*this).Layer() == other.Layer() )
167 if( (*this).Part() == other.Part() &&
168 (*this).Segment() == other.Segment() &&
169 (*this).Layer() == other.Layer() &&
170 fabs( (*this).Strip() - other.Strip() ) == 1 )
179 for(
unsigned int i=0; i<aCluster.size(); i++ ) {
180 if( (*this).IsNeighborWith((*aCluster[i])) )
190 vector< mark_col > aClusterCol;
194 unsigned int circle = 0;
196 for(
unsigned int i=0; i<aMarkCol.size(); i++ )
199 for(
unsigned int j=0; j< aClusterCol.size(); j++ )
201 if( (*aMarkCol[i]).
IsInCol(aClusterCol[j]) !=-1 ) {
207 aClusterCol[j].push_back( aMarkCol[i] );
213 if( recordFlag == 0 )
216 aCluster.push_back( aMarkCol[i] );
217 aClusterCol.push_back( aCluster );
222 for(
unsigned int j = i+1; j<aMarkCol.size(); j++ )
224 if( (*aMarkCol[j]).
IsInCol(aClusterCol.back()) !=-1 )
continue;
226 aClusterCol.back().push_back( aMarkCol[j] );
228 }
while( circle < aMarkCol.size()-i-1);
237 vector< mark_col > aClusterCol;
240 unsigned int circle = 0;
241 for(
unsigned int i=0; i<aMarkCol.size(); i++ )
243 if( (*aMarkCol[i]).
IsInCol(checkedMarkCol) !=-1 )
continue;
246 aCluster.push_back( aMarkCol[i] );
247 aClusterCol.push_back( aCluster );
248 checkedMarkCol.push_back( aMarkCol[i] );
252 for(
unsigned int j = i+1; j<aMarkCol.size(); j++ )
254 if( (*aMarkCol[j]).
IsInCol(checkedMarkCol) != -1)
continue;
256 aClusterCol.back().push_back( aMarkCol[j] );
257 checkedMarkCol.push_back( aMarkCol[j] );
261 }
while(circle < aMarkCol.size()-i-1);
270 vector< mark_col > aClusterCol;
272 copyMarkCol = aMarkCol;
274 mark_col::iterator it1;
275 while( copyMarkCol.size() !=0 )
277 it1 = copyMarkCol.begin();
279 aCluster.push_back( copyMarkCol[0] );
280 aClusterCol.push_back( aCluster );
282 copyMarkCol.erase( it1 );
283 unsigned int circle = 0;
284 unsigned int size = 0;
285 unsigned int beginsize = copyMarkCol.size();
286 while( circle < beginsize )
288 mark_col::iterator it2;
289 size = copyMarkCol.size();
290 for(
unsigned int j=0, headNum=0; j < size; j++ )
292 it2 = copyMarkCol.begin() + headNum;
293 if( (copyMarkCol[headNum])->
IsNeighborWith( aClusterCol.back() ) ) {
294 aClusterCol.back().push_back( (copyMarkCol[headNum]) );
295 copyMarkCol.erase(it2);
310 vector< mark_col > aClusterCol;
312 bool recordFlag =
false;
313 unsigned int circle = 0;
315 for(
unsigned int i=0; i<aMarkCol.size(); i++ )
318 for(
int j= aClusterCol.size()-1; j>-1; j-- )
320 if( (*aMarkCol[i]).
IsInCol(aClusterCol[j]) !=-1 ) {
326 aClusterCol[j].push_back( aMarkCol[i] );
332 if( recordFlag ==
false )
335 aCluster.push_back( aMarkCol[i] );
336 aClusterCol.push_back( aCluster );
341 for(
unsigned int j = i+1; j<aMarkCol.size(); j++ )
343 if( (*aMarkCol[j]).
IsInCol(aClusterCol.back()) !=-1 )
continue;
345 aClusterCol.back().push_back( aMarkCol[j] );
347 }
while( circle < aMarkCol.size()-i-1);
357 vector< mark_col > aClusterCol;
368 default:
return (aClusterCol);
375 cout <<
"prt: " << m_Part
376 <<
"\tseg: " << m_Segment
377 <<
"\tlay: " << m_Layer
378 <<
"\tstr: " << m_Strip << endl;
383 for(
unsigned int i=0; i< aMarkCol.size(); i++ ) aMarkCol[i]->
Print();
388 for(
unsigned int i=0; i< aClusterCol.size(); i++ )
389 for(
unsigned int j=0; j< aClusterCol[i].size(); j++ ) {
390 aClusterCol[i][j]->Print();
vector< MucMark * > mark_col
bool IsInBoxWith(MucMark &other)
vector< mark_col > CreateClusterCol_A(mark_col &aMarkCol)
int NumInCol(mark_col &aCol)
bool IsNeighborWith(MucMark &other)
bool IsInSegWith(MucMark &other)
vector< mark_col > CreateClusterCol_C(mark_col &aMarkCol)
bool SetSegment(int segment)
vector< mark_col > CreateClusterCol(int buildMode, mark_col &aMarkCol)
bool operator==(MucMark &other)
vector< mark_col > CreateClusterCol_D(mark_col &aMarkCol)
vector< mark_col > CreateClusterCol_B(mark_col &aMarkCol)
int IsInCol(int part, int segment, int layer, int strip, mark_col &aCol)