1 // Copyright (c) 2006 Anna M. Bigatti 2 3 // This file is part of the source of CoCoALib, the CoCoA Library. 4 // CoCoALib is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 9 // CoCoALib is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 14 // You should have received a copy of the GNU General Public License 15 // along with CoCoALib. If not, see <http://www.gnu.org/licenses/>. 16 17 #include "CoCoA/ReductionCog.H" 18 19 #include "CoCoA/PPMonoid.H" 20 #include "CoCoA/geobucket.H" 21 #include "CoCoA/SparsePolyRing.H" 22 #include "CoCoA/assert.H" 23 #include "CoCoA/ring.H" 24 25 #include <cstddef> 26 //using std::size_t; 27 #include <iostream> 28 //using std::ostream; 29 #include <memory> 30 //using std::auto_ptr; 31 //#include <vector> 32 //using std::vector; 33 34 35 namespace CoCoA 36 { 37 38 std::ostream& operator<<(std::ostream& out, const ReductionCog& F) 39 { 40 if (!out) return out; // short-cut for bad ostreams 41 return F->myOutput(out); 42 } 43 44 45 namespace RedCog 46 { 47 48 class PolyFieldImpl: public ReductionCogBase 49 { 50 public: 51 PolyFieldImpl(SparsePolyRing P); ~PolyFieldImpl()52 ~PolyFieldImpl() {}; 53 virtual void myAssignReset(RingElem& f); 54 virtual void myAssignReset(RingElem& f, long fLen); 55 virtual void myRelease(RingElem& f); 56 virtual ConstRefPPMonoidElem myActiveLPP() const; 57 virtual void myMoveToNextLM(); 58 virtual bool IamActiveZero() const; 59 virtual void myReduce(ConstRefRingElem reducer, long RedLen=0); 60 virtual std::ostream& myOutput(std::ostream& out) const; 61 62 private: 63 RingElem myActiveSummandsValue; 64 RingElem myIgnoredPPsValue; 65 RingElem myTmpLM; 66 }; 67 68 69 class PolyGCDImpl: public ReductionCogBase 70 { 71 public: 72 PolyGCDImpl(SparsePolyRing P); ~PolyGCDImpl()73 ~PolyGCDImpl() {}; 74 virtual void myAssignReset(RingElem& f); 75 virtual void myAssignReset(RingElem& f, long fLen); 76 virtual void myRelease(RingElem& f); 77 virtual ConstRefPPMonoidElem myActiveLPP() const; 78 virtual void myMoveToNextLM(); 79 virtual bool IamActiveZero() const; 80 virtual void myReduce(ConstRefRingElem reducer, long RedLen=0); 81 virtual std::ostream& myOutput(std::ostream& out) const; 82 83 private: 84 RingElem myActiveSummandsValue; 85 RingElem myIgnoredPPsValue; 86 RingElem myIgnoredPPsScaleValue; 87 RingElem myTmpLM; 88 RingElem myTmpScaleValue; 89 long myReductionCount; 90 }; 91 92 93 class GeobucketFieldImpl: public ReductionCogBase 94 { 95 public: 96 GeobucketFieldImpl(SparsePolyRing P); ~GeobucketFieldImpl()97 ~GeobucketFieldImpl() {}; 98 virtual void myAssignReset(RingElem& f); 99 virtual void myAssignReset(RingElem& f, long fLen); 100 virtual void myRelease(RingElem& f); 101 virtual ConstRefPPMonoidElem myActiveLPP() const; 102 virtual void myMoveToNextLM(); 103 virtual bool IamActiveZero() const; 104 virtual void myReduce(ConstRefRingElem reducer, long RedLen=0); 105 virtual std::ostream& myOutput(std::ostream& out) const; 106 107 private: 108 geobucket myActiveSummandsValue; 109 RingElem myIgnoredPPsValue; 110 RingElem myTmpLM; 111 }; 112 113 114 class GeobucketGCDImpl: public ReductionCogBase 115 { 116 public: 117 GeobucketGCDImpl(SparsePolyRing P); ~GeobucketGCDImpl()118 ~GeobucketGCDImpl() {}; 119 virtual void myAssignReset(RingElem& f); 120 virtual void myAssignReset(RingElem& f, long fLen); 121 virtual void myRelease(RingElem& f); 122 virtual ConstRefPPMonoidElem myActiveLPP() const; 123 virtual void myMoveToNextLM(); 124 virtual bool IamActiveZero() const; 125 virtual void myReduce(ConstRefRingElem reducer, long RedLen=0); 126 virtual std::ostream& myOutput(std::ostream& out) const; 127 128 private: 129 geobucket myActiveSummandsValue; 130 RingElem myIgnoredPPsValue; 131 RingElem myIgnoredPPsScaleValue; 132 RingElem myTmpLM; 133 RingElem myTmpScaleValue; 134 long myReductionCount; 135 }; 136 137 } // namespace RedCog 138 139 140 141 142 //-- PolyFieldImpl ---------------------------------- 143 144 // RedCog::PolyFieldImpl::PolyFieldImpl(ConstRefRingElem f): 145 // myActiveSummandsValue(f), myIgnoredPPsValue(owner(f)) 146 // {} 147 148 PolyFieldImpl(SparsePolyRing P)149 RedCog::PolyFieldImpl::PolyFieldImpl(SparsePolyRing P): 150 ReductionCogBase(), 151 myActiveSummandsValue(P), myIgnoredPPsValue(P), myTmpLM(P) 152 {} 153 154 myAssignReset(RingElem & f)155 void RedCog::PolyFieldImpl::myAssignReset(RingElem& f) 156 { 157 const SparsePolyRing P = owner(myIgnoredPPsValue); 158 CoCoA_ASSERT( P == owner(f) ); 159 CoCoA_ASSERT( P->myIsValid(raw(f)) ); 160 P->myAssignZero(raw(myActiveSummandsValue)); 161 P->myAssignZero(raw(myIgnoredPPsValue)); 162 swap(f, myActiveSummandsValue); 163 } 164 165 myAssignReset(RingElem & f,long)166 void RedCog::PolyFieldImpl::myAssignReset(RingElem& f, long /*fLen*/) 167 { 168 myAssignReset(f); 169 } 170 171 myRelease(RingElem & f)172 void RedCog::PolyFieldImpl::myRelease(RingElem& f) 173 { 174 const SparsePolyRing P = owner(myIgnoredPPsValue); 175 CoCoA_ASSERT( P == owner(f) ); 176 P->myAddClear(raw(myIgnoredPPsValue), raw(myActiveSummandsValue)); 177 P->myAssignZero(raw(f)); 178 // if ( !IsZero(myIgnoredPPsValue) ) 179 // P->myDivByCoeff(raw(myIgnoredPPsValue), raw(LC(myIgnoredPPsValue))); 180 swap(f, myIgnoredPPsValue); 181 } 182 183 myActiveLPP()184 ConstRefPPMonoidElem RedCog::PolyFieldImpl::myActiveLPP() const 185 { return LPP(myActiveSummandsValue); } 186 187 myMoveToNextLM()188 void RedCog::PolyFieldImpl::myMoveToNextLM() 189 { 190 SparsePolyRing(owner(myTmpLM))->myMoveLMToBack(raw(myIgnoredPPsValue), raw(myActiveSummandsValue)); 191 } 192 193 IamActiveZero()194 bool RedCog::PolyFieldImpl::IamActiveZero() const 195 { return IsZero(myActiveSummandsValue); } 196 197 myReduce(ConstRefRingElem g,long)198 void RedCog::PolyFieldImpl::myReduce(ConstRefRingElem g, long /*gLen*/) 199 { 200 CoCoA_ASSERT( !IamActiveZero() ); 201 const SparsePolyRing P = owner(g); 202 CoCoA_ASSERT( IsField(CoeffRing(P)) ); 203 CoCoA_ASSERT( P == owner(myActiveSummandsValue) ); 204 P->myReductionStep(raw(myActiveSummandsValue), raw(g)); 205 } 206 myOutput(std::ostream & out)207 std::ostream& RedCog::PolyFieldImpl::myOutput(std::ostream& out) const 208 { 209 if (!out) return out; // short-cut for bad ostreams 210 return out << "(" << myIgnoredPPsValue 211 << ") + (" << myActiveSummandsValue << ")"; 212 } 213 214 215 //-- PolyGCDImpl ---------------------------------- 216 217 // RedCog::PolyGCDImpl::PolyGCDImpl(ConstRefRingElem f): 218 // myActiveSummandsValue(f), myIgnoredPPsValue(owner(f)) 219 // {} 220 221 PolyGCDImpl(SparsePolyRing P)222 RedCog::PolyGCDImpl::PolyGCDImpl(SparsePolyRing P): 223 ReductionCogBase(), 224 myActiveSummandsValue(P), 225 myIgnoredPPsValue(P), 226 myIgnoredPPsScaleValue(one(CoeffRing(P))), 227 myTmpLM(P), 228 myTmpScaleValue(one(CoeffRing(P))) 229 { myReductionCount = 0; } 230 231 myAssignReset(RingElem & f)232 void RedCog::PolyGCDImpl::myAssignReset(RingElem& f) 233 { 234 const SparsePolyRing P = owner(myIgnoredPPsValue); 235 CoCoA_ASSERT( P == owner(f) ); 236 CoCoA_ASSERT( P->myIsValid(raw(f)) ); 237 P->myAssignZero(raw(myActiveSummandsValue)); 238 P->myAssignZero(raw(myIgnoredPPsValue)); 239 myIgnoredPPsScaleValue = 1; 240 // myTmpScaleValue = 1; // does not matter 241 myReductionCount = 0; 242 swap(f, myActiveSummandsValue); 243 } 244 245 myAssignReset(RingElem & f,long)246 void RedCog::PolyGCDImpl::myAssignReset(RingElem& f, long /*fLen*/) 247 { 248 myAssignReset(f); 249 } 250 251 myRelease(RingElem & f)252 void RedCog::PolyGCDImpl::myRelease(RingElem& f) 253 { 254 const SparsePolyRing P = owner(myIgnoredPPsValue); 255 CoCoA_ASSERT( P == owner(f) ); 256 P->myMulByCoeff(raw(myIgnoredPPsValue), raw(myIgnoredPPsScaleValue)); 257 //myIgnoredPPsScaleValue = 1; 258 P->myAddClear(raw(myIgnoredPPsValue), raw(myActiveSummandsValue)); 259 P->myAssignZero(raw(f)); 260 if ( !IsZero(myIgnoredPPsValue) ) 261 P->myRemoveBigContent(raw(myIgnoredPPsValue)); 262 swap(f, myIgnoredPPsValue); 263 myReductionCount = 0; 264 } 265 266 myActiveLPP()267 ConstRefPPMonoidElem RedCog::PolyGCDImpl::myActiveLPP() const 268 { return LPP(myActiveSummandsValue); } 269 270 myMoveToNextLM()271 void RedCog::PolyGCDImpl::myMoveToNextLM() 272 { 273 const SparsePolyRing P = owner(myTmpLM); 274 275 P->myMoveLMToFront(raw(myTmpLM), raw(myActiveSummandsValue)); 276 P->myMulByCoeff(raw(myIgnoredPPsValue), raw(myIgnoredPPsScaleValue)); 277 myIgnoredPPsScaleValue = 1; 278 P->myAppendClear(raw(myIgnoredPPsValue), raw(myTmpLM)); // myTmpLM is 0 279 } 280 281 IamActiveZero()282 bool RedCog::PolyGCDImpl::IamActiveZero() const 283 { return IsZero(myActiveSummandsValue); } 284 285 myReduce(ConstRefRingElem g,long)286 void RedCog::PolyGCDImpl::myReduce(ConstRefRingElem g, long /*gLen*/) 287 { 288 CoCoA_ASSERT( !IamActiveZero() ); 289 const SparsePolyRing P = owner(g); 290 CoCoA_ASSERT( IsTrueGCDDomain(CoeffRing(P)) ); 291 CoCoA_ASSERT( P == owner(myActiveSummandsValue) ); 292 293 ++myReductionCount; 294 P->myReductionStepGCD(raw(myActiveSummandsValue), raw(g), myTmpScaleValue); 295 if ( IamActiveZero() ) return; 296 if ( !IsZero(myIgnoredPPsValue) ) 297 { 298 if ( !IsOne(myTmpScaleValue) ) 299 myIgnoredPPsScaleValue *= myTmpScaleValue; 300 } 301 else 302 if ( myReductionCount==50 ) 303 { 304 P->myRemoveBigContent(raw(myActiveSummandsValue)); 305 myReductionCount = 0; 306 } 307 } 308 309 myOutput(std::ostream & out)310 std::ostream& RedCog::PolyGCDImpl::myOutput(std::ostream& out) const 311 { 312 if (!out) return out; // short-cut for bad ostreams 313 return out << "(" << myIgnoredPPsScaleValue 314 << ")*(" << myIgnoredPPsValue << ")" 315 << ") + (" << myActiveSummandsValue << ")"; 316 } 317 318 319 //-- GeobucketFieldImpl ---------------------------------- 320 321 // RedCog::GeobucketFieldImpl::GeobucketFieldImpl(ConstRefRingElem f): 322 // myActiveSummandsValue(f), myIgnoredPPsValue(owner(f)) 323 // {} 324 325 GeobucketFieldImpl(SparsePolyRing P)326 RedCog::GeobucketFieldImpl::GeobucketFieldImpl(SparsePolyRing P): 327 ReductionCogBase(), 328 myActiveSummandsValue(P), myIgnoredPPsValue(P), myTmpLM(P) 329 {} 330 331 myAssignReset(RingElem & f)332 void RedCog::GeobucketFieldImpl::myAssignReset(RingElem& f) 333 { 334 myAssignReset(f, NumTerms(f)); 335 } 336 337 myAssignReset(RingElem & f,long fLen)338 void RedCog::GeobucketFieldImpl::myAssignReset(RingElem& f, long fLen) 339 { 340 const SparsePolyRing P = owner(myIgnoredPPsValue); 341 CoCoA_ASSERT( P == owner(f) ); 342 CoCoA_ASSERT( P->myIsValid(raw(f)) ); 343 // P->myAssignZero(raw(myActiveSummandsValue)); // to be added to geobucket!!!! 344 P->myAssignZero(raw(myIgnoredPPsValue)); 345 myActiveSummandsValue.myAddClear(f, fLen); 346 } 347 348 myRelease(RingElem & f)349 void RedCog::GeobucketFieldImpl::myRelease(RingElem& f) 350 { 351 const SparsePolyRing P = owner(myIgnoredPPsValue); 352 CoCoA_ASSERT( P == owner(f) ); 353 AddClear(myIgnoredPPsValue, myActiveSummandsValue); 354 P->myAssignZero(raw(f)); 355 // if ( !IsZero(myIgnoredPPsValue) ) 356 // P->myDivByCoeff(raw(myIgnoredPPsValue), raw(LC(myIgnoredPPsValue))); 357 swap(f, myIgnoredPPsValue); 358 } 359 360 myActiveLPP()361 ConstRefPPMonoidElem RedCog::GeobucketFieldImpl::myActiveLPP() const 362 { return LPP(myActiveSummandsValue); } 363 364 myMoveToNextLM()365 void RedCog::GeobucketFieldImpl::myMoveToNextLM() 366 { 367 const SparsePolyRing P = owner(myTmpLM); 368 369 MoveLMToFront(myTmpLM, myActiveSummandsValue); 370 P->myAppendClear(raw(myIgnoredPPsValue), raw(myTmpLM)); // myTmpLM is 0 371 } 372 373 IamActiveZero()374 bool RedCog::GeobucketFieldImpl::IamActiveZero() const 375 { return IsZero(myActiveSummandsValue); } 376 377 myReduce(ConstRefRingElem g,long gLen)378 void RedCog::GeobucketFieldImpl::myReduce(ConstRefRingElem g, long gLen) 379 { 380 CoCoA_ASSERT( !IamActiveZero() ); 381 const SparsePolyRing P = owner(g); 382 CoCoA_ASSERT( IsField(CoeffRing(P)) ); 383 CoCoA_ASSERT( P == owner(myIgnoredPPsValue) ); 384 CoCoA::ReductionStep(myActiveSummandsValue, g, gLen); 385 } 386 myOutput(std::ostream & out)387 std::ostream& RedCog::GeobucketFieldImpl::myOutput(std::ostream& out) const 388 { 389 if (!out) return out; // short-cut for bad ostreams 390 return out << "(" << myIgnoredPPsValue 391 << ") + (" << myActiveSummandsValue << ")"; 392 } 393 394 395 396 397 //-- GeobucketGCDImpl ---------------------------------- 398 399 // RedCog::GeobucketGCDImpl::GeobucketGCDImpl(ConstRefRingElem f): 400 // myActiveSummandsValue(f), myIgnoredPPsValue(owner(f)) 401 // {} 402 403 GeobucketGCDImpl(SparsePolyRing P)404 RedCog::GeobucketGCDImpl::GeobucketGCDImpl(SparsePolyRing P): 405 ReductionCogBase(), 406 myActiveSummandsValue(P), 407 myIgnoredPPsValue(P), 408 myIgnoredPPsScaleValue(one(CoeffRing(P))), 409 myTmpLM(P), 410 myTmpScaleValue(one(CoeffRing(P))) 411 { myReductionCount = 0; } 412 413 myAssignReset(RingElem & f)414 void RedCog::GeobucketGCDImpl::myAssignReset(RingElem& f) 415 { 416 myAssignReset(f, NumTerms(f)); 417 } 418 419 myAssignReset(RingElem & f,long fLen)420 void RedCog::GeobucketGCDImpl::myAssignReset(RingElem& f, long fLen) 421 { 422 const SparsePolyRing P = owner(myIgnoredPPsValue); 423 CoCoA_ASSERT( P == owner(f) ); 424 CoCoA_ASSERT( P->myIsValid(raw(f)) ); 425 // P->myAssignZero(raw(myActiveSummandsValue)); // to be added to geobucket!!!! 426 P->myAssignZero(raw(myIgnoredPPsValue)); 427 myActiveSummandsValue.myAddClear(f, fLen); 428 myIgnoredPPsScaleValue = 1; 429 // myTmpScaleValue = 1; // does not matter 430 myReductionCount = 0; 431 } 432 433 myRelease(RingElem & f)434 void RedCog::GeobucketGCDImpl::myRelease(RingElem& f) 435 { 436 const SparsePolyRing P = owner(myIgnoredPPsValue); 437 CoCoA_ASSERT( P == owner(f) ); 438 P->myMulByCoeff(raw(myIgnoredPPsValue), raw(myIgnoredPPsScaleValue)); 439 //myIgnoredPPsScaleValue = 1; 440 AddClear(myIgnoredPPsValue, myActiveSummandsValue); 441 P->myAssignZero(raw(f)); 442 if ( !IsZero(myIgnoredPPsValue) ) 443 P->myRemoveBigContent(raw(myIgnoredPPsValue)); 444 swap(f, myIgnoredPPsValue); 445 myReductionCount = 0; 446 } 447 448 myActiveLPP()449 ConstRefPPMonoidElem RedCog::GeobucketGCDImpl::myActiveLPP() const 450 { return LPP(myActiveSummandsValue); } 451 452 myMoveToNextLM()453 void RedCog::GeobucketGCDImpl::myMoveToNextLM() 454 { 455 const SparsePolyRing P = owner(myTmpLM); 456 RingElem cnt(content(myActiveSummandsValue)); 457 458 if ( !IsZero(myIgnoredPPsValue) ) 459 { 460 // cnt = gcd(cnt, myIgnoredPPsScaleValue*content(myIgnoredPPsValue)); 461 cnt = gcd(cnt, myIgnoredPPsScaleValue); 462 myIgnoredPPsScaleValue /= cnt; 463 P->myMulByCoeff(raw(myIgnoredPPsValue), raw(myIgnoredPPsScaleValue)); 464 myIgnoredPPsScaleValue = 1; 465 } 466 myActiveSummandsValue.myDivByCoeff(cnt); 467 MoveLMToFront(myTmpLM, myActiveSummandsValue); 468 P->myAppendClear(raw(myIgnoredPPsValue), raw(myTmpLM)); // myTmpLM is 0 469 } 470 471 IamActiveZero()472 bool RedCog::GeobucketGCDImpl::IamActiveZero() const 473 { return IsZero(myActiveSummandsValue); } 474 475 myReduce(ConstRefRingElem g,long gLen)476 void RedCog::GeobucketGCDImpl::myReduce(ConstRefRingElem g, long gLen) 477 { 478 CoCoA_ASSERT( !IamActiveZero() ); 479 const SparsePolyRing P = owner(g); 480 CoCoA_ASSERT( IsTrueGCDDomain(CoeffRing(P)) ); 481 CoCoA_ASSERT( P == owner(myIgnoredPPsValue) ); 482 483 ++myReductionCount; 484 CoCoA::ReductionStepGCD(myActiveSummandsValue, g, myTmpScaleValue, gLen); 485 if ( IamActiveZero() ) return; 486 if ( (!IsZero(myIgnoredPPsValue)) ) 487 { 488 if ( !IsOne(myTmpScaleValue) ) 489 myIgnoredPPsScaleValue *= myTmpScaleValue; 490 } 491 else 492 if ( myReductionCount==50 ) 493 { 494 RemoveBigContent(myActiveSummandsValue); 495 myReductionCount = 0; 496 } 497 } 498 499 myOutput(std::ostream & out)500 std::ostream& RedCog::GeobucketGCDImpl::myOutput(std::ostream& out) const 501 { 502 if (!out) return out; // short-cut for bad ostreams 503 return out << "(" << myIgnoredPPsValue 504 << ") + (" << myActiveSummandsValue << ")"; 505 } 506 507 508 509 //---------------------------------------------------------------------- 510 // Here are the pseudo-constructors: 511 NewRedCogPolyField(const SparsePolyRing & P)512 ReductionCog NewRedCogPolyField(const SparsePolyRing& P) 513 { return ReductionCog(new RedCog::PolyFieldImpl(P)); } 514 NewRedCogPolyGCD(const SparsePolyRing & P)515 ReductionCog NewRedCogPolyGCD(const SparsePolyRing& P) 516 { return ReductionCog(new RedCog::PolyGCDImpl(P)); } 517 NewRedCogGeobucketField(const SparsePolyRing & P)518 ReductionCog NewRedCogGeobucketField(const SparsePolyRing& P) 519 { return ReductionCog(new RedCog::GeobucketFieldImpl(P)); } 520 NewRedCogGeobucketGCD(const SparsePolyRing & P)521 ReductionCog NewRedCogGeobucketGCD(const SparsePolyRing& P) 522 { return ReductionCog(new RedCog::GeobucketGCDImpl(P)); } 523 524 525 } // namespace CoCoA 526 527 528 529 //---------------------------------------------------------------------- 530 // RCS header/log in the next few lines 531 // $Header: /Volumes/Home_1/cocoa/cvs-repository/CoCoALib-0.99/src/AlgebraicCore/ReductionCog.C,v 1.16 2020/02/11 16:12:19 abbott Exp $ 532 // $Log: ReductionCog.C,v $ 533 // Revision 1.16 2020/02/11 16:12:19 abbott 534 // Summary: Added some checks for bad ostream (even to mem fns myOutput); see redmine 969 535 // 536 // Revision 1.15 2018/04/10 14:30:49 bigatti 537 // -- fixed includes 538 // 539 // Revision 1.14 2018/04/09 16:34:26 bigatti 540 // -- 541 // back to original name 542 // 543 // Revision 1.2 2018/04/06 15:35:53 bigatti 544 // -- fixed includes 545 // 546 // Revision 1.1 2018/04/06 15:14:50 bigatti 547 // renamed ReductionCog.C 548 // 549 // Revision 1.12 2016/11/11 14:15:33 abbott 550 // Summary: Added short-cut to operator<< when ostream is in bad state 551 // 552 // Revision 1.11 2015/04/27 14:41:45 bigatti 553 // -- PolyFieldImpl::myMoveToNextLM is now one line 554 // 555 // Revision 1.10 2015/04/24 15:40:58 bigatti 556 // -- renamed: myAddMul --> myAddMulLM 557 // -- renamed: myMoveLM --> myMoveLMToFront 558 // -- new myMoveLMToBack (used in ReductionCog --> bug in test-TmpMorseGraph??) 559 // 560 // Revision 1.9 2014/07/07 13:45:24 abbott 561 // Summary: Removed AsSparsePolyRing 562 // Author: JAA 563 // 564 // Revision 1.8 2014/04/30 16:10:59 abbott 565 // Summary: Replaced size_t by long 566 // Author: JAA 567 // 568 // Revision 1.7 2012/10/16 09:48:31 abbott 569 // Replaced RefRingElem by RingElem& (several times) 570 // 571 // Revision 1.6 2012/05/22 10:02:37 abbott 572 // Removed IsGCDDomain; substituted by IsTrueGCDDomain. 573 // Added IsFractionFieldOfGCDDomain. 574 // 575 // Revision 1.5 2009/10/27 13:40:34 bigatti 576 // -- added check IamActiveZero 577 // 578 // Revision 1.4 2009/10/26 16:21:24 bigatti 579 // -- fixed rare bug in GeobucketGCDImpl::myReduce 580 // 581 // Revision 1.3 2009/10/02 13:48:12 bigatti 582 // -- aesthetics 583 // 584 // Revision 1.2 2007/10/30 17:14:07 abbott 585 // Changed licence from GPL-2 only to GPL-3 or later. 586 // New version for such an important change. 587 // 588 // Revision 1.1.1.1 2007/03/09 15:16:11 abbott 589 // Imported files 590 // 591 // Revision 1.8 2007/03/08 18:22:29 cocoa 592 // Just whitespace cleaning. 593 // 594 // Revision 1.7 2007/02/10 18:44:03 cocoa 595 // Added "const" twice to each test and example. 596 // Eliminated dependency on io.H in several files. 597 // Improved BuildInfo, and added an example about how to use it. 598 // Some other minor cleaning. 599 // 600 // Revision 1.6 2006/12/07 17:23:46 cocoa 601 // -- for compilation with _Wextra: commented out names of unused arguments 602 // 603 // Revision 1.5 2006/11/24 17:53:14 cocoa 604 // -- using SmartPtrIRC for ref counting (was auto_ptr) 605 // 606 // Revision 1.4 2006/10/06 15:17:08 cocoa 607 // -- myReduce now returns void instead of RingElem 608 // 609 // Revision 1.3 2006/10/06 14:04:14 cocoa 610 // Corrected position of #ifndef in header files. 611 // Separated CoCoA_ASSERT into assert.H from config.H; 612 // many minor consequential changes (have to #include assert.H). 613 // A little tidying of #include directives (esp. in Max's code). 614 // 615 // Revision 1.2 2006/07/19 07:15:40 cocoa 616 // -- added CoCoA_ASSERT for input validity in myAssignReset 617 // 618 // Revision 1.1.1.1 2006/05/30 11:39:37 cocoa 619 // Imported files 620 // 621 // Revision 1.6 2006/04/11 16:05:56 cocoa 622 // -- changed: the polynomial is made monic in GPoly::myReduce 623 // instead of ReductionCog::myRelease 624 // 625 // Revision 1.5 2006/04/11 14:16:29 cocoa 626 // -- reorganization of fns between reduce,SparsePolyRing,GPoly 627 // -- added optional "len" argument to myAssignReset in ReductionCog 628 // 629 // Revision 1.4 2006/04/10 13:38:06 cocoa 630 // -- added myTmpLM field to avoid repeated creations/deletions 631 // 632 // Revision 1.3 2006/03/17 18:17:16 cocoa 633 // -- changed: use of ReductionCog for reduction (major cleanup) 634 // 635 // Revision 1.2 2006/03/16 15:21:53 cocoa 636 // -- rearranged 637 // 638 // Revision 1.1 2006/03/16 14:28:29 cocoa 639 // -- first import 640 // 641