Changeset 16a86e in git
- Timestamp:
- Oct 6, 2009, 2:09:00 PM (14 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 58aa9c9e7cce5179cb2dc91516a79b6e0b352a96
- Parents:
- e070895e98cba72b2d19d9f11f5ec2edc262c1d6
- Location:
- Singular
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Minor.cc
re070895 r16a86e 675 675 int MinorValue::_RankingStrategy = -1; 676 676 677 long MinorValue::getWeight () const 678 { 679 assert(false); // must be overridden in derived classes 680 return 0; 681 } 682 677 683 // just to make the compiler happy; 678 684 // this method should never be called … … 680 686 assert(false); 681 687 return (this == &mv); // compare addresses of both objects 688 } 689 690 string MinorValue::toString () const 691 { 692 assert(false); // must be overridden in derived classes 693 return ""; 682 694 } 683 695 -
Singular/Minor.h
re070895 r16a86e 1 #ifndef M inor_H2 #define M inor_H1 #ifndef MINOR_H 2 #define MINOR_H 3 3 4 4 #ifdef HAVE_MINOR … … 459 459 * @see Cache::getWeight () const 460 460 */ 461 virtual long getWeight () const {};461 virtual long getWeight () const; 462 462 463 463 /** … … 564 564 * @return a printable version of the given instance as instance of class string 565 565 */ 566 virtual string toString () const {};566 virtual string toString () const; 567 567 568 568 /** … … 677 677 678 678 #endif 679 /* M inor_H */679 /* MINOR_H */ -
Singular/TestMinors.cc
re070895 r16a86e 329 329 ideal testAllPolyMinorsAsIdeal(matrix mat, int minorSize, int strategy, int cacheEntries, long cacheWeight) 330 330 { 331 // counters + auxiliary stuff 332 long totalMultiplications = 0; 333 long totalAdditions = 0; 334 long totalMultiplicationsAccumulated = 0; 335 long totalAdditionsAccumulated = 0; 336 char h[30]; 337 331 338 int rowCount = mat->nrows; 332 339 int columnCount = mat->ncols; … … 351 358 PolyMinorValue theMinor; 352 359 poly po; 353 int nonZeroCounter = 0; 354 std::list<poly> generators; 360 ideal iii = idInit(nonZeroCounter, 0); 355 361 356 362 if (strategy == 0) 357 363 { 364 PrintLn(); PrintS("new code uses no cache"); 358 365 // iteration over all minors of size "minorSize x minorSize" 359 366 while (mp.hasNextMinor()) { … … 361 368 theMinor = mp.getNextMinor(); 362 369 po = theMinor.getResult(); 363 if (!pEqualPolys(po, zeroPoly))364 {365 nonZeroCounter++;366 generators.insert(generators.end(), po);367 }370 totalMultiplicationsAccumulated += theMinor.getAccumulatedMultiplications(); 371 totalMultiplications += theMinor.getMultiplications(); 372 totalAdditionsAccumulated += theMinor.getAccumulatedAdditions(); 373 totalAdditions += theMinor.getAdditions(); 374 idInsertPoly(iii, po); // will include po only if it is not the zero polynomial 368 375 } 369 376 } 370 377 else 371 378 { 379 PrintLn(); PrintS("new code uses cache with caching strategy "); 380 sprintf(h, "%d", strategy); PrintS(h); 372 381 MinorValue::SetRankingStrategy(strategy); 373 382 Cache<MinorKey, PolyMinorValue> cch(cacheEntries, cacheWeight); … … 377 386 theMinor = mp.getNextMinor(cch); 378 387 po = theMinor.getResult(); 379 if (!pEqualPolys(po, zeroPoly))380 {381 nonZeroCounter++;382 generators.insert(generators.end(), po);383 }388 totalMultiplicationsAccumulated += theMinor.getAccumulatedMultiplications(); 389 totalMultiplications += theMinor.getMultiplications(); 390 totalAdditionsAccumulated += theMinor.getAccumulatedAdditions(); 391 totalAdditions += theMinor.getAdditions(); 392 idInsertPoly(iii, po); // will include po only if it is not the zero polynomial 384 393 } 385 394 } 386 387 // build the return value, i.e. the ideal of non-zero minors 388 ideal iii = idInit(nonZeroCounter, 0); 389 int i = 0; 390 for (std::list<poly>::iterator it = generators.begin(); it != generators.end(); it++) 391 { 392 iii->m[i] = *it; 393 i++; 394 } 395 396 PrintLn(); PrintS("numbers of performed operations"); 397 PrintLn(); PrintS(" polynomial-to-polynomial multiplications: "); 398 sprintf(h, "%ld", totalMultiplications); PrintS(h); 399 PrintLn(); PrintS(" polynomial-to-polynomial additions: "); 400 sprintf(h, "%ld", totalAdditions); PrintS(h); 401 PrintLn(); PrintS(" (polynomial-to-polynomial multiplications without cache would be: "); 402 sprintf(h, "%ld", totalMultiplicationsAccumulated); PrintS(h); PrintS(")"); 403 PrintLn(); PrintS(" (polynomial-to-polynomial additions without cache would be: "); 404 sprintf(h, "%ld", totalAdditionsAccumulated); PrintS(h); PrintS(")"); 405 PrintLn(); PrintLn(); 406 395 407 return iii; 396 408 } -
Singular/claptmpl.cc
re070895 r16a86e 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: claptmpl.cc,v 1.4 8 2009-10-02 13:51:19seelisch Exp $5 // $Id: claptmpl.cc,v 1.49 2009-10-06 12:09:00 seelisch Exp $ 6 6 /* 7 7 * ABSTRACT - instantiation of all templates … … 263 263 template class std::list<int>; 264 264 template class std::list<long>; 265 template class std::list<poly>;266 265 template class std::list<MinorKey>; 267 266 template class std::list<LongMinorValue>; -
Singular/extra.cc
re070895 r16a86e 2 2 * Computer Algebra System SINGULAR * 3 3 *****************************************/ 4 /* $Id: extra.cc,v 1.32 0 2009-10-02 16:13:30 seelisch Exp $ */4 /* $Id: extra.cc,v 1.321 2009-10-06 12:09:00 seelisch Exp $ */ 5 5 /* 6 6 * ABSTRACT: general interface to internals of Singular ("system" command) … … 2193 2193 #endif // HAVE_MINOR 2194 2194 /*==================== generic debug ==================================*/ 2195 //#ifdef PDEBUG2195 #ifdef PDEBUG 2196 2196 if(strcmp(sys_cmd,"DetailedPrint")==0) 2197 2197 { … … 2244 2244 } 2245 2245 else 2246 //#endif2246 #endif 2247 2247 /*==================== mtrack ==================================*/ 2248 2248 if(strcmp(sys_cmd,"mtrack")==0)
Note: See TracChangeset
for help on using the changeset viewer.