Changeset efcad1 in git
- Timestamp:
- Oct 14, 2016, 4:20:21 PM (8 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- c86bbe3f55d8a362921878398a1579907ed5fff9
- Parents:
- 74dc544f60e1fb4461ed4301bd9f05ac85132898
- git-author:
- Andreas Steenpass <steenpass@mathematik.uni-kl.de>2016-10-14 16:20:21+02:00
- git-committer:
- Andreas Steenpass <steenpass@mathematik.uni-kl.de>2017-12-15 12:17:07+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/syz4.cc
r74dc544 refcad1 160 160 161 161 #if CACHE 162 bool my_p_LmCmp_test (poly a, poly b, const ring r)163 {164 return p_LmCmp(a, b, r) == -1;165 }166 167 162 struct CCacheCompare_test 168 163 { 169 const ring& m_ring_test;170 CCacheCompare_test(): m_ring_test(currRing) {}171 CCacheCompare_test(const ring& r): m_ring_test(r) {}172 CCacheCompare_test(const CCacheCompare_test& lhs):173 m_ring_test(lhs.m_ring_test) {}174 CCacheCompare_test& operator=(const CCacheCompare_test& lhs)175 {176 return (const_cast<CCacheCompare_test&>(lhs));177 }178 164 inline bool operator() (const poly& l, const poly& r) 179 165 const 180 166 { 181 return my_p_LmCmp_test(l, r, m_ring_test);167 return (p_LmCmp(l, r, currRing) == -1); 182 168 } 183 169 }; … … 189 175 static TCache_test m_cache_test; 190 176 191 static FORCE_INLINE poly myp_Head_test(const poly p, const bool bIgnoreCoeff, 192 const ring r) 193 { 194 p_LmCheckPolyRing1(p, r); 195 poly np; 196 omTypeAllocBin(poly, np, r->PolyBin); 197 p_SetRingOfLm(np, r); 198 memcpy(np->exp, p->exp, r->ExpL_Size*sizeof(long)); 199 pNext(np) = NULL; 200 pSetCoeff0(np, (bIgnoreCoeff)? NULL : n_Copy(pGetCoeff(p), r->cf)); 201 p_LmCheckPolyRing1(np, r); 202 return np; 203 } 177 // note: we don't need to keep the coeffs of those terms which are lifted to 0 204 178 205 179 static void delete_cache() … … 212 186 p_Delete(const_cast<poly*>(&(vit->first)), currRing); 213 187 } 214 T. erase(T.begin(), T.end());215 } 216 m_cache_test. erase(m_cache_test.begin(), m_cache_test.end());188 T.clear(); 189 } 190 m_cache_test.clear(); 217 191 } 218 192 #endif // CACHE … … 247 221 if( itr == T.end() ) 248 222 { 249 T.insert(TP2PCache_test::value_type( myp_Head_test(multiplier, (p==NULL),223 T.insert(TP2PCache_test::value_type(p_Head(multiplier, 250 224 r), p) ); 251 225 return p_Copy(p, r); … … 264 238 if( itr == T.end() ) 265 239 { 266 T.insert(TP2PCache_test::value_type( myp_Head_test(multiplier, (p==NULL),240 T.insert(TP2PCache_test::value_type(p_Head(multiplier, 267 241 r), p)); 268 242 return p_Copy(p, r); … … 270 244 return p; 271 245 } 272 CCacheCompare_test o(r); 273 TP2PCache_test T(o); 274 T.insert(TP2PCache_test::value_type(myp_Head_test(multiplier, (p==NULL), r), 246 TP2PCache_test T; 247 T.insert(TP2PCache_test::value_type(p_Head(multiplier, r), 275 248 p)); 276 249 m_cache_test.insert( TCache_test::value_type(tail, T) );
Note: See TracChangeset
for help on using the changeset viewer.