Changeset 16a86e in git


Ignore:
Timestamp:
Oct 6, 2009, 2:09:00 PM (14 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
58aa9c9e7cce5179cb2dc91516a79b6e0b352a96
Parents:
e070895e98cba72b2d19d9f11f5ec2edc262c1d6
Message:
some more fixes to make the code link on compute servers (64bit)


git-svn-id: file:///usr/local/Singular/svn/trunk@12161 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/Minor.cc

    re070895 r16a86e  
    675675int MinorValue::_RankingStrategy = -1;
    676676
     677long MinorValue::getWeight () const
     678{
     679  assert(false);  // must be overridden in derived classes
     680  return 0;
     681}
     682
    677683// just to make the compiler happy;
    678684// this method should never be called
     
    680686    assert(false);
    681687    return (this == &mv);  // compare addresses of both objects
     688}
     689
     690string MinorValue::toString () const
     691{
     692  assert(false);  // must be overridden in derived classes
     693  return "";
    682694}
    683695
  • Singular/Minor.h

    re070895 r16a86e  
    1 #ifndef Minor_H
    2 #define Minor_H
     1#ifndef MINOR_H
     2#define MINOR_H
    33
    44#ifdef HAVE_MINOR
     
    459459             * @see Cache::getWeight () const
    460460             */
    461              virtual long getWeight () const {};
     461             virtual long getWeight () const;
    462462
    463463             /**
     
    564564             * @return a printable version of the given instance as instance of class string
    565565             */
    566              virtual string toString () const {};
     566             virtual string toString () const;
    567567
    568568             /**
     
    677677
    678678#endif
    679 /* Minor_H */
     679/* MINOR_H */
  • Singular/TestMinors.cc

    re070895 r16a86e  
    329329ideal testAllPolyMinorsAsIdeal(matrix mat, int minorSize, int strategy, int cacheEntries, long cacheWeight)
    330330{
     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
    331338  int rowCount = mat->nrows;
    332339  int columnCount = mat->ncols;
     
    351358  PolyMinorValue theMinor;
    352359  poly po;
    353   int nonZeroCounter = 0;
    354   std::list<poly> generators;
     360  ideal iii = idInit(nonZeroCounter, 0);
    355361
    356362  if (strategy == 0)
    357363  {
     364    PrintLn(); PrintS("new code uses no cache");
    358365    // iteration over all minors of size "minorSize x minorSize"
    359366    while (mp.hasNextMinor()) {
     
    361368      theMinor = mp.getNextMinor();
    362369      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
    368375    }
    369376  }
    370377  else
    371378  {
     379    PrintLn(); PrintS("new code uses cache with caching strategy ");
     380    sprintf(h, "%d", strategy); PrintS(h);
    372381    MinorValue::SetRankingStrategy(strategy);
    373382    Cache<MinorKey, PolyMinorValue> cch(cacheEntries, cacheWeight);
     
    377386      theMinor = mp.getNextMinor(cch);
    378387      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
    384393    }
    385394  }
    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
    395407  return iii;
    396408}
  • Singular/claptmpl.cc

    re070895 r16a86e  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: claptmpl.cc,v 1.48 2009-10-02 13:51:19 seelisch Exp $
     5// $Id: claptmpl.cc,v 1.49 2009-10-06 12:09:00 seelisch Exp $
    66/*
    77* ABSTRACT - instantiation of all templates
     
    263263template class std::list<int>;
    264264template class std::list<long>;
    265 template class std::list<poly>;
    266265template class std::list<MinorKey>;
    267266template class std::list<LongMinorValue>;
  • Singular/extra.cc

    re070895 r16a86e  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.320 2009-10-02 16:13:30 seelisch Exp $ */
     4/* $Id: extra.cc,v 1.321 2009-10-06 12:09:00 seelisch Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    21932193#endif // HAVE_MINOR
    21942194/*==================== generic debug ==================================*/
    2195 //#ifdef PDEBUG
     2195#ifdef PDEBUG
    21962196      if(strcmp(sys_cmd,"DetailedPrint")==0)
    21972197      {
     
    22442244      }
    22452245      else
    2246 //#endif
     2246#endif
    22472247/*==================== mtrack ==================================*/
    22482248    if(strcmp(sys_cmd,"mtrack")==0)
Note: See TracChangeset for help on using the changeset viewer.