Ignore:
Timestamp:
Sep 12, 2012, 6:31:08 PM (11 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
6bfd784a2ae971e2eddfc0b8e22c9b276d9aa341
Parents:
1cf13b33d55ec9d3d521a0c38c579e836bd8400d
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-09-12 18:31:08+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:47+02:00
Message:
Starting tail terms preprocessing:

TODO: need a vector of "term + arrow_cache" structures
TODO: need a better CReducerFinder for arrow_cache...!!!

add: DivisibilityCheck + Separation of minor preparations for tail terms preprocessing!

NOTE: not yet :(((
File:
1 edited

Legend:

Unmodified
Added
Removed
  • dyn_modules/syzextra/syzextra.h

    r1cf13b r1a4c343  
    112112
    113113
     114class CLeadingTerm
     115{
     116  public:
     117    CLeadingTerm(unsigned int label,  const poly lt, const ring);
     118
     119  public:
     120
     121    const unsigned long m_sev; ///< not short exp. vector
     122        // NOTE/TODO: either of the following should be enough:
     123    const unsigned int  m_label; ///< index in the main L[] + 1
     124    const poly          m_lt; ///< the leading term itself L[label-1]
     125
     126  public:
     127    bool DivisibilityCheck(const poly product, const unsigned long not_sev, const ring r) const;
     128    bool DivisibilityCheck(const poly multiplier, const poly t, const unsigned long not_sev, const ring r) const;
     129
     130  private:
     131    // disable the following:
     132    CLeadingTerm();
     133    CLeadingTerm(const CLeadingTerm&);
     134    void operator=(const CLeadingTerm&);
     135};
     136
     137
     138// TODO: needs a specialized variant without a component (hash!)
    114139class CReducerFinder: public SchreyerSyzygyComputationFlags
    115140{
    116141  private:
    117     class CLeadingTerm
    118     {
    119       public:
    120         CLeadingTerm(unsigned int id,  const poly p, const ring);
    121 
    122       private:
    123         CLeadingTerm();
    124 
    125       public:
    126 
    127         const unsigned long m_sev; ///< not short exp. vector
    128         // NOTE/TODO: either of the following should be enough:
    129         const unsigned int  m_label; ///< index in the main L[] + 1
    130         const poly          m_lt; ///< the leading term itself L[label-1]
    131     };
    132 
    133142    typedef long TComponentKey;
    134143    typedef std::vector<const CLeadingTerm*> TReducers;
    135144    typedef std::map< TComponentKey, TReducers> CReducersHash;
     145
     146/*
     147    /// TODO:
     148    class const_iterator: public TReducers::const_iterator
     149    {
     150      typedef TReducers::const_iterator TBase;
     151      private:
     152//        const TReducers& m_reds;
     153        const TBase m_the_end;
     154
     155        const_iterator(TBase start, TBase end):
     156            TBase(start), m_the_end(end)
     157        { find_proper(); }
     158                   
     159      public:       
     160        inline bool at_end() const { return m_the_end == (*this); }
     161
     162        inline const_iterator& operator++()
     163        {
     164          find_next();
     165          return *this;
     166        }
     167       
     168        inline const_iterator operator++(int)
     169        {
     170          const_iterator tmp(*this);
     171          find_next();
     172          return tmp;
     173        }
     174
     175      protected:
     176        bool is_proper() const; // difficult - needs all of CReducerFinder internals!?
     177       
     178        inline void find_next()
     179        {
     180          while (!at_end())
     181          {
     182            static_cast<TBase*>(this)->operator++();
     183            if( is_proper() ) break;
     184          }
     185        }
     186    };
     187*/
    136188   
    137189  public:
     
    143195    ~CReducerFinder();
    144196
    145     // TODO: save shortcut (syz: |-.->) LM(LM(m) * "t") -> syz?   
    146     poly FindReducer(const poly product, const poly syzterm, const CReducerFinder& checker) const;
     197    // TODO: save shortcut (syz: |-.->) LM(LM(m) * "t") -> syz?
     198    poly // const_iterator // TODO: return const_iterator it, s.th: it->m_lt is the needed
     199    FindReducer(const poly product, const poly syzterm, const CReducerFinder& checker) const;
    147200
    148201    bool IsDivisible(const poly q) const;
     
    160213
    161214    CReducersHash m_hash; // can also be replaced with a vector indexed by components
     215
     216  private:
     217    CReducerFinder(const CReducerFinder&);
     218    void operator=(const CReducerFinder&);
    162219};
    163220
     
    180237 
    181238  public:
    182 
    183239    /// Construct a global object for given input data (separated into leads & tails)
    184240    SchreyerSyzygyComputation(const ideal idLeads, const ideal idTails, const SchreyerSyzygyComputationFlags setting):
     
    188244        m_lcm(m_idLeads, setting), m_div(m_idLeads, setting), m_checker(NULL, setting)
    189245    {
     246      if( __TAILREDSYZ__ && !__IGNORETAILS__)
     247      {
     248        if( idTails != NULL )
     249          SetUpTailTerms(idTails);
     250      }
    190251    }
    191252
     
    197258        m_lcm(m_idLeads, setting), m_div(m_idLeads, setting), m_checker(NULL, setting)
    198259    {
    199       if( __TAILREDSYZ__ && !__IGNORETAILS__ && syzLeads != NULL )
    200         m_checker.Initialize(syzLeads);
     260      if( __TAILREDSYZ__ && !__IGNORETAILS__)
     261      {
     262        if (syzLeads != NULL)
     263          m_checker.Initialize(syzLeads);
     264        if( idTails != NULL )
     265          SetUpTailTerms(idTails);
     266      }
    201267    }
    202268
    203    
    204269    /// Destructor should not destruct the resulting m_syzLeads, m_syzTails.
    205270    ~SchreyerSyzygyComputation(){ CleanUp(); }
     271
     272    /// Convert the given ideal of tails into the internal representation (with reducers!)
     273    void SetUpTailTerms(const ideal idTails);
     274   
     275    void CleanUp();
    206276
    207277    /// Read off the results while detaching them from this object
     
    233303    //
    234304    poly TraverseNF(const poly syz_lead, const poly syz_2 = NULL) const;
     305
    235306   
    236307  public:
     
    247318    ideal Compute2LeadingSyzygyTerms();
    248319
    249     /// Clean up all the accumulated data
    250     void CleanUp() {}
    251 
    252320  private:
    253321    /// input leading terms
     
    273341
    274342    /*mutable?*/ ideal m_LS; ///< leading syzygy terms used for reducing syzygy tails
     343
     344    /*
     345    // need more data here:
     346    // (m_idLeads : m_tailterm) = (m, pos, compl), s.th: compl * m_tailterm divides m_idLeads[pos]
     347    // but resulting sysygy compl * gen(pos) should not be in
     348    // Idea: extend CReducerFinder??!!
     349    struct CTailTerm
     350    {
     351      const poly m_tailterm;
     352     
     353      const CReducerFinder m_reducers; // positions are labels (in m_idLeads)...
     354      // compl - to be computed if needed?
     355
     356      CTailTerm(const poly tt, const CReducerFinder reds): m_tailterm(tt), m_reducers(reds) {}
     357    };
     358
     359    typedef std::vector<const CTailTerm*> TTail;
     360    typedef std::vector<TTail> TTailTerms;
     361   
     362    TTailTerms m_idTailTerms;
     363    */
    275364};
    276365
Note: See TracChangeset for help on using the changeset viewer.