- Timestamp:
- Nov 27, 2017, 2:29:04 PM (6 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b9f50b373314e74e83c7c060a651dd2913e1f033')
- Children:
- 55547cd0fba1913878deb04d393e354ac9d7fc2f
- Parents:
- ecce2d81ff6101080904784705fc360910896b1b
- Location:
- factory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cfNewtonPolygon.cc
recce2d8 r36fd8e 604 604 else if (sizePoints == 1) 605 605 { 606 mpz_set_ ui (M[0], 1);607 mpz_set_ ui (M[3], 1);606 mpz_set_si (M[0], 1); 607 mpz_set_si (M[3], 1); 608 608 } 609 609 return; 610 610 } 611 mpz_set_ ui (M[0], 1);612 mpz_set_ ui (M[3], 1);611 mpz_set_si (M[0], 1); 612 mpz_set_si (M[3], 1); 613 613 614 614 mpz_t * Mu= new mpz_t[4]; 615 mpz_init_set_ ui (Mu[1], 1);616 mpz_init_set_ ui (Mu[2], 1);615 mpz_init_set_si (Mu[1], 1); 616 mpz_init_set_si (Mu[2], 1); 617 617 mpz_init (Mu[0]); 618 618 mpz_init (Mu[3]); 619 619 620 620 mpz_t * Lambda= new mpz_t[4]; 621 mpz_init_set_ ui (Lambda[0], 1);621 mpz_init_set_si (Lambda[0], 1); 622 622 mpz_init_set_si (Lambda[1], -1); 623 623 mpz_init_set_si (Lambda[3], 1); … … 625 625 626 626 mpz_t * InverseLambda= new mpz_t[4]; 627 mpz_init_set_ ui (InverseLambda[0], 1);628 mpz_init_set_ ui (InverseLambda[1], 1);629 mpz_init_set_ ui (InverseLambda[3], 1);627 mpz_init_set_si (InverseLambda[0], 1); 628 mpz_init_set_si (InverseLambda[1], 1); 629 mpz_init_set_si (InverseLambda[3], 1); 630 630 mpz_init (InverseLambda[2]); 631 631 -
factory/int_rat.cc
recce2d8 r36fd8e 32 32 33 33 34 InternalRational::InternalRational() 35 { 36 mpz_init( _num ); 37 mpz_init_set_si( _den, 1 ); 38 } 39 40 InternalRational::InternalRational( const int i ) 41 { 42 mpz_init_set_si( _num, i ); 43 mpz_init_set_si( _den, 1 ); 44 } 45 34 46 InternalRational::InternalRational( const int n, const int d ) 35 47 { … … 37 49 if ( n == 0 ) 38 50 { 39 mpz_init_set_ ui( _num, 0 );40 mpz_init_set_ ui( _den, 1 );51 mpz_init_set_si( _num, 0 ); 52 mpz_init_set_si( _den, 1 ); 41 53 } 42 54 else … … 56 68 } 57 69 70 InternalRational::InternalRational( const long i ) 71 { 72 mpz_init_set_si( _num, i ); 73 mpz_init_set_si( _den, 1 ); 74 } 75 58 76 InternalRational::InternalRational( const long n, const long d ) 59 77 { … … 61 79 if ( n == 0 ) 62 80 { 63 mpz_init_set_ ui( _num, 0 );64 mpz_init_set_ ui( _den, 1 );81 mpz_init_set_si( _num, 0 ); 82 mpz_init_set_si( _den, 1 ); 65 83 } 66 84 else … … 92 110 // mpz_init_set_si( _den, 1 ); 93 111 //} 112 113 InternalRational::InternalRational( const mpz_ptr n ) 114 { 115 _num[0]=*n; 116 mpz_init_set_si( _den, 1 ); 117 } 118 119 InternalRational::InternalRational( const mpz_ptr n, const mpz_ptr d ) 120 { 121 _num[0]=*n; 122 _den[0]=*d; 123 } 124 125 InternalRational::~InternalRational() 126 { 127 mpz_clear( _num ); 128 mpz_clear( _den ); 129 } 94 130 95 131 InternalCF* InternalRational::deepCopyObject() const … … 115 151 } 116 152 #endif /* NOSTREAMIO */ 153 154 bool InternalRational::is_imm() const 155 { 156 return mpz_cmp_si( _den, 1 ) == 0 && mpz_is_imm( _num ); 157 } 117 158 118 159 InternalCF* InternalRational::genZero() … … 527 568 return this; 528 569 else 529 570 { 530 571 mpz_init( n ); 531 572 if ( cc < 0 ) 532 573 { 533 574 mpz_mul_ui( n, _den, -cc ); … … 539 580 mpz_add( n, _num, n ); 540 581 } 541 582 } 542 583 } 543 584 else … … 862 903 } 863 904 864 bool InternalRational::is_imm() const 865 { return mpz_cmp_si( _den, 1 ) == 0 && mpz_is_imm( _num ); } 866 905 /** 906 * @sa CanonicalForm::sign() 907 **/ 908 int 909 InternalRational::sign () const 910 { 911 return mpz_sgn( _num ); 912 } -
factory/int_rat.h
recce2d8 r36fd8e 46 46 static void normalize( const mpz_ptr, const mpz_ptr, mpz_ptr, mpz_ptr ); 47 47 public: 48 InternalRational() 49 { 50 mpz_init( _num ); 51 mpz_init_set_ui( _den, 1 ); 52 } 48 InternalRational(); 53 49 InternalRational( const InternalCF& ) 54 50 { 55 51 ASSERT( 0, "ups there is something wrong in your code" ); 56 52 } 57 InternalRational( const int i ) 58 { 59 mpz_init_set_si( _num, i ); 60 mpz_init_set_ui( _den, 1 ); 61 } 53 InternalRational( const int i ); 62 54 InternalRational( const int n, const int d ); 63 InternalRational( const long i ) 64 { 65 mpz_init_set_si( _num, i ); 66 mpz_init_set_ui( _den, 1 ); 67 } 55 InternalRational( const long i ); 68 56 InternalRational( const long n, const long d ); 69 57 InternalRational( const char * str ); 70 InternalRational( const mpz_ptr n) 71 { 72 _num[0]=*n; 73 mpz_init_set_ui( _den, 1 ); 74 } 75 InternalRational( const mpz_ptr n, const mpz_ptr d) 76 { 77 _num[0]=*n; 78 _den[0]=*d; 79 } 80 ~InternalRational() 81 { 82 mpz_clear( _num ); 83 mpz_clear( _den ); 84 } 58 InternalRational( const mpz_ptr ); 59 InternalRational( const mpz_ptr , const mpz_ptr ); 60 ~InternalRational(); 85 61 InternalCF* deepCopyObject() const; 86 62 const char * classname() const { return "InternalRational"; } … … 131 107 long intval() const; 132 108 133 int sign() const { return mpz_sgn( _num ); }109 int sign() const; 134 110 135 111 InternalCF * normalize_myself();
Note: See TracChangeset
for help on using the changeset viewer.