Changeset f07fec in git


Ignore:
Timestamp:
Feb 4, 2014, 12:54:15 AM (10 years ago)
Author:
Max Horn <max@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
9bc6bcbce12e05ef128c69bb444e6d03f1fd2ff0
Parents:
994c3dc99d02ae0db55a193692a2e41b6a562bcd
Message:
Silence compiler warnings about ambiguous looking 'else'
Location:
IntegerProgramming
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • IntegerProgramming/binomial.cc

    r994c3d rf07fec  
    147147
    148148    if(i<size_of_support_vectors)
     149    {
    149150      // variable i is considered in the support vectors
    150151      if(actual_entry>0)
    151152        head_support|=(1<<i);
    152153        // bit i of head_support is set to 1 (counting from 0)
    153       else
    154         if(actual_entry<0)
    155           tail_support|=(1<<i);
    156     // bit i of tail_support is set to 1
     154      else if(actual_entry<0)
     155        tail_support|=(1<<i);
     156        // bit i of tail_support is set to 1
     157    }
    157158  }
    158159
     
    209210
    210211    if(i<size_of_support_vectors)
     212    {
    211213      // variable i is considered in the support vectors
    212214      if(actual_entry>0)
    213215        head_support|=(1<<i);
    214216        // bit i of head_support is set to 1 (counting from 0)
    215       else
    216         if(actual_entry<0)
    217           tail_support|=(1<<i);
    218     // bit i of tail_support is set to 1
     217      else if(actual_entry<0)
     218        tail_support|=(1<<i);
     219        // bit i of tail_support is set to 1
     220    }
    219221  }
    220222
     
    881883
    882884    if(i<size_of_support_vectors)
     885    {
    883886      if(actual_entry>0)
    884887        head_support|=(1<<i);
    885       else
    886         if(actual_entry<0)
    887           tail_support|=(1<<i);
     888      else if(actual_entry<0)
     889        tail_support|=(1<<i);
     890    }
    888891  }
    889892
     
    932935
    933936    if(i<size_of_support_vectors)
     937    {
    934938      if(actual_entry>0)
    935939        head_support|=(1<<i);
    936       else
    937         if(actual_entry<0)
    938           tail_support|=(1<<i);
     940      else if(actual_entry<0)
     941        tail_support|=(1<<i);
     942    }
    939943  }
    940944
     
    950954
    951955    if(i<size_of_support_vectors)
     956    {
    952957      if(actual_entry>0)
    953958        head_support|=(1<<i);
    954       else
    955         if(actual_entry<0)
    956           tail_support|=(1<<i);
     959      else if(actual_entry<0)
     960        tail_support|=(1<<i);
     961    }
    957962  }
    958963
     
    10271032
    10281033    if(i<size_of_support_vectors)
     1034    {
    10291035      if(actual_entry>0)
    10301036        result.head_support|=(1<<i);
    1031       else
    1032         if(actual_entry<0)
    1033           result.tail_support|=(1<<i);
     1037      else if(actual_entry<0)
     1038        result.tail_support|=(1<<i);
     1039    }
    10341040  }
    10351041
     
    10481054
    10491055    if(i<size_of_support_vectors)
     1056    {
    10501057      if(actual_entry>0)
    10511058        result.head_support|=(1<<i);
    1052       else
    1053         if(actual_entry<0)
     1059      else if(actual_entry<0)
    10541060          result.tail_support|=(1<<i);
     1061    }
    10551062  }
    10561063
     
    14111418    if(actual_entry>0)
    14121419      head_support|=(1<<i);
    1413     else
    1414       if(actual_entry[i]<0)
    1415         tail_support|=(1<<i);
     1420    else if(actual_entry[i]<0)
     1421      tail_support|=(1<<i);
    14161422  }
    14171423
     
    14261432    if(actual_entry>0)
    14271433      head_support|=(1<<i);
    1428     else
    1429       if(actual_entry<0)
    1430         tail_support|=(1<<i);
     1434    else if(actual_entry<0)
     1435      tail_support|=(1<<i);
    14311436  }
    14321437
     
    14981503    if(actual_entry>0)
    14991504      head_support|=(1<<i);
    1500     else
    1501       if(actual_entry<0)
    1502         tail_support|=(1<<i);
     1505    else if(actual_entry<0)
     1506      tail_support|=(1<<i);
    15031507  }
    15041508
     
    15131517    if(actual_entry>0)
    15141518      head_support|=(1<<i);
    1515     else
    1516       if(actual_entry<0)
    1517         tail_support|=(1<<i);
     1519    else if(actual_entry<0)
     1520      tail_support|=(1<<i);
    15181521  }
    15191522
  • IntegerProgramming/matrix.cc

    r994c3d rf07fec  
    351351  for(int i=0;i<_kernel_dimension;i++)
    352352    if(M[i]>BigInt(0))
     353    {
    353354      if(min_index==-1)
    354355        min_index=i;
    355       else
    356         if(M[i]<M[min_index])
    357           min_index=i;
     356      else if(M[i]<M[min_index])
     357        min_index=i;
     358    }
    358359
    359360  // Now, H[min_index] is the vector to be transformed into a nonnegative one.
     
    445446    for(int i=current_position;i<_kernel_dimension;i++)
    446447      if(M[i]>BigInt(0))
     448      {
    447449        if(min_index==0)
    448450          min_index=i;
    449         else
    450           if(M[i]<M[min_index])
    451             min_index=i;
     451        else if(M[i]<M[min_index])
     452          min_index=i;
     453      }
    452454
    453455    // Now, a multiple of H[min_index] will be added to the already constructed
     
    639641      for(int j=0;j<columns;j++)
    640642        if(ideal_saturated_by_var[j]==FALSE)
     643        {
    641644          if(H[k][j]> BigInt(0))
    642645            // ideal has to be saturated by the variables corresponding
     
    647650            number_of_sat_var++;
    648651          }
    649           else
    650             if(H[k][j]< BigInt(0))
     652          else if(H[k][j]< BigInt(0))
    651653              // then the ideal is automatically saturated by the variables
    652654              // corresponding to negative components
    653655              ideal_saturated_by_var[j]=TRUE;
     656        }
    654657    }
    655658    else
     
    657660      for(int j=0;j<columns;j++)
    658661        if(ideal_saturated_by_var[j]==FALSE)
     662        {
    659663          if(H[k][j]< BigInt(0))
    660664            // ideal has to be saturated by the variables corresponding
     
    665669            number_of_sat_var++;
    666670          }
    667           else
    668             if(H[k][j]> BigInt(0))
     671          else if(H[k][j]> BigInt(0))
    669672              // then the ideal is automatically saturated by the variables
    670673              // corresponding to positive components
    671674              ideal_saturated_by_var[j]=TRUE;
     675        }
    672676    }
    673677  }
Note: See TracChangeset for help on using the changeset viewer.