 Timestamp:
 04/17/15 00:51:37 (9 years ago)
 Location:
 cpp/frams
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

cpp/frams/_demos/simil_test.cpp
r349 r352 97 97 } 98 98 99 c har *params[] = {"<w_dP>", "<w_dDEG>", "<w_dNEU>", "<w_dGEO>"};99 const char *params[] = {"<w_dP>", "<w_dDEG>", "<w_dNEU>", "<w_dGEO>"}; 100 100 for (int i = 0; i < M.GetNOFactors(); i++) 101 101 { … … 160 160 // create the empty array of similarities 161 161 aaSimil = new pDouble [pvGenos>size()]; 162 for ( unsigned int k = 0; k <pvGenos>size(); k++)162 for (int k = 0; k < (int) pvGenos>size(); k++) 163 163 { 164 164 aaSimil[k] = new double [pvGenos>size()]; 165 for ( unsigned int l = 0; l <pvGenos>size(); l++)165 for (int l = 0; l < (int) pvGenos>size(); l++) 166 166 aaSimil[k][l] = 0.0; 167 167 } 168 168 169 169 // compute and remember similarities 170 unsignedint i, j;171 for (i = 0; i < pvGenos>size(); i++)172 { 173 for (j = 0; j < pvGenos>size(); j++)170 int i, j; 171 for (i = 0; i < (int) pvGenos>size(); i++) 172 { 173 for (j = 0; j < (int) pvGenos>size(); j++) 174 174 { 175 175 dSimilarity = M.EvaluateDistance(pvGenos>operator[](i), pvGenos>operator[](j)); … … 183 183 // print the number of genotypes and their names 184 184 printf("%li\n", pvGenos>size()); 185 unsignedint iGen;186 for (iGen = 0; iGen < pvNames>size(); iGen++)185 int iGen; 186 for (iGen = 0; iGen < (int) pvNames>size(); iGen++) 187 187 { 188 188 printf("%s\n", pvNames>at(iGen)); … … 191 191 192 192 // print out the matrix of similarities 193 for (i = 0; i < pvGenos>size(); i++)194 { 195 for (j = 0; j < pvGenos>size(); j++)193 for (i = 0; i < (int) pvGenos>size(); i++) 194 { 195 for (j = 0; j < (int) pvGenos>size(); j++) 196 196 { 197 197 printf("%.2lf\t", aaSimil[i][j]); … … 201 201 202 202 // delete vectors and arrays 203 for (i = 0; i < pvGenos>size(); i++)203 for (i = 0; i < (int) pvGenos>size(); i++) 204 204 { 205 205 delete pvGenos>operator[](i); 
cpp/frams/model/similarity/simil_match.cpp
r349 r352 27 27 // fill vectors with "unmatched" indicator 28 28 int i; 29 for (i = 0; i < m_apvMatched[0]>size(); i++)29 for (i = 0; i < (int) m_apvMatched[0]>size(); i++) 30 30 { 31 31 m_apvMatched[0]>operator[](i) = 1; 32 32 } 33 for (i = 0; i < m_apvMatched[1]>size(); i++)33 for (i = 0; i < (int) m_apvMatched[1]>size(); i++) 34 34 { 35 35 m_apvMatched[1]>operator[](i) = 1; … … 86 86 // check parameters of object 0 87 87 assert((Obj0 == 0)  (Obj0 == 1)); 88 assert((Index0 >= 0) && (Index0 < m_apvMatched[Obj0]>size()));88 assert((Index0 >= 0) && (Index0 < (int) m_apvMatched[Obj0]>size())); 89 89 // check parameters of object 1 90 90 assert(((Obj1 == 0)  (Obj1 == 1)) && (Obj0 != Obj1)); 91 assert((Index1 >= 0) && (Index1 < m_apvMatched[Obj1]>size()));91 assert((Index1 >= 0) && (Index1 < (int) m_apvMatched[Obj1]>size())); 92 92 93 93 // match given elements … … 108 108 // check parameters 109 109 assert((Obj == 0)  (Obj == 1)); 110 assert((Index >= 0) && (Index < m_apvMatched[ Obj ]>size()));110 assert((Index >= 0) && (Index < (int) m_apvMatched[ Obj ]>size())); 111 111 112 112 // check if the element is matched … … 133 133 // check parameters 134 134 assert((Obj == 0)  (Obj == 1)); 135 assert((Index >= 0) && (Index < m_apvMatched[ Obj ]>size()));135 assert((Index >= 0) && (Index < (int) m_apvMatched[ Obj ]>size())); 136 136 137 137 // return the index of the matched element … … 163 163 164 164 // check if all elements of the smallest object are matched 165 for (nElem = 0; nElem < m_apvMatched[ nObj ]>size(); nElem++)165 for (nElem = 0; nElem < (int) m_apvMatched[ nObj ]>size(); nElem++) 166 166 { 167 167 if (m_apvMatched[ nObj ]>operator[](nElem) < 0) … … 189 189 // so it may be first object 190 190 int nObj = 0; 191 for (nElem = 0; nElem < m_apvMatched[ nObj ]>size(); nElem++)191 for (nElem = 0; nElem < (int) m_apvMatched[ nObj ]>size(); nElem++) 192 192 { 193 193 if (m_apvMatched[ nObj ]>operator[](nElem) >= 0) … … 212 212 { 213 213 // for each object in the matching 214 for (iElem = 0; iElem < m_apvMatched[ iObj ]>size(); iElem++)214 for (iElem = 0; iElem < (int) m_apvMatched[ iObj ]>size(); iElem++) 215 215 { 216 216 // for each element iElem for the object iObj … … 243 243 // print first line  indices of objects 244 244 printf("[ "); 245 for (i = 0; i < m_apvMatched[ nBigger ]>size(); i++)245 for (i = 0; i < (int) m_apvMatched[ nBigger ]>size(); i++) 246 246 { 247 247 printf("%2i ", i); … … 254 254 // for both objects  print out lines of matched elements 255 255 printf("[ "); 256 for (i = 0; i < m_apvMatched[ nObj ]>size(); i++)256 for (i = 0; i < (int) m_apvMatched[ nObj ]>size(); i++) 257 257 { 258 258 if (IsMatched(nObj, i)) 
cpp/frams/model/similarity/simil_model.cpp
r349 r352 735 735 { 736 736 GetNeighbIndexes(mod, partInd, nIndexes); 737 for (int k = 0; k < nIndexes.size(); k++)737 for (int k = 0; k < (int) nIndexes.size(); k++) 738 738 { 739 739 newDeg += m_fuzzyNeighb[mod][nIndexes.at(k)][depth  1]; … … 1680 1680 int ModelSimil::MatchPartsGeometry() 1681 1681 { 1682 // uniwersalne liczniki1683 int i, j;1684 1685 1682 // zaloz, ze sa modele i sa poprawne 1686 1683 assert((m_Mod[0] != NULL) && (m_Mod[1] != NULL)); … … 1726 1723 // wartości orginalne transformacji dOrig uzyskuje się przez: 1727 1724 // for ( iTrans = 0; iTrans <= TRANS_INDEX; iTrans++ ) dOrig *= dMul[ iTrans ]; 1728 const char *szTransformNames[ NO_OF_TRANSFORM ] = {"ID", "S_yz", "S_xz", "S_xy",1729 "R180_z", "R180_y", "R180_z", "S_(0,0,0)"};1730 1725 const int dMulX[ NO_OF_TRANSFORM ] = {1, 1, 1, 1, 1, 1, 1, 1}; 1731 1726 const int dMulY[ NO_OF_TRANSFORM ] = {1, 1, 1, 1, 1, 1, 1, 1};
Note: See TracChangeset
for help on using the changeset viewer.