Changeset 2994
- Timestamp:
- 07/02/08 08:10:55 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/linbox/linbox/algorithms/rational-reconstruction-base.h
r2980 r2994 2 2 3 3 #include <iostream> 4 #include < queue>4 #include <deque> 5 5 6 6 #ifndef __LINBOXX__RECONSTRUCTION_BASE_H__ … … 108 108 class RationalReconstructionBase 109 109 { 110 protected: 111 Ring _Z; 112 OpCounter C; 110 113 public: 111 Ring _Z;114 //Ring _Z; 112 115 typedef typename Ring::Element Element; 113 116 114 OpCounter C;117 //OpCounter C; 115 118 116 119 RationalReconstructionBase(const Ring& Z): _Z(Z) {} … … 134 137 bool _reduce; 135 138 bool _recursive; 139 Ring _Z; 140 OpCounter C; 136 141 public: 137 142 Ring _Z; … … 388 393 ++_size; 389 394 } else { 390 if (! empty()) {391 top = front();392 pop_front();395 if (!this->empty()) { 396 top = this->front(); 397 this->pop_front(); 393 398 push_back(bottom); 394 399 … … 401 406 402 407 QMatrix& clearmax(QMatrix& max1) { 403 while (! empty()) {404 QMatrix max2( front());408 while (!this->empty()) { 409 QMatrix max2(this->front()); 405 410 if (max2.q > max1.q) return max1=max2; 406 pop_front();411 this->pop_front(); 407 412 } 408 413 } … … 414 419 protected: 415 420 size_t _threshold; 421 Ring _Z; 422 OpCounter C; 416 423 417 424 typedef typename Ring::Element Element; 418 425 public: 419 426 420 MaxQFastRationalReconstruction(const Ring& Z): RationalReconstructionBase<Ring>(Z) {427 MaxQFastRationalReconstruction(const Ring& Z): RationalReconstructionBase<Ring>(Z), _Z(Z) { 421 428 _threshold = __FASTRR_DEFAULT_THRESHOLD; 422 429 if (_threshold <5) _threshold=5; … … 677 684 } 678 685 679 size_t log_n = n.bitsize()-1;686 //size_t log_n = n.bitsize()-1; 680 687 681 688 // cout << d << " " << log_n << " " << h << "\n"<< flush; … … 1034 1041 class MaxQClassicRationalReconstruction: public RationalReconstructionBase<Ring> 1035 1042 { 1043 protected: 1044 Ring _Z; 1045 OpCounter C; 1036 1046 typedef typename Ring::Element Element; 1037 1047 public: … … 1122 1132 typedef typename Ring::Element Element; 1123 1133 protected: 1134 Ring _Z; 1135 OpCounter C; 1124 1136 size_t _threshold; 1125 1137 … … 1759 1771 class WangClassicRationalReconstruction: public RationalReconstructionBase<Ring> 1760 1772 { 1773 Ring _Z; 1774 OpCounter C; 1761 1775 bool _reduce; 1762 1776 bool _recursive; … … 1783 1797 1784 1798 bool reconstructRational(Element& a, Element& b, const Element& x, const Element& m, const Element& a_bound) { 1785 bool res ;1799 bool res = false; 1786 1800 1787 1801 if (x == 0) {
