Changeset f07fec in git
- Timestamp:
- Feb 4, 2014, 12:54:15 AM (9 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 9bc6bcbce12e05ef128c69bb444e6d03f1fd2ff0
- Parents:
- 994c3dc99d02ae0db55a193692a2e41b6a562bcd
- Location:
- IntegerProgramming
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
IntegerProgramming/binomial.cc
r994c3d rf07fec 147 147 148 148 if(i<size_of_support_vectors) 149 { 149 150 // variable i is considered in the support vectors 150 151 if(actual_entry>0) 151 152 head_support|=(1<<i); 152 153 // 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 1154 else if(actual_entry<0) 155 tail_support|=(1<<i); 156 // bit i of tail_support is set to 1 157 } 157 158 } 158 159 … … 209 210 210 211 if(i<size_of_support_vectors) 212 { 211 213 // variable i is considered in the support vectors 212 214 if(actual_entry>0) 213 215 head_support|=(1<<i); 214 216 // 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 1217 else if(actual_entry<0) 218 tail_support|=(1<<i); 219 // bit i of tail_support is set to 1 220 } 219 221 } 220 222 … … 881 883 882 884 if(i<size_of_support_vectors) 885 { 883 886 if(actual_entry>0) 884 887 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 } 888 891 } 889 892 … … 932 935 933 936 if(i<size_of_support_vectors) 937 { 934 938 if(actual_entry>0) 935 939 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 } 939 943 } 940 944 … … 950 954 951 955 if(i<size_of_support_vectors) 956 { 952 957 if(actual_entry>0) 953 958 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 } 957 962 } 958 963 … … 1027 1032 1028 1033 if(i<size_of_support_vectors) 1034 { 1029 1035 if(actual_entry>0) 1030 1036 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 } 1034 1040 } 1035 1041 … … 1048 1054 1049 1055 if(i<size_of_support_vectors) 1056 { 1050 1057 if(actual_entry>0) 1051 1058 result.head_support|=(1<<i); 1052 else 1053 if(actual_entry<0) 1059 else if(actual_entry<0) 1054 1060 result.tail_support|=(1<<i); 1061 } 1055 1062 } 1056 1063 … … 1411 1418 if(actual_entry>0) 1412 1419 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); 1416 1422 } 1417 1423 … … 1426 1432 if(actual_entry>0) 1427 1433 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); 1431 1436 } 1432 1437 … … 1498 1503 if(actual_entry>0) 1499 1504 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); 1503 1507 } 1504 1508 … … 1513 1517 if(actual_entry>0) 1514 1518 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); 1518 1521 } 1519 1522 -
IntegerProgramming/matrix.cc
r994c3d rf07fec 351 351 for(int i=0;i<_kernel_dimension;i++) 352 352 if(M[i]>BigInt(0)) 353 { 353 354 if(min_index==-1) 354 355 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 } 358 359 359 360 // Now, H[min_index] is the vector to be transformed into a nonnegative one. … … 445 446 for(int i=current_position;i<_kernel_dimension;i++) 446 447 if(M[i]>BigInt(0)) 448 { 447 449 if(min_index==0) 448 450 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 } 452 454 453 455 // Now, a multiple of H[min_index] will be added to the already constructed … … 639 641 for(int j=0;j<columns;j++) 640 642 if(ideal_saturated_by_var[j]==FALSE) 643 { 641 644 if(H[k][j]> BigInt(0)) 642 645 // ideal has to be saturated by the variables corresponding … … 647 650 number_of_sat_var++; 648 651 } 649 else 650 if(H[k][j]< BigInt(0)) 652 else if(H[k][j]< BigInt(0)) 651 653 // then the ideal is automatically saturated by the variables 652 654 // corresponding to negative components 653 655 ideal_saturated_by_var[j]=TRUE; 656 } 654 657 } 655 658 else … … 657 660 for(int j=0;j<columns;j++) 658 661 if(ideal_saturated_by_var[j]==FALSE) 662 { 659 663 if(H[k][j]< BigInt(0)) 660 664 // ideal has to be saturated by the variables corresponding … … 665 669 number_of_sat_var++; 666 670 } 667 else 668 if(H[k][j]> BigInt(0)) 671 else if(H[k][j]> BigInt(0)) 669 672 // then the ideal is automatically saturated by the variables 670 673 // corresponding to positive components 671 674 ideal_saturated_by_var[j]=TRUE; 675 } 672 676 } 673 677 }
Note: See TracChangeset
for help on using the changeset viewer.