Changeset 361 for cpp/frams/_demos
- Timestamp:
- 04/18/15 17:31:31 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/simil_test.cpp
r359 r361 36 36 ... 37 37 <row_n> 38 39 Last modified: 2015-04-1640 38 */ 41 39 int main(int argc, char *argv[]) … … 160 158 // create the empty array of similarities 161 159 aaSimil = new pDouble [pvGenos->size()]; 162 for ( int k = 0; k < (int)pvGenos->size(); k++)160 for (unsigned int k = 0; k < pvGenos->size(); k++) 163 161 { 164 162 aaSimil[k] = new double [pvGenos->size()]; 165 for (int l = 0; l < (int)pvGenos->size(); l++)163 for (unsigned int l = 0; l < pvGenos->size(); l++) 166 164 aaSimil[k][l] = 0.0; 167 165 } 168 166 169 167 // compute and remember similarities 170 int i, j; 171 for (i = 0; i < (int) pvGenos->size(); i++) 172 { 173 for (j = 0; j < (int) pvGenos->size(); j++) 168 for (unsigned int i = 0; i < pvGenos->size(); i++) 169 { 170 for (unsigned int j = 0; j < pvGenos->size(); j++) 174 171 { 175 172 dSimilarity = M.EvaluateDistance(pvGenos->operator[](i), pvGenos->operator[](j)); … … 183 180 // print the number of genotypes and their names 184 181 printf("%li\n", pvGenos->size()); 185 int iGen; 186 for (iGen = 0; iGen < (int) pvNames->size(); iGen++) 182 for (unsigned int iGen = 0; iGen < pvNames->size(); iGen++) 187 183 { 188 184 printf("%s\n", pvNames->at(iGen)); 189 185 } 190 } // if (bPrintNames)186 } 191 187 192 188 // print out the matrix of similarities 193 for (i = 0; i < (int)pvGenos->size(); i++)194 { 195 for (j = 0; j < (int)pvGenos->size(); j++)189 for (unsigned int i = 0; i < pvGenos->size(); i++) 190 { 191 for (unsigned int j = 0; j < pvGenos->size(); j++) 196 192 { 197 193 printf("%.2lf\t", aaSimil[i][j]); … … 201 197 202 198 // delete vectors and arrays 203 for (i = 0; i < (int)pvGenos->size(); i++)199 for (unsigned int i = 0; i < pvGenos->size(); i++) 204 200 { 205 201 delete pvGenos->operator[](i);
Note: See TracChangeset
for help on using the changeset viewer.