Changeset 352 for cpp/frams/_demos


Ignore:
Timestamp:
04/17/15 00:51:37 (5 years ago)
Author:
oriona
Message:

comparison between signed and unsigned integer expressions fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/simil_test.cpp

    r349 r352  
    9797    }
    9898
    99     char *params[] = {"<w_dP>", "<w_dDEG>", "<w_dNEU>", "<w_dGEO>"};
     99    const char *params[] = {"<w_dP>", "<w_dDEG>", "<w_dNEU>", "<w_dGEO>"};
    100100    for (int i = 0; i < M.GetNOFactors(); i++)
    101101    {
     
    160160    // create the empty array of similarities
    161161    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++)
    163163    {
    164164        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++)
    166166            aaSimil[k][l] = 0.0;
    167167    }
    168168
    169169    // compute and remember similarities
    170     unsigned int 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++)
    174174        {
    175175            dSimilarity = M.EvaluateDistance(pvGenos->operator[](i), pvGenos->operator[](j));
     
    183183        // print the number of genotypes and their names
    184184        printf("%li\n", pvGenos->size());
    185         unsigned int iGen;
    186         for (iGen = 0; iGen < pvNames->size(); iGen++)
     185        int iGen;
     186        for (iGen = 0; iGen < (int) pvNames->size(); iGen++)
    187187        {
    188188            printf("%s\n", pvNames->at(iGen));
     
    191191
    192192    // 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++)
    196196        {
    197197            printf("%.2lf\t", aaSimil[i][j]);
     
    201201
    202202    // delete vectors and arrays
    203     for (i = 0; i < pvGenos->size(); i++)
     203    for (i = 0; i < (int) pvGenos->size(); i++)
    204204    {
    205205        delete pvGenos->operator[](i);
Note: See TracChangeset for help on using the changeset viewer.