Changeset 2994

Show
Ignore:
Timestamp:
07/02/08 08:10:55 (5 months ago)
Author:
aniau
Message:

=

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/linbox/linbox/algorithms/rational-reconstruction-base.h

    r2980 r2994  
    22 
    33#include <iostream> 
    4 #include <queue> 
     4#include <deque> 
    55 
    66#ifndef __LINBOXX__RECONSTRUCTION_BASE_H__ 
     
    108108class RationalReconstructionBase 
    109109{ 
     110protected: 
     111        Ring _Z; 
     112        OpCounter C; 
    110113public: 
    111         Ring _Z; 
     114        //Ring _Z; 
    112115        typedef typename Ring::Element Element; 
    113116         
    114         OpCounter C; 
     117        //OpCounter C; 
    115118 
    116119        RationalReconstructionBase(const Ring& Z): _Z(Z) {} 
     
    134137        bool _reduce; 
    135138        bool _recursive; 
     139        Ring _Z; 
     140        OpCounter C; 
    136141public: 
    137142        Ring _Z; 
     
    388393                        ++_size; 
    389394                } else { 
    390                         if (!empty()) { 
    391                                 top = front(); 
    392                                 pop_front(); 
     395                        if (!this->empty()) { 
     396                                top = this->front(); 
     397                                this->pop_front(); 
    393398                                push_back(bottom); 
    394399                                 
     
    401406         
    402407        QMatrix& clearmax(QMatrix& max1) { 
    403                 while (!empty()) { 
    404                         QMatrix max2(front()); 
     408                while (!this->empty()) { 
     409                        QMatrix max2(this->front()); 
    405410                        if (max2.q > max1.q) return max1=max2; 
    406                         pop_front(); 
     411                        this->pop_front(); 
    407412                } 
    408413        } 
     
    414419protected: 
    415420        size_t _threshold; 
     421        Ring _Z; 
     422        OpCounter C;     
    416423 
    417424typedef typename Ring::Element Element; 
    418425public: 
    419426 
    420         MaxQFastRationalReconstruction(const Ring& Z): RationalReconstructionBase<Ring>(Z) {             
     427        MaxQFastRationalReconstruction(const Ring& Z): RationalReconstructionBase<Ring>(Z), _Z(Z) {              
    421428                _threshold = __FASTRR_DEFAULT_THRESHOLD; 
    422429                if (_threshold <5) _threshold=5;  
     
    677684                } 
    678685 
    679                 size_t log_n = n.bitsize()-1; 
     686                //size_t log_n = n.bitsize()-1; 
    680687 
    681688                //              cout << d << " " << log_n << " "  << h << "\n"<< flush; 
     
    10341041class MaxQClassicRationalReconstruction: public RationalReconstructionBase<Ring> 
    10351042{ 
     1043protected: 
     1044        Ring _Z; 
     1045        OpCounter C; 
    10361046typedef typename Ring::Element Element; 
    10371047public: 
     
    11221132typedef typename Ring::Element Element; 
    11231133protected: 
     1134        Ring _Z; 
     1135        OpCounter C; 
    11241136        size_t _threshold; 
    11251137 
     
    17591771class WangClassicRationalReconstruction: public RationalReconstructionBase<Ring> 
    17601772{ 
     1773        Ring _Z; 
     1774        OpCounter C; 
    17611775        bool _reduce; 
    17621776        bool _recursive; 
     
    17831797 
    17841798        bool reconstructRational(Element& a, Element& b, const Element& x, const Element& m, const Element& a_bound) {   
    1785                 bool res; 
     1799                bool res = false; 
    17861800 
    17871801                if (x == 0) {