Changeset 1a4c343 in git for dyn_modules/syzextra/syzextra.h
- Timestamp:
- Sep 12, 2012, 6:31:08 PM (11 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dyn_modules/syzextra/syzextra.h
r1cf13b r1a4c343 112 112 113 113 114 class 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!) 114 139 class CReducerFinder: public SchreyerSyzygyComputationFlags 115 140 { 116 141 private: 117 class CLeadingTerm118 {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. vector128 // NOTE/TODO: either of the following should be enough:129 const unsigned int m_label; ///< index in the main L[] + 1130 const poly m_lt; ///< the leading term itself L[label-1]131 };132 133 142 typedef long TComponentKey; 134 143 typedef std::vector<const CLeadingTerm*> TReducers; 135 144 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 */ 136 188 137 189 public: … … 143 195 ~CReducerFinder(); 144 196 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; 147 200 148 201 bool IsDivisible(const poly q) const; … … 160 213 161 214 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&); 162 219 }; 163 220 … … 180 237 181 238 public: 182 183 239 /// Construct a global object for given input data (separated into leads & tails) 184 240 SchreyerSyzygyComputation(const ideal idLeads, const ideal idTails, const SchreyerSyzygyComputationFlags setting): … … 188 244 m_lcm(m_idLeads, setting), m_div(m_idLeads, setting), m_checker(NULL, setting) 189 245 { 246 if( __TAILREDSYZ__ && !__IGNORETAILS__) 247 { 248 if( idTails != NULL ) 249 SetUpTailTerms(idTails); 250 } 190 251 } 191 252 … … 197 258 m_lcm(m_idLeads, setting), m_div(m_idLeads, setting), m_checker(NULL, setting) 198 259 { 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 } 201 267 } 202 268 203 204 269 /// Destructor should not destruct the resulting m_syzLeads, m_syzTails. 205 270 ~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(); 206 276 207 277 /// Read off the results while detaching them from this object … … 233 303 // 234 304 poly TraverseNF(const poly syz_lead, const poly syz_2 = NULL) const; 305 235 306 236 307 public: … … 247 318 ideal Compute2LeadingSyzygyTerms(); 248 319 249 /// Clean up all the accumulated data250 void CleanUp() {}251 252 320 private: 253 321 /// input leading terms … … 273 341 274 342 /*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 */ 275 364 }; 276 365
Note: See TracChangeset
for help on using the changeset viewer.