Changeset 352


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

comparison between signed and unsigned integer expressions fixed

Location:
cpp/frams
Files:
3 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);
  • cpp/frams/model/similarity/simil_match.cpp

    r349 r352  
    2727    // fill vectors with "unmatched" indicator
    2828    int i;
    29     for (i = 0; i < m_apvMatched[0]->size(); i++)
     29    for (i = 0; i < (int) m_apvMatched[0]->size(); i++)
    3030    {
    3131        m_apvMatched[0]->operator[](i) = -1;
    3232    }
    33     for (i = 0; i < m_apvMatched[1]->size(); i++)
     33    for (i = 0; i < (int) m_apvMatched[1]->size(); i++)
    3434    {
    3535        m_apvMatched[1]->operator[](i) = -1;
     
    8686    // check parameters of object 0
    8787    assert((Obj0 == 0) || (Obj0 == 1));
    88     assert((Index0 >= 0) && (Index0 < m_apvMatched[Obj0]->size()));
     88    assert((Index0 >= 0) && (Index0 < (int) m_apvMatched[Obj0]->size()));
    8989    // check parameters of object 1
    9090    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()));
    9292
    9393    // match given elements
     
    108108    // check parameters
    109109    assert((Obj == 0) || (Obj == 1));
    110     assert((Index >= 0) && (Index < m_apvMatched[ Obj ]->size()));
     110    assert((Index >= 0) && (Index < (int) m_apvMatched[ Obj ]->size()));
    111111
    112112    // check if the element is matched
     
    133133    // check parameters
    134134    assert((Obj == 0) || (Obj == 1));
    135     assert((Index >= 0) && (Index < m_apvMatched[ Obj ]->size()));
     135    assert((Index >= 0) && (Index < (int) m_apvMatched[ Obj ]->size()));
    136136
    137137    // return the index of the matched element
     
    163163
    164164    // 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++)
    166166    {
    167167        if (m_apvMatched[ nObj ]->operator[](nElem) < 0)
     
    189189    // so it may be first object
    190190    int nObj = 0;
    191     for (nElem = 0; nElem < m_apvMatched[ nObj ]->size(); nElem++)
     191    for (nElem = 0; nElem < (int) m_apvMatched[ nObj ]->size(); nElem++)
    192192    {
    193193        if (m_apvMatched[ nObj ]->operator[](nElem) >= 0)
     
    212212    {
    213213        // 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++)
    215215        {
    216216            // for each element iElem for the object iObj
     
    243243    // print first line - indices of objects
    244244    printf("[ ");
    245     for (i = 0; i < m_apvMatched[ nBigger ]->size(); i++)
     245    for (i = 0; i < (int) m_apvMatched[ nBigger ]->size(); i++)
    246246    {
    247247        printf("%2i ", i);
     
    254254        // for both objects - print out lines of matched elements
    255255        printf("[ ");
    256         for (i = 0; i < m_apvMatched[ nObj ]->size(); i++)
     256        for (i = 0; i < (int) m_apvMatched[ nObj ]->size(); i++)
    257257        {
    258258            if (IsMatched(nObj, i))
  • cpp/frams/model/similarity/simil_model.cpp

    r349 r352  
    735735                {
    736736                    GetNeighbIndexes(mod, partInd, nIndexes);
    737                     for (int k = 0; k < nIndexes.size(); k++)
     737                    for (int k = 0; k < (int) nIndexes.size(); k++)
    738738                    {
    739739                        newDeg += m_fuzzyNeighb[mod][nIndexes.at(k)][depth - 1];
     
    16801680int ModelSimil::MatchPartsGeometry()
    16811681{
    1682     // uniwersalne liczniki
    1683     int i, j;
    1684 
    16851682    // zaloz, ze sa modele i sa poprawne
    16861683    assert((m_Mod[0] != NULL) && (m_Mod[1] != NULL));
     
    17261723        // wartości orginalne transformacji dOrig uzyskuje się przez:
    17271724        // 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)"};
    17301725        const int dMulX[ NO_OF_TRANSFORM ] = {1, -1, -1, 1, -1, 1, -1, -1};
    17311726        const int dMulY[ NO_OF_TRANSFORM ] = {1, 1, -1, -1, -1, -1, -1, 1};
Note: See TracChangeset for help on using the changeset viewer.