Changeset 361 for cpp/frams/model/similarity
- Timestamp:
- 04/18/15 17:31:31 (10 years ago)
- Location:
- cpp/frams/model/similarity
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/similarity/simil_match.cpp
r357 r361 26 26 27 27 // fill vectors with "unmatched" indicator 28 int i; 29 for (i = 0; i < (int) m_apvMatched[0]->size(); i++) 28 for (unsigned int i = 0; i < m_apvMatched[0]->size(); i++) 30 29 { 31 30 m_apvMatched[0]->operator[](i) = -1; 32 31 } 33 for (i = 0; i < (int)m_apvMatched[1]->size(); i++)32 for (unsigned int i = 0; i < m_apvMatched[1]->size(); i++) 34 33 { 35 34 m_apvMatched[1]->operator[](i) = -1; … … 149 148 // index of the smallest object 150 149 int nObj; 151 // index of an element152 int nElem;153 150 154 151 // find the smallest object (its index) … … 163 160 164 161 // check if all elements of the smallest object are matched 165 for (nElem = 0; nElem < (int) m_apvMatched[ nObj]->size(); nElem++)162 for (unsigned int nElem = 0; nElem < m_apvMatched[nObj]->size(); nElem++) 166 163 { 167 164 if (m_apvMatched[ nObj ]->operator[](nElem) < 0) … … 184 181 // result - assume that matching is empty 185 182 bool bResult = true; 186 int nElem;187 183 188 184 // matching is empty if either of objects has only unmatched elements 189 185 // so it may be first object 190 186 int nObj = 0; 191 for (nElem = 0; nElem < (int) m_apvMatched[ nObj]->size(); nElem++)187 for (unsigned int nElem = 0; nElem < m_apvMatched[nObj]->size(); nElem++) 192 188 { 193 189 if (m_apvMatched[ nObj ]->operator[](nElem) >= 0) … … 207 203 void SimilMatching::Empty() 208 204 { 209 int iObj; // a counter of objects 210 int iElem; // a counter of objects' elements 211 for (iObj = 0; iObj < 2; iObj++) 205 for (int iObj = 0; iObj < 2; iObj++) // a counter of objects 212 206 { 213 207 // for each object in the matching 214 for (iElem = 0; iElem < (int) m_apvMatched[ iObj ]->size(); iElem++) 208 for (unsigned int iElem = 0; iElem < m_apvMatched[iObj]->size(); iElem++) // a counter of objects' elements 215 209 { 216 210 // for each element iElem for the object iObj … … 228 222 void SimilMatching::PrintMatching() 229 223 { 230 int i;231 224 int nBigger; 232 225 … … 243 236 // print first line - indices of objects 244 237 printf("[ "); 245 for (i = 0; i < (int) m_apvMatched[ nBigger]->size(); i++)246 { 247 printf("%2 i", i);238 for (unsigned int i = 0; i < m_apvMatched[nBigger]->size(); i++) 239 { 240 printf("%2d ", i); 248 241 } 249 242 printf("]\n"); … … 254 247 // for both objects - print out lines of matched elements 255 248 printf("[ "); 256 for (i = 0; i < (int) m_apvMatched[ nObj]->size(); i++)249 for (unsigned int i = 0; i < m_apvMatched[nObj]->size(); i++) 257 250 { 258 251 if (IsMatched(nObj, i)) 259 252 { 260 253 // if the element is matched - print the index 261 printf("%2 i", GetMatchedIndex(nObj, i));254 printf("%2d ", GetMatchedIndex(nObj, i)); 262 255 } 263 256 else -
cpp/frams/model/similarity/simil_model.cpp
r356 r361 734 734 { 735 735 GetNeighbIndexes(mod, partInd, nIndexes); 736 for (int k = 0; k < (int)nIndexes.size(); k++)736 for (unsigned int k = 0; k < nIndexes.size(); k++) 737 737 { 738 738 newDeg += m_fuzzyNeighb[mod][nIndexes.at(k)][depth - 1]; … … 1722 1722 // wartości orginalne transformacji dOrig uzyskuje się przez: 1723 1723 // for ( iTrans = 0; iTrans <= TRANS_INDEX; iTrans++ ) dOrig *= dMul[ iTrans ]; 1724 //const char *szTransformNames[NO_OF_TRANSFORM] = { "ID", "S_yz", "S_xz", "S_xy", "R180_z", "R180_y", "R180_z", "S_(0,0,0)" }; 1724 1725 const int dMulX[ NO_OF_TRANSFORM ] = {1, -1, -1, 1, -1, 1, -1, -1}; 1725 1726 const int dMulY[ NO_OF_TRANSFORM ] = {1, 1, -1, -1, -1, -1, -1, 1}; 1726 1727 const int dMulZ[ NO_OF_TRANSFORM ] = {1, 1, 1, -1, -1, -1, 1, 1}; 1727 1728 1728 #undef max 1729 #ifdef max 1730 #undef max //this macro would conflict with line below 1731 #endif 1729 1732 double dMinSimValue = std::numeric_limits<double>::max(); // minimum value of similarity 1730 1733 int iMinSimTransform = -1; // index of the transformation with the minimum similarity
Note: See TracChangeset
for help on using the changeset viewer.