Changeset d96b79 in git for IntegerProgramming/matrix.cc
- Timestamp:
- Apr 14, 2003, 10:16:22 AM (21 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 42c03ae4b5550eede82d007996fbc1809c919081
- Parents:
- a7c8b18aaee6ef15b1855f3bbd8d65f0c06f27b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
IntegerProgramming/matrix.cc
ra7c8b18 rd96b79 320 320 M[i]=0; 321 321 for(short j=0;j<columns;j++) 322 if(H[i][j]== 0)322 if(H[i][j]==(const BigInt&)0) 323 323 M[i]++; 324 324 } … … 348 348 short min_index=-1; 349 349 for(short i=0;i<_kernel_dimension;i++) 350 if(M[i]> 0)350 if(M[i]>(const BigInt&)0) 351 351 if(min_index==-1) 352 352 min_index=i; … … 385 385 BOOLEAN found=TRUE; 386 386 for(short j=0;j<columns;j++) 387 if(H[0][j]== 0)387 if(H[0][j]==(const BigInt&)0) 388 388 found=FALSE; 389 389 … … 405 405 406 406 for(short j=0;j<columns;j++) 407 if(H[0][j]== 0)407 if(H[0][j]==(const BigInt&)0) 408 408 { 409 409 remaining_zero_components++; 410 410 for(short i=current_position;i<_kernel_dimension;i++) 411 if(H[i][j]== 0)411 if(H[i][j]==(const BigInt&)0) 412 412 M[i]++; 413 413 } … … 421 421 min=M[i]; 422 422 423 if(min== remaining_zero_components)423 if(min==(const BigInt&)remaining_zero_components) 424 424 // all zero components in H[0] are zero in each remaining vector 425 425 // => desired vector does not exist … … 442 442 short min_index=0; 443 443 for(short i=current_position;i<_kernel_dimension;i++) 444 if(M[i]> 0)444 if(M[i]>(const BigInt&)0) 445 445 if(min_index==0) 446 446 min_index=i; … … 477 477 // mult*H[current_position] 478 478 for(short j=0;j<columns;j++) 479 if(H[0][j]!=0) 480 if(H[0][j]+mult*H[current_position][j]==0) 479 if(H[0][j]!=(const BigInt&)0) 480 if(H[0][j]+(const BigInt&)mult*H[current_position][j] 481 ==(const BigInt&)0) 481 482 found=FALSE; 482 483 483 484 if(found==TRUE) 484 485 for(short j=0;j<columns;j++) 485 H[0][j]+=mult*H[current_position][j]; 486 486 H[0][j]+=(const BigInt&)mult*H[current_position][j]; 487 487 else 488 488 // try -mult … … 494 494 // mult*H[current_position] 495 495 for(short j=0;j<columns;j++) 496 if(H[0][j]!=0) 497 if(H[0][j]-mult*H[current_position][j]==0) 496 if(H[0][j]!=(const BigInt&)0) 497 if(H[0][j]-(const BigInt&)mult*H[current_position][j] 498 ==(const BigInt&)0) 498 499 found=FALSE; 499 500 500 501 if(found==TRUE) 501 502 for(short j=0;j<columns;j++) 502 H[0][j]-= mult*H[current_position][j];503 H[0][j]-=(const BigInt&)mult*H[current_position][j]; 503 504 } 504 505 505 } 506 507 } 508 506 } 509 507 510 508 // When reaching this line, an error must have occurred. 511 509 cerr<<"FATAL ERROR in short matrix::compute_nonnegative_vector()"<<endl; 512 510 abort(); 513 514 } 515 516 517 511 } 518 512 519 513 short matrix::compute_flip_variables(short*& F) … … 538 532 539 533 for(short j=0;j<columns;j++) 540 if(H[0][j]< 0)534 if(H[0][j]<(const BigInt&)0) 541 535 r++; 542 536 // remember that all components of H[0] are !=0 … … 555 549 short counter=0; 556 550 for(short j=0;j<columns;j++) 557 if(H[0][j]> 0)551 if(H[0][j]>(const BigInt&)0) 558 552 { 559 553 F[counter]=j; … … 569 563 short counter=0; 570 564 for(short j=0;j<columns;j++) 571 if(H[0][j]< 0)565 if(H[0][j]<(const BigInt&)0) 572 566 { 573 567 F[counter]=j; … … 629 623 if(ideal_saturated_by_var[j]==FALSE) 630 624 { 631 if(H[k][j]> 0)625 if(H[k][j]>(const BigInt&)0) 632 626 pos_sat_var++; 633 627 else 634 if(H[k][j]< 0)628 if(H[k][j]<(const BigInt&)0) 635 629 neg_sat_var++; 636 630 } … … 643 637 for(short j=0;j<columns;j++) 644 638 if(ideal_saturated_by_var[j]==FALSE) 645 if(H[k][j]> 0)639 if(H[k][j]>(const BigInt&)0) 646 640 // ideal has to be saturated by the variables corresponding 647 641 // to positive components … … 652 646 } 653 647 else 654 if(H[k][j]< 0)648 if(H[k][j]<(const BigInt&)0) 655 649 // then the ideal is automatically saturated by the variables 656 650 // corresponding to negative components … … 661 655 for(short j=0;j<columns;j++) 662 656 if(ideal_saturated_by_var[j]==FALSE) 663 if(H[k][j]< 0)657 if(H[k][j]<(const BigInt&)0) 664 658 // ideal has to be saturated by the variables corresponding 665 659 // to negative components … … 670 664 } 671 665 else 672 if(H[k][j]> 0)666 if(H[k][j]>(const BigInt&)0) 673 667 // then the ideal is automatically saturated by the variables 674 668 // corresponding to positive components
Note: See TracChangeset
for help on using the changeset viewer.