Ignore:
Timestamp:
Apr 28, 2014, 8:49:00 PM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
Children:
c7d29b194535c9015230fc587b2ae178c075ef3e
Parents:
92992c08c2f387188f53d5f874a342fb60dccc06
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-04-28 20:49:00+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-05-07 04:41:46+02:00
Message:
introduced SchreyerSyzygyComputationFlags for storing and passing ring attributes within SchreyerSyzygyComputatio

chg: renamed internal functions to avoid name conflicts
chg: better namespace handling
File:
1 edited

Legend:

Unmodified
Added
Removed
  • dyn_modules/syzextra/syzextra.h

    r92992c r4eba3ad  
    3030typedef struct sip_sideal *       ideal;
    3131
     32class idrec;
     33typedef idrec *   idhdl;
    3234
    3335BEGIN_NAMESPACE_SINGULARXX    BEGIN_NAMESPACE(SYZEXTRA)
     
    5153
    5254
     55
     56
     57
     58/// Computation attribute storage
     59struct SchreyerSyzygyComputationFlags
     60{
     61  SchreyerSyzygyComputationFlags(idhdl rootRingHdl);
     62 
     63  /// output all the intermediate states
     64  const bool __DEBUG__; // DebugOutput;
     65
     66  /// ?
     67  const bool __SYZCHECK__; // CheckSyzygyProperty;
     68
     69  /// ?
     70  const bool __LEAD2SYZ__; // TwoLeadingSyzygyTerms;
     71
     72  /// Reduce syzygy tails wrt the leading syzygy terms
     73  const bool __TAILREDSYZ__; // TailReducedSyzygies;
     74
     75  /// Use the usual NF's S-poly reduction while dropping lower order terms
     76  const bool __HYBRIDNF__; // UseHybridNF
     77
     78};
     79
     80
     81
    5382/** @class SchreyerSyzygyComputation syzextra.h
    5483 *
     
    6594  public:
    6695    /// Construct a global object for given input data (separated into leads & tails)
    67     SchreyerSyzygyComputation(const ideal idLeads, const ideal idTails, const ring rBaseRing):
    68         m_idLeads(idLeads), m_idTails(idTails), m_rBaseRing(rBaseRing),
    69         m_syzLeads(NULL), m_syzTails(NULL), m_LS(NULL) {}
     96    SchreyerSyzygyComputation(const ideal idLeads, const ideal idTails, const ring rBaseRing, const SchreyerSyzygyComputationFlags attribues):
     97        m_rBaseRing(rBaseRing),
     98        m_idLeads(idLeads), m_idTails(idTails),
     99        m_syzLeads(NULL), m_syzTails(NULL), m_LS(NULL), m_atttributes(attribues) {}
    70100
    71101
    72102    /// Construct a global object for given input data (separated into leads & tails)
    73     SchreyerSyzygyComputation(const ideal idLeads, const ideal idTails, const ideal syzLeads, const ring rBaseRing):
    74         m_idLeads(idLeads), m_idTails(idTails), m_rBaseRing(rBaseRing),
    75         m_syzLeads(NULL), m_syzTails(NULL), m_LS(syzLeads) {}
     103    SchreyerSyzygyComputation(const ideal idLeads, const ideal idTails, const ideal syzLeads, const ring rBaseRing, const SchreyerSyzygyComputationFlags attribues):
     104        m_rBaseRing(rBaseRing),
     105        m_idLeads(idLeads), m_idTails(idTails),
     106        m_syzLeads(NULL), m_syzTails(NULL), m_LS(syzLeads), m_atttributes(attribues) {}
    76107
    77108   
     
    96127
    97128    // TODO: save shortcut (syz: |-.->) LM(LM(m) * "t") -> syz?
    98     poly FindReducer(poly product, poly syzterm);
    99    
    100     poly SchreyerSyzygyNF(poly syz_lead, poly syz_2);
     129    poly FindReducer(poly product, poly syzterm) const;
     130   
     131    poly SchreyerSyzygyNF(poly syz_lead, poly syz_2) const;
    101132
    102133    // TODO: store m * @tail -.-^-.-^-.--> ?
    103     poly TraverseTail(poly multiplier, poly tail);
     134    poly TraverseTail(poly multiplier, poly tail) const;
    104135
    105136    // TODO: save shortcut (syz: |-.->) LM(m) * "t" -> ?
    106     poly ReduceTerm(poly multiplier, poly term4reduction, poly syztermCheck);
    107 
    108    
     137    poly ReduceTerm(poly multiplier, poly term4reduction, poly syztermCheck) const;
     138
    109139  protected:
    110140   
     
    129159
    130160    /*mutable?*/ ideal m_LS; ///< leading syzygy terms used for reducing syzygy tails
     161
     162    const SchreyerSyzygyComputationFlags m_atttributes;
    131163};
    132164
     
    134166// The following wrappers are just for testing separate functions on highest level (within schreyer.lib)
    135167
    136 static inline void ComputeSyzygy(const ideal L, const ideal T, ideal& LL, ideal& TT, const ring R)
    137 {
    138   SchreyerSyzygyComputation syz(L, T, R);
     168static inline void ComputeSyzygy(const ideal L, const ideal T, ideal& LL, ideal& TT, const ring R, const SchreyerSyzygyComputationFlags A)
     169{
     170  SchreyerSyzygyComputation syz(L, T, R, A);
    139171  syz.ComputeSyzygy();
    140172  syz.ReadOffResult(LL, TT);
    141173}
    142174
    143 static inline ideal ComputeLeadingSyzygyTerms(const ideal& L, const ring R)
    144 {
    145   SchreyerSyzygyComputation syz(L, NULL, R);
     175static inline ideal ComputeLeadingSyzygyTerms(const ideal& L, const ring R, const SchreyerSyzygyComputationFlags A)
     176{
     177  SchreyerSyzygyComputation syz(L, NULL, R, A);
    146178  syz.ComputeLeadingSyzygyTerms(false);
    147179  ideal LL, TT;
     
    150182}
    151183
    152 static inline ideal Compute2LeadingSyzygyTerms(const ideal& L, const ring R)
    153 {
    154   SchreyerSyzygyComputation syz(L, NULL, R);
     184static inline ideal Compute2LeadingSyzygyTerms(const ideal& L, const ring R, const SchreyerSyzygyComputationFlags A)
     185{
     186  SchreyerSyzygyComputation syz(L, NULL, R, A);
    155187  syz.ComputeLeadingSyzygyTerms(true);
    156188  ideal LL, TT;
     
    160192
    161193static inline poly FindReducer(poly product, poly syzterm,
    162                                ideal L, ideal LS, const ring R)
    163 {
    164   SchreyerSyzygyComputation syz(L, NULL, LS, R);
     194                               ideal L, ideal LS, const ring R, const SchreyerSyzygyComputationFlags A)
     195{
     196  SchreyerSyzygyComputation syz(L, NULL, LS, R, A);
    165197  return syz.FindReducer(product, syzterm);
    166198}
    167199
    168200static inline poly TraverseTail(poly multiplier, poly tail,
    169                                 ideal L, ideal T, ideal LS, const ring R)
    170 {
    171   SchreyerSyzygyComputation syz(L, T, LS, R);
     201                                ideal L, ideal T, ideal LS, const ring R, const SchreyerSyzygyComputationFlags A)
     202{
     203  SchreyerSyzygyComputation syz(L, T, LS, R, A);
    172204  return syz.TraverseTail(multiplier, tail);
    173205}
    174206
    175207static inline poly ReduceTerm(poly multiplier, poly term4reduction, poly syztermCheck,
    176                               ideal L, ideal T, ideal LS, const ring R)
    177 {
    178   SchreyerSyzygyComputation syz(L, T, LS, R);
     208                              ideal L, ideal T, ideal LS, const ring R, const SchreyerSyzygyComputationFlags A)
     209{
     210  SchreyerSyzygyComputation syz(L, T, LS, R, A);
    179211  return syz.ReduceTerm(multiplier, term4reduction, syztermCheck);
    180212}
     
    182214
    183215static inline poly SchreyerSyzygyNF(poly syz_lead, poly syz_2,
    184                                     ideal L, ideal T, ideal LS, const ring R)
    185 {
    186   SchreyerSyzygyComputation syz(L, T, LS, R);
     216                                    ideal L, ideal T, ideal LS, const ring R, const SchreyerSyzygyComputationFlags A)
     217{
     218  SchreyerSyzygyComputation syz(L, T, LS, R, A);
    187219  return syz.SchreyerSyzygyNF(syz_lead, syz_2);
    188220}
    189 
    190 
    191221
    192222END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.