Changeset a9c298 in git


Ignore:
Timestamp:
Nov 20, 2013, 4:54:25 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '48f1dd268d0ff74ef2f7dccbf02545425002ddcc')
Children:
0de0509972719531e2a4b51ec9fd0e44a66fd2fd
Parents:
e4014563a82388c4b39dfa37db24cbe159b24a35
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-20 16:54:25+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-20 16:54:42+01:00
Message:
format stuff
Files:
72 edited

Legend:

Unmodified
Added
Removed
  • Singular/Cache.h

    re40145 ra9c298  
    7676     */
    7777   std::list<int> _rank;
    78  
     78
    7979     /**
    8080     * _key is sorted in ascending order, i.e.,
     
    8484     */
    8585     std::list<KeyClass> _key;
    86  
     86
    8787     /**
    8888     *  _value captures the actual objects of interest;<br>
     
    9292     */
    9393     std::list<ValueClass> _value;
    94      
     94
    9595     /**
    9696     * container for the weights of all cached values
    9797     */
    9898     std::list<int> _weights;
    99  
     99
    100100     /**
    101101     * a pointer to some element of _key;
     
    105105     */
    106106     mutable typename std::list<KeyClass>::const_iterator _itKey;
    107      
     107
    108108     /**
    109109     * a pointer to some element of _value;
     
    113113     */
    114114     mutable typename std::list<ValueClass>::const_iterator _itValue;
    115  
     115
    116116     /**
    117117     * for storing the momentary weight of the given cache;<br>
     
    121121     */
    122122     int _weight;
    123  
     123
    124124     /**
    125125     * the bound for the number of cached <c>key --> value</c> pairs;<br>
     
    129129     */
    130130     int _maxEntries;
    131  
     131
    132132     /**
    133133     * the bound on total cache weight;<br>
     
    137137     */
    138138     int _maxWeight;
    139  
     139
    140140     /**
    141141     * A method for providing the index of a given key in the vector _key.
     
    148148     */
    149149     int getIndexInKey (const KeyClass& key) const;
    150  
     150
    151151     /**
    152152     * A method for providing the index of a given value in the vector _rank.
     
    159159     */
    160160     int getIndexInRank (const ValueClass& value) const;
    161  
     161
    162162     /**
    163163     * A method for shrinking the given cache so that it meet the bounds on
     
    169169     */
    170170     bool shrink (const KeyClass& key);
    171  
     171
    172172     /**
    173173     * A method for deleting the least-ranked cache entry.
     
    184184     */
    185185     Cache();
    186  
     186
    187187     /**
    188188     * A destructor for class Cache.
     
    191191     */
    192192     ~Cache();
    193  
     193
    194194     /**
    195195     * Copy implementation for class Cache.
     
    198198     */
    199199     Cache (const Cache& c);
    200  
     200
    201201     /**
    202202     * A user-suited constructor for class Cache.
     
    210210     */
    211211     Cache (const int maxEntries, const int maxWeight);
    212  
     212
    213213     /**
    214214     * A method for retrieving the momentary weight of the cache.
     
    222222     */
    223223     int getWeight () const;
    224  
     224
    225225     /**
    226226     * A method for retrieving the momentary number of (key --> value) pairs
     
    232232     */
    233233     int getNumberOfEntries () const;
    234  
     234
    235235     /**
    236236     * A method for retrieving the maximum number of (key --> value) pairs
     
    241241     */
    242242     int getMaxNumberOfEntries () const;
    243  
     243
    244244     /**
    245245     * A method for retrieving the maximum weight of the cache.
     
    249249     */
    250250     int getMaxWeight () const;
    251  
     251
    252252     /**
    253253     * Checks whether the cache contains a pair (k --> v) such that
     
    264264     */
    265265     bool hasKey (const KeyClass& key) const;
    266  
     266
    267267     /**
    268268     * Returns the value for a given key.
     
    280280     */
    281281     ValueClass getValue (const KeyClass& key) const;
    282  
     282
    283283     /**
    284284     * Inserts the pair (key --> value) in the cache.
     
    301301     */
    302302     bool put (const KeyClass& key, const ValueClass& value);
    303  
     303
    304304     /**
    305305     * Clears the cache so that it has no entry. This method will also
     
    307307     */
    308308     void clear ();
    309  
     309
    310310     /**
    311311     * A method for providing a printable version of the represented
     
    315315     */
    316316   std::string toString () const;
    317  
     317
    318318     /**
    319319     * A method for printing a string representation of the given cache to
  • Singular/Minor.cc

    re40145 ra9c298  
    1313
    1414void MinorKey::reset()
    15 {                     
     15{
    1616  _numberOfRowBlocks = 0;
    1717  _numberOfColumnBlocks = 0;
     
    5959  for (int c = 0; c < _numberOfColumnBlocks; c++)
    6060      _columnKey[c] = mk.getColumnKey(c);
    61      
     61
    6262  return *this;
    6363}
     
    707707      if ((blockCount - 1 >= mkBlockIndex) &&
    708708        (shiftedBit & this->getColumnKey(mkBlockIndex))) hitBits++;
    709       else if (shiftedBit & currentInt) 
     709      else if (shiftedBit & currentInt)
    710710      {
    711711        newBitToBeSet = shiftedBit;
  • Singular/Minor.h

    re40145 ra9c298  
    187187     */
    188188     MinorKey& operator=(const MinorKey&);
    189      
     189
    190190     /**
    191191     * just to make the compiler happy
     
    411411    */
    412412    int _retrievals;
    413    
     413
    414414    /**
    415415    * -1 iff cache is not used, otherwise the maximum number of potential
     
    418418    */
    419419    int _potentialRetrievals;
    420    
     420
    421421    /**
    422422    * a store for the actual number of multiplications to compute the current
     
    424424    */
    425425    int _multiplications;
    426    
     426
    427427    /**
    428428    * a store for the actual number of additions to compute the current minor
    429429    */
    430430    int _additions;
    431    
     431
    432432    /**
    433433    * a store for the accumulated number of multiplications to compute the
     
    438438    */
    439439    int _accumulatedMult;
    440    
     440
    441441    /**
    442442    * a store for the accumulated number of additions to compute the current
     
    447447    */
    448448    int _accumulatedSum;
    449    
     449
    450450    /**
    451451    * A method for obtaining a rank measure for the given MinorValue.<br>
     
    463463    */
    464464    int rankMeasure1 () const;
    465    
     465
    466466    /**
    467467    * A method for obtaining a rank measure for the given MinorValue.<br>
     
    481481    */
    482482    int rankMeasure2 () const;
    483    
     483
    484484    /**
    485485    * A method for obtaining a rank measure for the given MinorValue.<br>
     
    498498    */
    499499    int rankMeasure3 () const;
    500    
     500
    501501    /**
    502502    * A method for obtaining a rank measure for the given MinorValue.<br>
     
    515515    */
    516516    int rankMeasure4 () const;
    517    
     517
    518518    /**
    519519    * A method for obtaining a rank measure for the given MinorValue.<br>
     
    532532    */
    533533    int rankMeasure5 () const;
    534    
     534
    535535    /**
    536536    * private store for the current value ranking strategy;
     
    538538    */
    539539    static int g_rankingStrategy;
    540    
     540
    541541    /**
    542542    * Accessor for the static private field g_rankingStrategy.
     
    548548    */
    549549    bool operator== (const MinorValue& mv) const;
    550    
     550
    551551    /**
    552552    * just to make the compiler happy
    553553    */
    554554    bool operator< (const MinorValue& mv) const;
    555    
     555
    556556    /**
    557557    * A method for retrieving the weight of a given MinorValue.
     
    566566    */
    567567    virtual int getWeight () const;
    568    
     568
    569569    /**
    570570    * A method for accessing the number of retrievals of this minor. Multiple
     
    575575    */
    576576    int getRetrievals () const;
    577    
     577
    578578    /**
    579579    * A method for accessing the maximum number of potential retrievals of
     
    585585    */
    586586    int getPotentialRetrievals () const;
    587    
     587
    588588    /**
    589589    * A method for accessing the multiplications performed while computing
     
    600600    */
    601601    int getMultiplications () const;
    602    
     602
    603603    /**
    604604    * A method for accessing the multiplications performed while computing
     
    613613    */
    614614    int getAccumulatedMultiplications () const;
    615    
     615
    616616    /**
    617617    * A method for accessing the additions performed while computing this
     
    636636    */
    637637    int getAccumulatedAdditions () const;
    638    
     638
    639639    /**
    640640    * A method for incrementing the number of performed retrievals of \a this
     
    654654    */
    655655    void incrementRetrievals ();
    656    
     656
    657657    /**
    658658    * A method for obtaining a rank measure for theiven MinorValue.<br>
     
    671671    */
    672672    int getUtility () const;
    673    
     673
    674674    /**
    675675    * A method for determining the value ranking strategy.<br>
     
    680680    */
    681681    static void SetRankingStrategy (const int rankingStrategy);
    682    
     682
    683683    /**
    684684    * A method for providing a printable version of the represented MinorValue.
     
    687687    */
    688688   virtual std::string toString () const;
    689    
     689
    690690    /**
    691691    * A method for printing a string representation of the given MinorValue
     
    756756    */
    757757    virtual ~IntMinorValue ();
    758    
     758
    759759    /**
    760760    * Accessor for the private field _result.
     
    762762    */
    763763    int getResult() const;
    764    
     764
    765765    /**
    766766    * Accessor for the current weight of this class instance.
     
    833833    */
    834834    void operator= (const PolyMinorValue& mv);
    835    
     835
    836836    /**
    837837    * just to make the compiler happy
     
    843843    */
    844844    virtual ~PolyMinorValue ();
    845    
     845
    846846    /**
    847847    * Accessor for the private field _result.
     
    849849    */
    850850    poly getResult() const;
    851    
     851
    852852    /**
    853853    * Accessor for the current weight of this class instance.
     
    855855    */
    856856    int getWeight () const;
    857    
     857
    858858    /**
    859859    * A method for providing a printable version of the represented MinorValue.
  • Singular/MinorInterface.h

    re40145 ra9c298  
    2121   "Laplace"; when a cache is used, the underlying algorithm
    2222   is automatically Laplace */
    23    
     23
    2424/**
    2525* Returns the specified set of minors (= subdeterminantes) of the
  • Singular/MinorProcessor.cc

    re40145 ra9c298  
    416416    return getMinorPrivateBareiss(_minorSize, _minor, characteristic, iSB);
    417417  else assume(false);
    418  
     418
    419419  /* The following code is never reached and just there to make the
    420420     compiler happy: */
     
    933933    return getMinorPrivateBareiss(_minorSize, _minor, iSB);
    934934  else assume(false);
    935    
     935
    936936  /* The following code is never reached and just there to make the
    937937     compiler happy: */
     
    14441444            complexity = 0;
    14451445            while ((pp != NULL) && (complexity < minComplexity))
    1446             { 
     1446            {
    14471447              complexity += nSize(pGetCoeff(pp)); pp = pNext(pp);
    14481448            }
  • Singular/blackbox.h

    re40145 ra9c298  
    7070/// return the name to the type given by t (r/o)
    7171const char *    getBlackboxName(const int t);
    72 /// used by scanner: returns ROOT_DECL for known types 
     72/// used by scanner: returns ROOT_DECL for known types
    7373/// (and the type number in @c tok)
    7474int blackboxIsCmd(const char *n, int & tok);
  • Singular/calcSVD.cc

    re40145 ra9c298  
    6262    failthreshold = amp::ampf<Precision>("5.0E-3");
    6363    a.setbounds(1, max_i, 1, max_j);
    64        
    65        
     64
     65
    6666        //
    6767        // fill matrix a entries from M
     
    8080    ap::template_2d_array< amp::ampf<Precision> > vt;
    8181    ap::template_1d_array< amp::ampf<Precision> > w;
    82     svd::svddecomposition<Precision>(a, max_i, max_j, 2, 2, 2, w, u, vt);         
     82    svd::svddecomposition<Precision>(a, max_i, max_j, 2, 2, 2, w, u, vt);       
    8383    matrix Mu,Mw,Mvt;
    8484    Mu=mpNew(max_i,max_i);
  • Singular/countedref.h

    re40145 ra9c298  
    1111 *
    1212 * @note This works was supported by the "Industrial Algebra" project.
    13  * 
     13 *
    1414 * @par Copyright:
    1515 *   (c) 2012 by The Singular Team, see LICENSE file
     
    8080  //}
    8181
    82   /// Checking equality 
     82  /// Checking equality
    8383  bool operator==(const self& rhs) const { return m_ptr == rhs.m_ptr; }
    8484
     
    9696  count_type count() const { return (*this? m_ptr->ref: 0); }
    9797  void reclaim() { if (*this) ++m_ptr->ref; }
    98   void release() { 
     98  void release() {
    9999    if (*this && (--m_ptr->ref <= 0) && !nondestructive)
    100       CountedRefPtr_kill(m_ptr); 
     100      CountedRefPtr_kill(m_ptr);
    101101  }
    102102  //@}
     
    136136
    137137template <class PtrType>
    138 class CountedRefIndirectPtr: 
     138class CountedRefIndirectPtr:
    139139  public RefCounter {
    140140public:
     
    149149};
    150150
    151 template <class PtrType> 
     151template <class PtrType>
    152152inline void CountedRefPtr_kill(CountedRefIndirectPtr<PtrType>* pval) { delete pval; }
    153153
     
    184184  //@{
    185185  operator bool() const {  return operator->(); }
    186   self& operator=(const self& rhs) { 
     186  self& operator=(const self& rhs) {
    187187    m_indirect = rhs.m_indirect;
    188188    return *this;
    189189  }
    190190  self& operator=(ptr_type ptr) {
    191     if (!m_indirect) 
     191    if (!m_indirect)
    192192      m_indirect = new CountedRefIndirectPtr<ptr_type>(ptr);
    193193    else
     
    209209
    210210/** @class LeftvHelper
    211  * This class implements some recurrent code sniplets to be used with 
     211 * This class implements some recurrent code sniplets to be used with
    212212 * @c leftv and @c idhdl.implements a refernce counter which we can use
    213213 **/
     
    286286  public LeftvHelper {
    287287  typedef LeftvShallow self;
    288  
     288
    289289public:
    290290  /// Just allocate (all-zero) @c leftv
     
    296296
    297297  /// Destruct
    298   ~LeftvShallow() { 
     298  ~LeftvShallow() {
    299299    recursivekill(m_data->e);
    300300    omFree(m_data);
     
    324324/** @class LeftvDeep
    325325 * This class wraps @c leftv by taking into acount memory allocation, destruction
    326  * as well as deeply copying of a given @c leftv, i.e. we also take over 
     326 * as well as deeply copying of a given @c leftv, i.e. we also take over
    327327 * ownership of the @c leftv data.
    328328 *
     
    333333 * @note It invalidats @c leftv on input.
    334334 **/
    335 class LeftvDeep: 
     335class LeftvDeep:
    336336  public LeftvHelper {
    337337  typedef LeftvDeep self;
     
    349349  /// Store a deep copy of the data
    350350  /// @ note Occupies the provided @c leftv and invalidates the latter
    351   LeftvDeep(leftv data): m_data(cpy(data)) { 
    352     data->e = NULL;   // occupy subexpression 
    353     if(!isid()) m_data->data=data->CopyD(); 
     351  LeftvDeep(leftv data): m_data(cpy(data)) {
     352    data->e = NULL;   // occupy subexpression
     353    if(!isid()) m_data->data=data->CopyD();
    354354  }
    355355
     
    390390  BOOLEAN brokenid(idhdl context) const {
    391391    assume(isid());
    392     return (context == NULL) || 
     392    return (context == NULL) ||
    393393      ((context != (idhdl) m_data->data) && brokenid(IDNEXT(context)));
    394394  }
  • Singular/eigenval_ip.cc

    re40145 ra9c298  
    182182
    183183      intvec *m0;
    184 #ifdef HAVE_FACTORY     
    185184      ideal e0=singclap_factorize(mp_DetBareiss(M,currRing),&m0,2, currRing);
    186 #else
    187       WarnS("cannot factorize due to missing module 'factory'");
    188       ideal e0=NULL;
    189 #endif
    190      
    191185      if (e0==NULL)
    192186      {
  • Singular/extra.cc

    re40145 ra9c298  
    21812181        intvec* arg3 = (intvec*) h->next->next->Data();
    21822182        int arg4 = (int)(long) h->next->next->next->Data();
    2183        
     2183
    21842184        ideal result = (ideal) Mfrwalk(arg1, arg2, arg3, arg4);
    21852185
     
    21882188
    21892189        return FALSE;
    2190       } 
     2190      }
    21912191      else
    21922192
     
    39273927    p_poly* h= reinterpret_cast<p_poly*> (erg);
    39283928    h->p_poly_print();
    3929    
     3929
    39303930    return FALSE;
    39313931  }
  • Singular/iparith.cc

    re40145 ra9c298  
    30383038
    30393039  maxl--;
    3040   if (/*(*/ maxl==-1 /*)*/) /*&& (iiOp!=MRES_CMD)*/ 
     3040  if (/*(*/ maxl==-1 /*)*/) /*&& (iiOp!=MRES_CMD)*/
    30413041  {
    30423042    maxl = currRing->N-1+2*(iiOp==MRES_CMD);
     
    31533153
    31543154  maxl--;
    3155   if (/*(*/ maxl==-1 /*)*/) /*&& (iiOp!=MRES_CMD)*/ 
     3155  if (/*(*/ maxl==-1 /*)*/) /*&& (iiOp!=MRES_CMD)*/
    31563156  {
    31573157    maxl = currRing->N-1+2*(iiOp==MRES_CMD);
     
    43674367static BOOLEAN jjDIFF_COEF(leftv res, leftv u, leftv v)
    43684368{
    4369   if (!nCoeff_is_transExt(currRing->cf)) 
    4370   { 
     4369  if (!nCoeff_is_transExt(currRing->cf))
     4370  {
    43714371    WerrorS("differentiation not defined in the coefficient ring");
    43724372    return TRUE;
  • Singular/ipassign.cc

    re40145 ra9c298  
    502502static BOOLEAN jiA_1x1INTMAT(leftv res, leftv a,Subexpr e)
    503503{
    504   if (/*(*/ res->rtyp!=INTMAT_CMD /*)*/) /*|| (e!=NULL) - TRUE because of type int */ 
     504  if (/*(*/ res->rtyp!=INTMAT_CMD /*)*/) /*|| (e!=NULL) - TRUE because of type int */
    505505  {
    506506    // no error message: assignment simply fails
     
    524524static BOOLEAN jiA_1x1MATRIX(leftv res, leftv a,Subexpr e)
    525525{
    526   if (/*(*/ res->rtyp!=MATRIX_CMD /*)*/) /*|| (e!=NULL) - TRUE because of type poly */ 
     526  if (/*(*/ res->rtyp!=MATRIX_CMD /*)*/) /*|| (e!=NULL) - TRUE because of type poly */
    527527  {
    528528    // no error message: assignment simply fails
     
    846846
    847847  int lt=l->Typ();
    848   if (/*(*/ lt==0 /*)*/) /*&&(l->name!=NULL)*/ 
     848  if (/*(*/ lt==0 /*)*/) /*&&(l->name!=NULL)*/
    849849  {
    850850    if (!errorreported) Werror("left side `%s` is undefined",l->Fullname());
  • Singular/ipshell.cc

    re40145 ra9c298  
    50905090      else // (0/p, a, b, ..., z)
    50915091      {
    5092         if ((ch!=0) && (ch!=IsPrime(ch))) 
     5092        if ((ch!=0) && (ch!=IsPrime(ch)))
    50935093        {
    50945094          WerrorS("too many parameters");
  • Singular/locals.h

    re40145 ra9c298  
    1717
    1818#if 0
    19 extern "C" 
     19extern "C"
    2020{
    2121  void   Print(char* fmt, ...);
  • Singular/misc_ip.h

    re40145 ra9c298  
    11/*****************************************************************************\
    2  * Computer Algebra System SINGULAR   
     2 * Computer Algebra System SINGULAR
    33\*****************************************************************************/
    44/** @file misc_ip.h
    5  * 
     5 *
    66 * This file provides miscellaneous functionality.
    77 *
  • Singular/mod_lib.h

    re40145 ra9c298  
    22#define MOD_LIB_H
    33
    4 // #include config.h     
     4// #include config.h
    55#include <kernel/mod2.h> /* for EMBED_PYTHON, HAVE_MATHICGB */
    66
     
    1010
    1111
    12 #if HAVE_GFANLIB 
     12#if HAVE_GFANLIB
    1313#define SI_BUILTIN_GFANLIB(add) add(gfanlib)
    1414#else
    15 #define SI_BUILTIN_GFANLIB(add) 
     15#define SI_BUILTIN_GFANLIB(add)
    1616#endif
    1717
     
    2121//TODO: the line above means that syzextra should be staticly embedded IFF pyobjects do so :(
    2222#else
    23 #define SI_BUILTIN_PYOBJECT(add) 
     23#define SI_BUILTIN_PYOBJECT(add)
    2424#endif
    2525
     
    2727# define SI_BUILTIN_MATHIC(add) add(singmathic)
    2828#else
    29 # define SI_BUILTIN_MATHIC(add) 
     29# define SI_BUILTIN_MATHIC(add)
    3030#endif
    3131
  • Singular/omSingularConfig.h

    re40145 ra9c298  
    33 *  Purpose: declaration of External Config stuff for omalloc
    44 *           This file is inlcuded by omDefaultConfig.h, i.e., at the the time
    5  *           the omalloc library is built. Any changes to the default config 
    6  *           of omalloc should be done here (and, of course, you need to 
     5 *           the omalloc library is built. Any changes to the default config
     6 *           of omalloc should be done here (and, of course, you need to
    77 *           rebuilt the library).
    88 *  Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
  • Singular/pyobject.cc

    re40145 ra9c298  
    6666  ~PythonInterpreter()  { if(m_owns_python) Py_Finalize();  }
    6767
    68   /// Initialize unique (singleton) python interpreter instance, 
     68  /// Initialize unique (singleton) python interpreter instance,
    6969  /// and set Singular type identifier
    7070  static void init(id_type num) { instance().m_id = num; }
    7171
    72   /// Get Singular type identitfier 
     72  /// Get Singular type identitfier
    7373  static id_type id() { return instance().m_id; }
    7474
     
    7878    m_id(0), m_owns_python(false)  { start_python(); }
    7979
    80   /// Static initialization - 
     80  /// Static initialization -
    8181  /// safely takes care of destruction on program termination
    82   static PythonInterpreter& instance() 
     82  static PythonInterpreter& instance()
    8383  {
    8484    static PythonInterpreter init_interpreter;
     
    9191    set_python_defaults();
    9292  }
    93  
     93
    9494  void init_python()
    9595  {
     
    110110    PyRun_SimpleString(cmd);
    111111    PyRun_SimpleString("del path");  // cleanup
    112   }   
     112  }
    113113
    114114  id_type m_id;
     
    131131
    132132  PythonObject(): m_ptr(Py_None) { }
    133   PythonObject(ptr_type ptr): m_ptr(ptr) { 
     133  PythonObject(ptr_type ptr): m_ptr(ptr) {
    134134    if (!ptr && handle_exception()) m_ptr = Py_None;
    135135  }
    136136
    137137  ptr_type check_context(ptr_type ptr) const {
    138     if(ptr) sync_contexts(); 
     138    if(ptr) sync_contexts();
    139139    return ptr;
    140140  }
     
    175175
    176176  /// Ternary operations
    177   self operator()(int op, const self& arg1, const self& arg2) const 
     177  self operator()(int op, const self& arg1, const self& arg2) const
    178178  {
    179179    switch(op)
    180180    {
    181       case ATTRIB_CMD: 
     181      case ATTRIB_CMD:
    182182        if(PyObject_SetAttr(*this, arg1, arg2) == -1) handle_exception();
    183183        return self();
     
    210210
    211211  void import_as(const char* name) const {
    212     idhdl handle = enterid(omStrDup(name), 0, DEF_CMD, 
     212    idhdl handle = enterid(omStrDup(name), 0, DEF_CMD,
    213213                           &IDROOT, FALSE);
    214214
     
    216216    {
    217217      IDDATA(handle) = (char*)m_ptr;
    218       Py_XINCREF(m_ptr); 
     218      Py_XINCREF(m_ptr);
    219219      IDTYP(handle) =  PythonInterpreter::id();
    220220    }
     
    228228  self attr(const self& arg) const { return PyObject_GetAttr(*this, arg); }
    229229
    230   self del_attr(const self& arg) const 
    231   {
    232     if (!PyObject_HasAttr(*this, arg)) 
     230  self del_attr(const self& arg) const
     231  {
     232    if (!PyObject_HasAttr(*this, arg))
    233233      Werror("Cannot delete attribute %s.", arg.repr());
    234234    else
    235       PyObject_DelAttr(*this, arg); 
    236  
     235      PyObject_DelAttr(*this, arg);
     236
    237237    return self();
    238238  }
     
    252252
    253253    if(!PyErr_Occurred()) return FALSE;
    254    
     254
    255255    PyObject *pType, *pMessage, *pTraceback;
    256256    PyErr_Fetch(&pType, &pMessage, &pTraceback);
    257    
     257
    258258    WerrorS("pyobject error occured");
    259259    WerrorS(PyString_AsString(pMessage));
    260    
     260
    261261    Py_XDECREF(pType);
    262262    Py_XDECREF(pMessage);
    263263    Py_XDECREF(pTraceback);
    264    
     264
    265265    PyErr_Clear();
    266266    return TRUE;
     
    277277  int py_opid(int op) const{
    278278    switch(op)
    279     { 
     279    {
    280280      case '<':  return Py_LT;
    281281      case '>':  return Py_GT;
    282282      case EQUAL_EQUAL:  return Py_EQ;
    283283      case NOTEQUAL:  return Py_NE;
    284       case GE:  return Py_GE; 
    285       case LE:  return Py_LE; 
     284      case GE:  return Py_GE;
     285      case LE:  return Py_LE;
    286286    }
    287287    return -1;
     
    315315 * compile-time.
    316316 *
    317  * @note The Singular objects are assumed to be equivalent to the template argument. 
     317 * @note The Singular objects are assumed to be equivalent to the template argument.
    318318 **/
    319319template <class CastType = PythonObject::ptr_type>
     
    365365  {
    366366    if (typeId == PythonInterpreter::id()) return PythonCastStatic<>(value);
    367    
     367
    368368    switch (typeId)
    369369    {
     
    376376    sleftv tmp;
    377377    BOOLEAN newstruct_equal(int, leftv, leftv); // declaring overloaded '='
    378     if (!newstruct_equal(PythonInterpreter::id(), &tmp, value)) 
    379       return PythonCastStatic<>(&tmp);       
     378    if (!newstruct_equal(PythonInterpreter::id(), &tmp, value))
     379      return PythonCastStatic<>(&tmp);
    380380
    381381    if (typeId > MAX_TOK)       // custom types
     
    384384      assume(bbx != NULL);
    385385      if (! bbx->blackbox_Op1(PythonInterpreter::id(), &tmp, value))
    386         return PythonCastStatic<>(&tmp);       
     386        return PythonCastStatic<>(&tmp);
    387387    }
    388388
     
    413413    PythonObject(PyTuple_New(size(value)))  { append_to(value); }
    414414
    415  
     415
    416416private:
    417   size_t size(leftv iter, size_t distance = 0) const 
    418   {
    419     if (iter) { do { ++distance; } while((iter = iter->next)); }; 
     417  size_t size(leftv iter, size_t distance = 0) const
     418  {
     419    if (iter) { do { ++distance; } while((iter = iter->next)); };
    420420    return distance;
    421421  }
    422  
     422
    423423  void append_to(leftv iter) const
    424424  {
     
    519519/// blackbox support - copy element
    520520void* pyobject_Copy(blackbox*b, void* ptr)
    521 { 
     521{
    522522    Py_XINCREF(ptr);
    523523    return ptr;
     
    535535  else
    536536    l->data = (void *)result;
    537  
     537
    538538  return !result;
    539539}
    540                                                                      
     540
    541541
    542542/// blackbox support - unary operations
     
    559559    case TYPEOF_CMD:
    560560      res->data = (void*) omStrDup("pyobject");
    561       res->rtyp = STRING_CMD; 
     561      res->rtyp = STRING_CMD;
    562562      return FALSE;
    563563  }
     
    577577
    578578  switch(op)                    // built-in return types and special cases first
    579   { 
     579  {
    580580    case '<': case '>': case EQUAL_EQUAL: case NOTEQUAL: case GE: case LE:
    581581    {
     
    691691  }
    692692
    693   PythonObject deletedElts = 
     693  PythonObject deletedElts =
    694694    python_eval("list(set(_SINGULAR_IMPORTED.iterkeys()) - \
    695695     set(_SINGULAR_NEW.iterkeys()))");
     
    710710
    711711blackbox* pyobject_blackbox(int& tok) {
    712   if(blackboxIsCmd("pyobject", tok) != ROOT_DECL) 
    713   {
    714     tok = setBlackboxStuff((blackbox*)omAlloc0(sizeof(blackbox)), 
     712  if(blackboxIsCmd("pyobject", tok) != ROOT_DECL)
     713  {
     714    tok = setBlackboxStuff((blackbox*)omAlloc0(sizeof(blackbox)),
    715715                           "pyobject");
    716716  }
     
    728728  int tok = -1;
    729729  blackbox* bbx = pyobject_blackbox(tok);
    730   if (bbx->blackbox_Init != pyobject_Init) 
     730  if (bbx->blackbox_Init != pyobject_Init)
    731731  {
    732732    bbx->blackbox_destroy = pyobject_destroy;
     
    740740    bbx->blackbox_OpM     = pyobject_OpM;
    741741    bbx->data             = (void*)omAlloc0(newstruct_desc_size());
    742    
     742
    743743    PythonInterpreter::init(tok);
    744744
    745745    PYOBJECT_ADD_C_PROC(python_import);
    746746    PYOBJECT_ADD_C_PROC(python_eval);
    747     PYOBJECT_ADD_C_PROC(python_run); 
     747    PYOBJECT_ADD_C_PROC(python_run);
    748748  }
    749749  return 0;
     
    752752
    753753#ifndef EMBED_PYTHON
    754 extern "C" { 
     754extern "C" {
    755755  int mod_init(SModulFunctions* psModulFunctions)
    756   { 
    757     return SI_MOD_INIT(pyobject)(psModulFunctions); 
     756  {
     757    return SI_MOD_INIT(pyobject)(psModulFunctions);
    758758  }
    759759}
  • Singular/pyobject_setup.cc

    re40145 ra9c298  
    3535{
    3636  assume(bbx != NULL);
    37   return (pyobject_load() || (bbx->blackbox_Init == pyobject_autoload)? 
     37  return (pyobject_load() || (bbx->blackbox_Init == pyobject_autoload)?
    3838          NULL: bbx->blackbox_Init(bbx));
    3939}
     
    4545
    4646// Setting up an empty blackbox type, which can be filled with pyobject
    47 void pyobject_setup() 
     47void pyobject_setup()
    4848{
    4949  blackbox *bbx = (blackbox*)omAlloc0(sizeof(blackbox));
     
    6060                   getBlackboxStuff(tok): (blackbox*)NULL);
    6161  if (bbx == NULL) return TRUE;
    62   return (bbx->blackbox_Init == pyobject_autoload?  pyobject_load(): FALSE); 
     62  return (bbx->blackbox_Init == pyobject_autoload?  pyobject_load(): FALSE);
    6363}
    6464
  • Singular/pyobject_setup.h

    re40145 ra9c298  
    1717#define SINGULAR_PYOBJECT_SETUP_H
    1818
    19 /// initialize blackbox support for @c pyobject; functionilty os autoloaded on demand 
     19/// initialize blackbox support for @c pyobject; functionilty os autoloaded on demand
    2020void pyobject_setup();
    2121
  • Singular/si_signals.h

    re40145 ra9c298  
    5252                   (pid, status, options))
    5353
    54 //SI_EINTR_SAVE_FUNC(int, waitid, 
     54//SI_EINTR_SAVE_FUNC(int, waitid,
    5555//                   (idtype_t idtype, id_t id, siginfo_t *infop, int options),
    5656//                   (idtype, id, infop, options))
    5757
    58 SI_EINTR_SAVE_FUNC(ssize_t,  read, (int fd, void *buf, size_t count), 
     58SI_EINTR_SAVE_FUNC(ssize_t,  read, (int fd, void *buf, size_t count),
    5959                   (fd, buf, count))
    6060
     
    105105    res = nanosleep(req, rem);
    106106  } while((rem != NULL) && (res < 0) && (errno == EINTR));
    107   return res;   
     107  return res;
    108108}
    109109
     
    125125SI_EINTR_SAVE_FUNC(int, unlink, (const char *pathname), (pathname))
    126126
    127 SI_EINTR_SAVE_SCANF(int, vscanf, 
     127SI_EINTR_SAVE_SCANF(int, vscanf,
    128128                   (const char *format, va_list ap),
    129129                   (format, ap))
     
    139139}
    140140
    141 SI_EINTR_SAVE_SCANF(int, vfscanf, 
     141SI_EINTR_SAVE_SCANF(int, vfscanf,
    142142                   (FILE *stream, const char *format, va_list ap),
    143143                   (stream, format, ap))
     
    153153}
    154154
    155 SI_EINTR_SAVE_SCANF(int, vsscanf, 
     155SI_EINTR_SAVE_SCANF(int, vsscanf,
    156156                   (const char *str, const char *format, va_list ap),
    157157                   (str, format, ap))
    158158
    159 static inline int 
     159static inline int
    160160si_sscanf(const char *str, const char *format, ...)
    161161{
     
    176176
    177177SI_EINTR_SAVE_FUNC(int, sigaction,
    178                    (int signum, const struct sigaction *act, 
     178                   (int signum, const struct sigaction *act,
    179179                    struct sigaction *oldact),
    180180                   (signum, act, oldact))
     
    185185                   (sig, flag))
    186186#else
    187 #define si_siginterrupt(arg1, arg2) 
     187#define si_siginterrupt(arg1, arg2)
    188188#endif
    189189
  • Singular/singmathic.cc

    re40145 ra9c298  
    367367      std::cout << "M";
    368368      break;
    369      
     369
    370370    case ringorder_S: ///< S?
    371371      std::cout << "S";
    372372      break;
    373      
     373
    374374    case ringorder_s: ///< s?
    375375      std::cout << "s";
     
    379379      std::cout << "lp";
    380380      break;
    381      
     381
    382382    case ringorder_dp:
    383383      std::cout << "dp";
  • Singular/subexpr.h

    re40145 ra9c298  
    6262    inline void Init() { memset(this,0,sizeof(*this)); }
    6363    void CleanUp(ring r=currRing);
    64    
     64
    6565    /// Called by type_cmd (e.g. "r;") or as default in jPRINT
    6666    void Print(leftv store=NULL,int spaces=0);
    67    
     67
    6868    /// Called for conversion to string (used by string(..), write(..),..)
    6969    char * String(void *d=NULL, BOOLEAN typed = FALSE, int dim = 1);
    70    
     70
    7171    void Copy(leftv e);
    7272    attr CopyA();
  • Singular/test.cc

    re40145 ra9c298  
    237237{
    238238  assume( sizeof(long) == SIZEOF_LONG );
    239    
     239
    240240  if( sizeof(long) != SIZEOF_LONG )
    241241  {
    242242     WerrorS("Bad config.h: wrong size of long!");
    243      
     243
    244244     return(1);
    245245  }
    246    
     246
    247247   // init path names etc.
    248248//  feInitResources(argv[0]); //???
     
    250250
    251251  if( char *s = versionString() )
    252   { 
     252  {
    253253    PrintS(s);
    254254    omFree(s);
    255255  }
    256    
    257    
     256
     257
    258258
    259259  StringSetS("ressources in use (as reported by feStringAppendResources(0):\n");
    260260  feStringAppendResources(0);
    261   StringAppendS("\n"); 
     261  StringAppendS("\n");
    262262  if( char * s = StringEndS() )
    263263  {
     
    265265    omFree(s);
    266266  }
    267    
    268    
    269    
     267
     268
     269
    270270
    271271  // Libpolys tests:
  • Singular/walk.cc

    re40145 ra9c298  
    949949{
    950950  int i, nR = iv->length();
    951  
     951
    952952  intvec* ivm = new intvec(nR*nR);
    953953
     
    11171117     {
    11181118       mpz_set(tot_deg, maxdeg);
    1119      } 
     1119     }
    11201120  }
    11211121
     
    18811881  mpz_init(sing_int_half);
    18821882  mpz_set_si(sing_int_half,  3*(1073741824/2));
    1883  
     1883
    18841884  mpz_t deg_w0_p1, deg_d0_p1;
    18851885  mpz_init(deg_w0_p1);
     
    19691969//Print("\n// Alloc Size = %d \n", nRing*sizeof(mpz_t));
    19701970  mpz_t *vec=(mpz_t*)omAlloc(nRing*sizeof(mpz_t));
    1971  
     1971
    19721972
    19731973  // there is no 0<t<1 and define the next weight vector that is equal to the current weight vector
     
    20612061    mpz_add(sntz, s_nenner, s_zaehler);
    20622062    mpz_init_set(vec[j], sntz);
    2063    
     2063
    20642064#ifdef NEXT_VECTORS_CC
    20652065    Print("\n//   j = %d ==> ", j);
     
    21262126    {
    21272127      if(mpz_cmp_si(ggt,1)==0)
    2128       {     
     2128      {
    21292129        (*diff_weight1)[j] = floor(0.1*(*diff_weight)[j] + 0.5);
    21302130        // Print("\n//  vector[%d] = %d \n",j+1, (*diff_weight1)[j]);
     
    21532153    }
    21542154*/
    2155  
     2155
    21562156    if(test_w_in_ConeCC(G,diff_weight1) != 0)
    21572157    {
     
    22112211
    22122212
    2213  
     2213
    22142214  if(Overflow_Error == FALSE)
    22152215  {
     
    23342334
    23352335  // complete ring intializations
    2336  
     2336
    23372337  rComplete(r);
    23382338
     
    24082408
    24092409  // complete ring intializations
    2410  
     2410
    24112411  rComplete(r);
    24122412
     
    24712471
    24722472  /* complete ring intializations */
    2473  
     2473
    24742474  rComplete(r);
    24752475
     
    26142614
    26152615  // complete ring intializations
    2616  
     2616
    26172617  rComplete(r);
    26182618
     
    31323132#ifdef INVEPS_SMALL_IN_TRAN
    31333133  if(mpz_cmp_ui(ndeg, nV)>0 && nV > 3)
    3134   { 
     3134  {
    31353135    mpz_cdiv_q_ui(ndeg, ndeg, nV);
    31363136  }
     
    39763976    //compute a perturbed next weight vector "next_weight1"
    39773977    intvec* next_weight1 = MkInterRedNextWeight(MPertVectors(G, MivMatrixOrder(curr_weight), pert_deg), target_weight, G);
    3978     //Print("\n // size of next_weight1 = %d", sizeof((*next_weight1))); 
     3978    //Print("\n // size of next_weight1 = %d", sizeof((*next_weight1)));
    39793979
    39803980    //compute a random next weight vector "next_weight2"
     
    39913991        }
    39923992        weight_norm = 1 + floor(sqrt(weight_norm));
    3993       } 
     3993      }
    39943994
    39953995      for(i=nV-1; i>=0; i--)
     
    40054005      //Print("\n//  next_weight22[%d]  = %d", i, (*next_weight22)[i]);
    40064006      }
    4007      
     4007
    40084008      if(test_w_in_ConeCC(G, next_weight22) == 1)
    40094009      {
     
    40354035          (*result)[i] = (*next_weight1)[i];
    40364036        }
    4037       }   
     4037      }
    40384038    }
    40394039    else
     
    42344234    // compute a next weight vector
    42354235    intvec* next_weight = MkInterRedNextWeight(curr_weight,target_weight, G);
    4236  
     4236
    42374237
    42384238    xtnw = xtnw + clock() - to;
     
    46694669      M = REC_GB_Mwalk(idCopy(Gomega), tmp_weight, curr_weight,pert_deg,1);
    46704670      Print("\n//Mrwalk: time for the last std(Gw)  = %.2f sec\n",((double) (clock()-tim)/1000000));
    4671      
     4671
    46724672#ifdef CHECK_IDEAL_MWALK
    46734673      idString(Gomega, "G_omega");
     
    47034703      {
    47044704        hilb_func = hFirstSeries(Gomega,NULL,NULL,curr_weight,currRing);
    4705       } 
     4705      }
    47064706      else
    47074707      {
     
    47844784    //intvec* next_weight = MkInterRedNextWeight(curr_weight,target_weight,G);
    47854785   intvec* next_weight = MWalkRandomNextWeight(G, curr_weight, target_weight, weight_rad, pert_deg);
    4786    
     4786
    47874787  tnw = tnw + clock() - to;
    47884788//#ifdef PRINT_VECTORS
     
    48454845}
    48464846
    4847 //unused 
     4847//unused
    48484848#if 0
    48494849ideal Mwalk_tst(ideal Go, intvec* curr_weight, intvec* target_weight)
     
    58115811      else
    58125812      {
    5813         // compute a perturbed next weight vector "next_vect1" 
     5813        // compute a perturbed next weight vector "next_vect1"
    58145814        intvec* next_vect11 = MPertVectors(G, MivMatrixOrder(omega), nlev);
    58155815        intvec* next_vect1 = MkInterRedNextWeight(next_vect11, omega2, G);
     
    58225822        ideal G_test = MwalkInitialForm(G, next_vect);
    58235823        ideal G_test1 = MwalkInitialForm(G, next_vect1);
    5824         // Print("\n// G_test, G_test 1 erzeugt");
     5824        // Print("\n// G_test, G_test 1 erzeugt");
    58255825        if(IDELEMS(G_test1) <= IDELEMS(G_test))
    58265826          {
     
    58485848            }
    58495849            weight_norm = 1 + floor(sqrt(weight_norm));
    5850           } 
     5850          }
    58515851          for(i=nV-1; i>=0; i--)
    58525852          {
     
    58565856            }
    58575857            else
    5858             { 
     5858            {
    58595859              (*next_vect22)[i] = (*omega)[i] + floor(weight_rad*(*next_vect22)[i]/weight_norm);
    58605860            }
     
    68296829  to=clock();
    68306830  // compute a red. GB w.r.t. the help ring
    6831   if(MivComp(curr_weight, iv_dp) == 1) 
     6831  if(MivComp(curr_weight, iv_dp) == 1)
    68326832  {
    68336833    //rOrdStr(currRing) = "dp"
     
    69726972    if(MivComp(next_weight, target_weight) != 1)
    69736973    {
    6974       // compute a perturbed next weight vector "next_weight1" 
     6974      // compute a perturbed next weight vector "next_weight1"
    69756975      intvec* next_weight1 = MkInterRedNextWeight(MPertVectors(G, MivMatrixOrder(curr_weight), pert_deg), target_weight, G);
    6976    
     6976
    69776977      // compare next_weight and next_weight1
    69786978      ideal G_test = MwalkInitialForm(G, next_weight);
     
    69876987      // Print("\n//  size of target_weight  = %d", sizeof((*target_weight)));
    69886988      k = 0;
    6989    
     6989
    69906990      while(test_w_in_ConeCC(G, next_weight22) == 0 && k < 11)
    69916991      {
     
    70057005          }
    70067006          weight_norm = 1 + floor(sqrt(weight_norm));
    7007         } 
     7007        }
    70087008        for(i=nV-1; i>=0; i--)
    70097009        {
    7010           if((*next_weight22)[i] < 0)
     7010          if((*next_weight22)[i] < 0)
    70117011          {
    70127012            (*next_weight22)[i] = 1 + (*curr_weight)[i] + floor(weight_rad*(*next_weight22)[i]/weight_norm);
     
    70187018          // Print("\n//  next_weight22[%d]  = %d", i, (*next_weight22)[i]);
    70197019        }
    7020       } 
     7020      }
    70217021
    70227022      if(test_w_in_ConeCC(G, next_weight22) == 1)
     
    70287028        ideal G_test2 = MwalkInitialForm(G, next_weight2);
    70297029        if(IDELEMS(G_test2) <= IDELEMS(G_test))
    7030         {
     7030        {
    70317031          if(IDELEMS(G_test2) <= IDELEMS(G_test1))
    70327032          {
     
    77917791#endif
    77927792        tproc = clock()-xftinput;
    7793        
     7793
    77947794        //Print("\n//  main routine takes %d steps and calls \"Mpwalk\" (1,%d):", nwalk,  tp_deg);
    7795        
     7795
    77967796        // compute the red. GB of <G> w.r.t. the lex order by the "recursive-modified" perturbation walk alg (1,tp_deg)
    77977797        G = Mpwalk_MAltwalk1(G, curr_weight, tp_deg);
  • Singular/walk.h

    re40145 ra9c298  
    2424intvec* Mivlp(int nR);
    2525
    26 intvec* MivMatrixOrder(intvec* iv); 
    27 intvec* MivMatrixOrderdp(int iv); 
    28 intvec* MPertVectors(ideal G, intvec* ivtarget, int pdeg); 
    29 intvec* MPertVectorslp(ideal G, intvec* ivtarget, int pdeg); 
     26intvec* MivMatrixOrder(intvec* iv);
     27intvec* MivMatrixOrderdp(int iv);
     28intvec* MPertVectors(ideal G, intvec* ivtarget, int pdeg);
     29intvec* MPertVectorslp(ideal G, intvec* ivtarget, int pdeg);
    3030
    3131
    3232intvec* MivMatrixOrderlp(int nV);
    3333
    34 intvec* Mfpertvector(ideal G, intvec* iv); 
     34intvec* Mfpertvector(ideal G, intvec* iv);
    3535intvec* MivUnit(int nV);
    3636
    37 intvec* MivWeightOrderlp(intvec* ivstart); 
    38 intvec* MivWeightOrderdp(intvec* ivstart); 
     37intvec* MivWeightOrderlp(intvec* ivstart);
     38intvec* MivWeightOrderdp(intvec* ivstart);
    3939
    40 ideal MidLift(ideal Gomega, ideal M); 
     40ideal MidLift(ideal Gomega, ideal M);
    4141ideal MLiftLmalG(ideal L, ideal G);
    42 ideal MLiftLmalGNew(ideal Gomega, ideal M, ideal G); 
    43 ideal MLiftLmalGMin(ideal L, ideal G); 
     42ideal MLiftLmalGNew(ideal Gomega, ideal M, ideal G);
     43ideal MLiftLmalGMin(ideal L, ideal G);
    4444
    4545
     
    5353/* Okt -- Nov'01 */
    5454// compute a Groebner basis of an ideal G w.r.t. lexicographic order
    55 ideal Mwalk(ideal G, intvec* curr_weight, intvec* target_weight); 
     55ideal Mwalk(ideal G, intvec* curr_weight, intvec* target_weight);
    5656
    5757// random walk algorithm to compute a Groebner basis
     
    5959
    6060/* the perturbation walk algorithm */
    61 ideal Mpwalk(ideal G,int op,int tp,intvec* curr_weight,intvec* target_weight, int nP); 
     61ideal Mpwalk(ideal G,int op,int tp,intvec* curr_weight,intvec* target_weight, int nP);
    6262
    6363/* The fractal walk algorithm */
     
    7575
    7676/* the first alternative algorithm */
    77 ideal MAltwalk1(ideal G,int op,int tp,intvec* curr_weight,intvec* target_weight); 
     77ideal MAltwalk1(ideal G,int op,int tp,intvec* curr_weight,intvec* target_weight);
    7878
    7979/* the second alternative algorithm */
    80 ideal MAltwalk2(ideal G, intvec* curr_weight, intvec* target_weight); 
     80ideal MAltwalk2(ideal G, intvec* curr_weight, intvec* target_weight);
    8181
    8282#endif  //WALK_H
  • kernel/F4.cc

    re40145 ra9c298  
    5656#endif
    5757  for(i=0;i<p_index;i++)
    58 { 
     58{
    5959    // Print("%i ter Eintrag:%s\n",i,pString(p[i]));
    6060  mac_poly m=NULL;
     
    7575    (*set_this)=new mac_poly_r();
    7676    (*set_this)->exp=v;
    77        
     77
    7878    (*set_this)->coef=nCopy(p_i->coef);
    7979    set_this=&(*set_this)->next;
     
    102102#endif
    103103  for(i=0;i<p_index;i++)
    104 { 
     104{
    105105    // Print("%i ter Eintrag:%s\n",i,pString(p[i]));
    106106  poly p_i=p[i];
     
    155155      continue;
    156156    }
    157    
     157
    158158    m[m_index]=pInit();
    159159    int v=mat->min_col_not_zero_in_row(i);
     
    164164    pSetExpV(m[m_index],ev);
    165165    omfree(ev);
    166    
     166
    167167    poly p=m[m_index];
    168168    pSetCoeff(p,mat->get(i,v));
     
    170170    {
    171171      poly pn=pInit();
    172      
     172
    173173      //v=done_index-1-pos; => pos=done_index-1-v=mat->get_columns()-1-v
    174174      pos=mat->get_columns()-1-v;
     
    203203  p2=((monom_poly*)ap2);
    204204  if(((unsigned long) p1->f)>((unsigned long) p2->f)) return 1;
    205   if(((unsigned long) p1->f)<((unsigned long)p2->f)) return -1; 
     205  if(((unsigned long) p1->f)<((unsigned long)p2->f)) return -1;
    206206
    207207  return pLmCmp(p1->m,p2->m);
    208  
     208
    209209}
    210210static int posInMonomPolys (monom_poly*  p, int pn, monom_poly & qe,slimgb_alg* c)
     
    251251  if ((h.f==F->mp[i].f) &&(p_LmDivisibleBy(F->mp[i].m,h.m,c->r)))
    252252  {
    253        
    254         //      Print("found");
    255        
    256           //according to the algorithm you should test (!(pIsConstant(F[i].m)))
    257           //but I think this is only because of bad formulation
     253
     254        //        Print("found");
     255
     256          //according to the algorithm you should test (!(pIsConstant(F[i].m)))
     257          //but I think this is only because of bad formulation
    258258    int j;
    259        
     259
    260260    poly lm=pLmInit(h.f);
    261261    pSetCoeff(lm,nInit(1));
     
    272272    assume(j!=-1);
    273273      //        if(j==-1) Print("\n jAltert \n");
    274 //      for(j=0;j<F_minus->size;j++)
    275 //      {
    276 //        if (pLmEqual(F_minus->p[j],lm))
    277 //          break;
    278 //      }
    279 //      assume(j<F_minus->size);
     274//         for(j=0;j<F_minus->size;j++)
     275//         {
     276//           if (pLmEqual(F_minus->p[j],lm))
     277//             break;
     278//         }
     279//         assume(j<F_minus->size);
    280280    pDelete(&lm);
    281281    if(j>=0)
     
    322322  while(chosen_index<max_par)
    323323  {
    324    
     324
    325325    //    sorted_pair_node* s=c->apairs[c->pair_top];
    326326    sorted_pair_node* s;
     
    341341    {
    342342      //replace_pair(s->i,s->j,c);
    343       if(s->i==s->j) 
     343      if(s->i==s->j)
    344344      {
    345345        free_sorted_pair_node(s,c->r);
     
    352352    if(s->i>=0)
    353353    {
    354      
     354
    355355      poly lcm=pOne();
    356      
     356
    357357      pLcm(c->S->m[s->i], c->S->m[s->j], lcm);
    358358      pSetm(lcm);
     
    371371      if(chosen_index+1>=chosen_size)
    372372      {
    373         //max_par must be greater equal 2
     373        //max_par must be greater equal 2
    374374        chosen_size+=si_max(max_par,2);
    375375        chosen=(monom_poly*) omrealloc(chosen,chosen_size*sizeof(monom_poly));
     
    395395      //must carefull remember to destroy such a h;
    396396      poly_list_node* next=c->to_destroy;
    397      
     397
    398398      c->to_destroy=(poly_list_node*) omalloc(sizeof(poly_list_node));
    399399      c->to_destroy->p=h.f;
     
    409409    else
    410410      omfree(s);
    411    
    412  
     411
     412
    413413
    414414  }
     
    426426    //Print(", %s \n", pString(chosen[i].f));
    427427  }
    428  
     428
    429429  //next Step remove duplicate entries
    430430  qsort(chosen,chosen_index,sizeof(monom_poly),monom_poly_crit);
     
    489489  //q=(poly*) omalloc(m_size*sizeof(poly));
    490490
    491  
     491
    492492
    493493  for(i=0;i<p_index;i++)
     
    520520{
    521521#ifdef TGB_DEBUG
    522      
     522
    523523      for(i=0;i<done_index;i++)
    524524{
     
    529529    qsort(m, m_index,sizeof(poly),pLmCmp_func);
    530530
    531    
     531
    532532    pos=0;
    533533#ifdef TGB_DEBUG
    534      
     534
    535535      for(i=0;i<done_index;i++)
    536536{
    537        
     537
    538538  pTest(done[i]);
    539539}
     
    593593    pTest(done[my_i]);
    594594}
    595 #endif     
     595#endif
    596596      if(((done_index>pos)&&(pLmEqual(m[i],done[pos]))) ||(pos>0) &&(pLmEqual(m[i],done[pos-1])))
    597         in_done=TRUE;
     597        in_done=TRUE;
    598598      if (!(in_done))
    599599{
    600        
     600
    601601  int S_pos=kFindDivisibleByInS_easy(c->strat,m[i], pGetShortExpVector(m[i]));
    602602  if(S_pos>=0)
     
    622622    pTest(done[my_i]);
    623623}
    624 #endif     
    625         memmove(&(done[pos+1]),&(done[pos]), (done_index-pos)*sizeof(poly));
    626         done[pos]=m[i];
     624#endif
     625        memmove(&(done[pos+1]),&(done[pos]), (done_index-pos)*sizeof(poly));
     626        done[pos]=m[i];
    627627 done_index++;
    628628#ifdef TGB_DEBUG
     
    631631  for (my_i=0;my_i<done_index;my_i++)
    632632  {
    633             //      Print("Position %i pos %i size %i\n",my_i,pos,done_index);
     633            //            Print("Position %i pos %i size %i\n",my_i,pos,done_index);
    634634    pTest(done[my_i]);
    635635  }
    636636}
    637 #endif     
     637#endif
    638638}
    639639      else
     
    718718#endif
    719719  assume(p_index==chosen_index);
    720  
     720
    721721 //  tgb_matrix* mat=build_matrix(p,p_index,done, done_index,c);
    722  
     722
    723723//   simple_gauss2(mat);
    724724  tgb_sparse_matrix* mat=build_sparse_matrix(p,p_index,done, done_index,c);
     
    727727  m=(poly*) omalloc(m_size*sizeof(poly));
    728728  m_index=retranslate(m,mat,done,c);
    729  
     729
    730730  mat=NULL;
    731731  for(i=0;i<done_index;i++)
     
    733733  omfree(done);
    734734  done=NULL;
    735   //next Step addElements to basis 
     735  //next Step addElements to basis
    736736  int F_plus_size=m_index;
    737737  poly* F_plus=(poly*)omalloc(F_plus_size*sizeof(poly));
     
    752752  if(((p_index>pos)&&(pLmEqual(m[i],p[pos]))) ||(pos>0) &&(pLmEqual(m[i],p[pos-1])))
    753753    minus=TRUE;
    754    
     754
    755755  if(minus)
    756756  {
     
    772772//       if (pLmEqual(p[j],m[i]))
    773773//       {
    774 //      minus=TRUE;
    775 //      break;
     774//         minus=TRUE;
     775//         break;
    776776//       }
    777777//     if(minus)
     
    793793  if (TEST_OPT_PROT)
    794794    Print("%i]", F_plus_index);
    795   for(i=0;i<p_index;i++) 
     795  for(i=0;i<p_index;i++)
    796796    pDelete(&p[i]);
    797797  omfree(p);
     
    824824  (*F_i)->mp=chosen;
    825825  (*F_i)->next=NULL;
    826  
     826
    827827  if(F_plus_index>0)
    828828{
     
    830830  int* ibuf=(int*) omalloc(F_plus_index*sizeof(int));
    831831  sorted_pair_node*** sbuf=(sorted_pair_node***) omalloc(F_plus_index*sizeof(sorted_pair_node**));
    832  
     832
    833833  for(j=0;j<F_plus_index;j++)
    834834  {
    835835    int len;
    836836    poly p=F_plus[j];
    837    
     837
    838838    // delete buf[j];
    839839    //remember to free res here
    840840    //    p=redTailShort(p, c->strat);
    841841    sbuf[j]=add_to_basis_ideal_quotient(p,c,ibuf+j);
    842    
     842
    843843  }
    844844  int sum=0;
  • kernel/F4.h

    re40145 ra9c298  
    22// C++ Interface: F4
    33//
    4 // Description: 
     4// Description:
    55//
    66//
  • kernel/IIntvec.h

    re40145 ra9c298  
    55class Intvec: public std::vector<int>{
    66public:
    7   Intvec(iterator first, 
     7  Intvec(iterator first,
    88        iterator last,
    99        const allocator_type& __a = allocator_type()):
     
    2020    int s=size();
    2121    intvec* iv=new intvec(s);
    22    
     22
    2323    for(int i=0;i<s;i++){
    2424      (*iv)[i]=(*this)[i];
  • kernel/f5c.h

    re40145 ra9c298  
    88/*!
    99 * main function of the F5C implementation in SINGULAR
    10  * 
     10 *
    1111 * INPUT:   Ideal i for which a gröbner basis should be computed;
    1212 *          ring r.
  • kernel/f5data.cc

    re40145 ra9c298  
    44****************************************/
    55/*
    6 * ABSTRACT: lpolynomial definition 
     6* ABSTRACT: lpolynomial definition
    77*/
    88#ifdef HAVE_CONFIG_H
     
    3030/*
    3131=====================
    32 everything is inlined 
     32everything is inlined
    3333=====================
    3434*/
  • kernel/f5data.h

    re40145 ra9c298  
    232232class RuleOld {
    233233    private:
    234         int     index;      // index of the labeled polynomial the RuleOld comes from 
     234        int     index;      // index of the labeled polynomial the RuleOld comes from
    235235        poly    term;       // term of the labeled polynomial the RuleOld comes from
    236236    public:
  • kernel/f5gb.cc

    re40145 ra9c298  
    4747/*
    4848====================================================================
    49 sorting ideals by decreasing total degree "left" and "right" are the 
     49sorting ideals by decreasing total degree "left" and "right" are the
    5050pointer of the first and last polynomial in the considered ideal
    5151====================================================================
     
    5959            while(pTotaldegree(*ptr1, currRing) < pTotaldegree(p2, currRing)) {
    6060                    ptr1++;
    61             } 
     61            }
    6262            while(pTotaldegree(*ptr2, currRing) > pTotaldegree(p2,currRing)) {
    6363                    ptr2--;
     
    111111                    return true;
    112112                }
    113             }   
     113            }
    114114        }
    115115    }
     
    119119/*
    120120==================================================
    121 computes incrementally gbs of subsets of the input 
     121computes incrementally gbs of subsets of the input
    122122gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1}
    123123==================================================
    124124*/
    125125LList* F5inc(int i, poly f_i, LList* gPrev, LList* reducers, ideal gbPrev, poly ONE, LTagList* lTag, RList* rules, RTagList* rTag, int plus, int termination) {
    126     //Print("in f5inc\n");           
     126    //Print("in f5inc\n");
    127127    //pWrite(rules->getFirst()->getRuleTerm());
    128128    int iterationstep = i;
     
    140140    //Print("2nd gPrev: ");
    141141    //pWrite(gPrev->getFirst()->getNext()->getPoly());
    142     //pWrite(gPrev->getFirst()->getNext()->getPoly());   
     142    //pWrite(gPrev->getFirst()->getNext()->getPoly());
    143143    CListOld* critPairs        =   new CListOld();
    144     CNode* critPairsMinDeg  =   new CNode();   
     144    CNode* critPairsMinDeg  =   new CNode();
    145145    PList* rejectedGBList = new PList();
    146146    // computation of critical pairs with checking of criterion 1 and criterion 2 and saving them
     
    154154    static LList* reducedLPolys     =   new LList();
    155155    // while there are critical pairs to be further checked and deleted/computed
    156     while(NULL != critPairs->getFirst()) { 
     156    while(NULL != critPairs->getFirst()) {
    157157        // critPairs->getMinDeg() deletes the first elements of minimal degree from
    158158        // critPairs, thus the while loop is not infinite.
    159         // adds all to be reduced S-polynomials in the list sPolyList and adds 
     159        // adds all to be reduced S-polynomials in the list sPolyList and adds
    160160        // the corresponding rules to the list rules
    161         // NOTE: inside there is a second check of criterion 2 if new rules are 
     161        // NOTE: inside there is a second check of criterion 2 if new rules are
    162162        // added
    163163        //int timer4  =   initTimer();
     
    180180            //Print("number of useful pairs:  %d\n",numberUsefulPairs);
    181181            //Print("number of useless pairs: %d\n\n",numberUselessPairs);
    182           //Print("Degree of following reduction: %d\n",critPairsMinDeg->getData()->getDeg()); 
    183         long degreecheck = critPairsMinDeg->getData()->getDeg(); 
    184        
     182          //Print("Degree of following reduction: %d\n",critPairsMinDeg->getData()->getDeg());
     183        long degreecheck = critPairsMinDeg->getData()->getDeg();
     184
    185185          computeSPols(critPairsMinDeg,rTag,rules,sPolyList, rejectedGBList);
    186186        //}
     
    216216        //  return gPrev;
    217217        //}
    218         //Print("ARRIS DEG: %ld\n",arrideg); 
     218        //Print("ARRIS DEG: %ld\n",arrideg);
    219219        // Arris idea stated by John in an email
    220220        //if(arrisCheck(critPairs->getFirst(),gPrev->getFirst(),arrideg)) {
     
    222222        //  return gPrev;
    223223        //}
    224        
    225        
    226         //bool aha = checkDGB(gPrev); 
    227        
     224
     225
     226        //bool aha = checkDGB(gPrev);
     227
    228228
    229229        //timer3      =  getTimer();
    230230        //reductionTime = reductionTime + timer3;
    231         //Print("REDUCTION TIMER: %d\n",timer3); 
     231        //Print("REDUCTION TIMER: %d\n",timer3);
    232232        // DEBUG STUFF FOR GPREV
    233233        //temp    =   gPrev->getFirst();
     
    242242        //}
    243243        //sleep(5);
    244    
     244
    245245    }
    246246    //Print("REDUCTION DONE\n");
     
    333333            ppMult_qq(u2,temp2->getPoly()));
    334334        pNorm(sp);
    335      
     335
    336336        poly reducer  = pOne();
    337337        //reducer       = gb->m[0];
    338338        int i         = 0;
    339339        pWrite(pHead(sp));
    340        
     340
    341341        while(i<IDELEMS(gb)) {
    342342          reducer = gb->m[i];
     
    356356          }
    357357        }
    358        
     358
    359359        pWrite(pHead(sp));
    360360      }
     
    371371 * Checks all remaining critical pairs, i.e. those of higher degree,
    372372 * by the two Buchberger criteria.
    373  * return value: 0, if all remaining critical pairs are deleted by 
     373 * return value: 0, if all remaining critical pairs are deleted by
    374374 *                  Buchberger's criteria
    375375 *               1, otherwise
     
    377377bool arrisCheck(CNode* first, LNode* firstGCurr, long arrideg) {
    378378  CNode* temp = first;
    379  
     379
    380380  //product criterion check
    381381  while(NULL != temp) {
     
    422422}
    423423
    424  
    425  
     424
     425
    426426/*
    427427================================================================
    428428computes a list of critical pairs for the next reduction process
    429 the first element is always "useful" thus the critical pair 
    430 computed is either "useful" or "useless" depending on the second 
     429the first element is always "useful" thus the critical pair
     430computed is either "useful" or "useless" depending on the second
    431431element which generates the critical pair.
    432432first element in gPrev is always the newest element which must
     
    466466        u2 = pDivide(lcm,pHead(temp->getPoly()));
    467467        pSetCoeff(u2,nOne);
    468         int degree = pDeg(ppMult_qq(u2,pHead(temp->getPoly()))); 
     468        int degree = pDeg(ppMult_qq(u2,pHead(temp->getPoly())));
    469469        // testing both new labels by the F5 Criterion
    470470        if(!temp->getDel()) {
     
    473473          }
    474474          if(!criterion2(gPrev->getFirst()->getIndex(), u2, temp, rules, rTag)
    475             && !criterion2(gPrev->getFirst()->getIndex(), u1, newElement, rules, rTag) 
     475            && !criterion2(gPrev->getFirst()->getIndex(), u1, newElement, rules, rTag)
    476476            && !criterion1(gPrev,u1,newElement,lTag) && !criterion1(gPrev,u2,temp,lTag)) {
    477477              // if they pass the test, add them to CListOld critPairs, having the LPolyOld with greater
    478478              // label as first element in the CPairOld
    479               if(newElement->getIndex() == temp->getIndex() && 
     479              if(newElement->getIndex() == temp->getIndex() &&
    480480              -1 == pLmCmp(ppMult_qq(u1, newElement->getTerm()),ppMult_qq(u2, temp->getTerm()))) {
    481                   CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2, 
    482                                   temp->getLPolyOld(), u1, newElement->getLPolyOld(), 0 , testedRuleOld);                   
     481                  CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2,
     482                                  temp->getLPolyOld(), u1, newElement->getLPolyOld(), 0 , testedRuleOld);
    483483                  critPairs->insert(cp);
    484484                  // counting the number of useful pairs
     
    486486              }
    487487              else {
    488                   CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1, 
    489                                   newElement->getLPolyOld(), u2, temp->getLPolyOld(), 0, testedRuleOld);                   
     488                  CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1,
     489                                  newElement->getLPolyOld(), u2, temp->getLPolyOld(), 0, testedRuleOld);
    490490                  critPairs->insert(cp);
    491491                  // counting the number of useful pairs
     
    511511          //if(rejectedGBList->check(lcm)) { // if there is equality of lcms then we need the F5 critical pair
    512512            if(!criterion2(gPrev->getFirst()->getIndex(), u2, temp, rules, rTag)
    513               && !criterion2(gPrev->getFirst()->getIndex(), u1, newElement, rules, rTag) 
     513              && !criterion2(gPrev->getFirst()->getIndex(), u1, newElement, rules, rTag)
    514514              && !criterion1(gPrev,u1,newElement,lTag) && !criterion1(gPrev,u2,temp,lTag)) {
    515515                // if they pass the test, add them to CListOld critPairs, having the LPolyOld with greater
    516516                // label as first element in the CPairOld
    517                 if(newElement->getIndex() == temp->getIndex() && 
     517                if(newElement->getIndex() == temp->getIndex() &&
    518518                -1 == pLmCmp(ppMult_qq(u1, newElement->getTerm()),ppMult_qq(u2, temp->getTerm()))) {
    519                     CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2, 
    520                                     temp->getLPolyOld(), u1, newElement->getLPolyOld(), 1 , testedRuleOld);                   
     519                    CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2,
     520                                    temp->getLPolyOld(), u1, newElement->getLPolyOld(), 1 , testedRuleOld);
    521521                    critPairs->insert(cp);
    522522                    numberUselessPairs++;
    523523                }
    524524                else {
    525                     CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1, 
    526                                     newElement->getLPolyOld(), u2, temp->getLPolyOld(), 1, testedRuleOld);                   
     525                    CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1,
     526                                    newElement->getLPolyOld(), u2, temp->getLPolyOld(), 1, testedRuleOld);
    527527                    critPairs->insert(cp);
    528528                    numberUselessPairs++;
     
    540540================================================================
    541541computes a list of critical pairs for the next reduction process
    542 the first element is always "useless" thus the critical pair 
     542the first element is always "useless" thus the critical pair
    543543computed is "useless".
    544544first element in gPrev is always the newest element which must
     
    577577        //if(rejectedGBList->check(lcm)) { // if there is equality of lcms then we need the F5 critical pair
    578578          if(!criterion2(gPrev->getFirst()->getIndex(), u2, temp, rules, rTag)
    579             && !criterion2(gPrev->getFirst()->getIndex(), u1, newElement, rules, rTag) 
     579            && !criterion2(gPrev->getFirst()->getIndex(), u1, newElement, rules, rTag)
    580580            && !criterion1(gPrev,u1,newElement,lTag) && !criterion1(gPrev,u2,temp,lTag)) {
    581581              // if they pass the test, add them to CListOld critPairs, having the LPolyOld with greater
    582582              // label as first element in the CPairOld
    583               if(newElement->getIndex() == temp->getIndex() && 
     583              if(newElement->getIndex() == temp->getIndex() &&
    584584              -1 == pLmCmp(ppMult_qq(u1, newElement->getTerm()),ppMult_qq(u2, temp->getTerm()))) {
    585                   CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2, 
    586                                   temp->getLPolyOld(), u1, newElement->getLPolyOld(), 1 , testedRuleOld);                   
     585                  CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u2,
     586                                  temp->getLPolyOld(), u1, newElement->getLPolyOld(), 1 , testedRuleOld);
    587587                  critPairs->insert(cp);
    588588                  numberUselessPairs++;
    589589              }
    590590              else {
    591                   CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1, 
    592                                   newElement->getLPolyOld(), u2, temp->getLPolyOld(), 1, testedRuleOld);                   
     591                  CPairOld* cp   =   new CPairOld(pDeg(ppMult_qq(u2,pHead(temp->getPoly()))), u1,
     592                                  newElement->getLPolyOld(), u2, temp->getLPolyOld(), 1, testedRuleOld);
    593593                  critPairs->insert(cp);
    594594                  numberUselessPairs++;
    595595              }
    596596          }
    597         //} 
     597        //}
    598598        temp    =   temp->getNext();
    599599    }
     
    609609inline bool criterion1(LList* gPrev, poly t, LNode* l, LTagList* lTag) {
    610610    // starts at the first element in gPrev with index = (index of l)-1, these tags are saved in lTag
    611         int idx =   l->getIndex();
     611    int idx =   l->getIndex();
    612612    int i;
    613613    if(idx == 1) {
     
    670670inline bool criterion2(int idx, poly t, LNode* l, RList* rules, RTagList* rTag) {
    671671    //Print("------------------------------IN CRITERION 2/1-----------------------------------------\n");
    672     /* 
     672    /*
    673673    Print("RULES: \n");
    674674        RNode* tempR    =   rules->getFirst();
     
    694694        return false;
    695695    }
    696    
     696
    697697    RNode* testNode; // =   new RNode();
    698698    testNode    =   rules->getFirst();
     
    706706        }
    707707    }
    708    
     708
    709709     else {
    710710
     
    713713        }
    714714        else {
    715        //Print("HIER\n"); 
     715       //Print("HIER\n");
    716716            //Print("DEBUG\n");
    717717        //Print("L INDEX: %d\n",l->getIndex());
     
    731731    */
    732732    //testNode    =   rules->getFirst();
    733         // save the monom t1*label_term(l) as it is tested various times in the following
     733    // save the monom t1*label_term(l) as it is tested various times in the following
    734734    poly u1 = ppMult_qq(t,l->getTerm());
    735735    // first element added to rTag was NULL, check for this
     
    738738    //Print("TESTNODE: %p\n",testNode);
    739739    //pWrite(testNode->getRuleTerm());
    740     if(NULL != testNode ) {   
     740    if(NULL != testNode ) {
    741741        //pWrite(testNode->getRuleTerm());
    742742    }
     
    750750        }
    751751    }
    752     while(NULL != testNode && testNode->getRuleOld() != l->getRuleOld() 
     752    while(NULL != testNode && testNode->getRuleOld() != l->getRuleOld()
    753753          && l->getIndex() == testNode->getRuleOldIndex()) {
    754754        //Print("%p\n",testNode);
     
    765765            return true;
    766766        }
    767                 testNode    =   testNode->getNext();
     767        testNode    =   testNode->getNext();
    768768    }
    769769    //delete testNode;
     
    798798    */
    799799// start at the previously added element to gPrev, as all other elements will have the same index for sure
    800         RNode* testNode =   rules->getFirst();
     800        RNode* testNode =   rules->getFirst();
    801801    // save the monom t1*label_term(l) as it is tested various times in the following
    802802    poly u1 = ppMult_qq(t,l->getTerm());
    803         // first element added to rTag was NULL, check for this
    804         while(NULL != testNode && testNode->getRuleOld() != testedRuleOld) {
     803        // first element added to rTag was NULL, check for this
     804        while(NULL != testNode && testNode->getRuleOld() != testedRuleOld) {
    805805        //pWrite(testNode->getRuleTerm());
    806806        if(pLmDivisibleByNoComp(testNode->getRuleOldTerm(),u1)) {
     
    811811            return true;
    812812        }
    813                 testNode    =   testNode->getNext();
     813                testNode    =   testNode->getNext();
    814814    }
    815815    pDelete(&u1);
     
    837837==================================
    838838*/
    839 void computeSPols(CNode* first, RTagList* rTag, RList* rules, LList* sPolyList, PList* rejectedGBList) { 
     839void computeSPols(CNode* first, RTagList* rTag, RList* rules, LList* sPolyList, PList* rejectedGBList) {
    840840    CNode* temp         =   first;
    841841    //Print("\nDegree:  %d\n",temp->getData()->getDeg());
     
    850850    CListOld* f5pairs = new CListOld();
    851851    poly sp     =   pInit();
    852     number sign =   nInit(-1);   
     852    number sign =   nInit(-1);
    853853    //Print("###############################IN SPOLS##############################\n");
    854854    //first->print();
     
    898898            }
    899899            rejectedGBList->insert(pHead(ppMult_qq(temp->getT1(),temp->getLp1Poly())));
    900             //Print("rejected!\n"); 
     900            //Print("rejected!\n");
    901901
    902902            //Print("CRITERION 2 in SPOLS 2nd generator\n");
    903903          }
    904904        }
    905         else { 
     905        else {
    906906          sp      =   ksOldSpolyRedNew(ppMult_qq(temp->getT1(),temp->getLp1Poly()),
    907907              ppMult_qq(temp->getT2(),temp->getLp2Poly()));
     
    925925        }
    926926      }
    927       /*     
     927      /*
    928928      if(temp->getDel() == 0 && criterion2(temp->getT1(),temp->getAdLp1(),rules,temp->getTestedRuleOld())) {
    929         //Print("rejected!\n"); 
     929        //Print("rejected!\n");
    930930        rejectedGBList->insert(pHead(ppMult_qq(temp->getT1(),temp->getLp1Poly())));
    931931      }
    932      
    933        
     932
     933
    934934      if(temp->getDel() == 1 && !criterion2(temp->getT1(),temp->getAdLp1(),rules,temp->getTestedRuleOld())) {
    935         if(highestDegree < pDeg(ppMult_qq(temp->getT1(),temp->getLp1Poly()))) { 
     935        if(highestDegree < pDeg(ppMult_qq(temp->getT1(),temp->getLp1Poly()))) {
    936936          highestDegree   = pDeg(ppMult_qq(temp->getT1(),temp->getLp1Poly()));
    937         }   
     937        }
    938938        if(temp->getLp2Index() == temp->getLp1Index()) {
    939939          if(!criterion2(temp->getT2(),temp->getAdLp2(),rules,temp->getTestedRuleOld())) {
     
    956956
    957957              f5rules->insert(rules->getFirst()->getRuleOld());
    958               f5pairs->insertWithoutSort(temp->getData());       
     958              f5pairs->insertWithoutSort(temp->getData());
    959959              ///////////////////////////////////////
    960960
     
    963963          }
    964964        }
    965         else { 
     965        else {
    966966          sp      =   ksOldSpolyRedNew(ppMult_qq(temp->getT1(),temp->getLp1Poly()),
    967967              ppMult_qq(temp->getT2(),temp->getLp2Poly()));
     
    983983
    984984            f5rules->insert(rules->getFirst()->getRuleOld());
    985             f5pairs->insertWithoutSort(temp->getData());       
     985            f5pairs->insertWithoutSort(temp->getData());
    986986            ///////////////////////////////////////
    987987            //sPolyList->insertByLabel(ppMult_qq(temp->getT1(),temp->getLp1Term()),temp->getLp1Index(),sp,rules->getFirst()->getRuleOld());
     
    10041004
    10051005      }
    1006      
    1007       /* 
     1006
     1007      /*
    10081008      temp = f5pairs->getFirst();
    10091009      RNode* tempRule = f5rules->getFirst();
     
    10261026          numberRejectedF5CriticalPairs++;
    10271027              howmany++;
    1028           if(numberRejectedF5CriticalPairs < -1) { // || 
     1028          if(numberRejectedF5CriticalPairs < -1) { // ||
    10291029          }
    10301030          else {
     
    10501050            //if(temp->getLp1Index() < 7) {
    10511051              sPolyList->insertByLabel(ppMult_qq(temp->getT1(),temp->getLp1Term()),temp->getLp1Index(),sp,tempRule->getRuleOld());
    1052            
     1052
    10531053            //}
    10541054          //numberOfSpolys++;
    10551055          }
    1056         //pSetExp(tempRule->getRuleOld()->getTerm(),1,1000); 
     1056        //pSetExp(tempRule->getRuleOld()->getTerm(),1,1000);
    10571057        }
    10581058        temp      = temp->getNext();
     
    10601060
    10611061      }
    1062       */ 
    1063       // these critical pairs can be deleted now as they are either useless for further computations or 
     1062      */
     1063      // these critical pairs can be deleted now as they are either useless for further computations or
    10641064      // already saved as an S-polynomial to be reduced in the following
    1065       delete first;   
     1065      delete first;
    10661066//Print("NUMBER SPOLYS: %d\n", numberOfSpolys);
    10671067//Print("SPOLY LIST: \n");
     
    10821082========================================================================
    10831083*/
    1084 void reduction(LList* sPolyList, CListOld* critPairs, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag, 
    1085                  ideal gbPrev, PList* rejectedGBList, int plus) { 
     1084void reduction(LList* sPolyList, CListOld* critPairs, LList* gPrev, RList* rules, LTagList* lTag, RTagList* rTag,
     1085                 ideal gbPrev, PList* rejectedGBList, int plus) {
    10861086    //Print("##########################################In REDUCTION!########################################\n");
    10871087    // check if sPolyList has any elements
     
    10901090    while(NULL != temp) {
    10911091        // temp is the first element in the sPolyList which should be reduced
    1092         // due to earlier sorting this is the element of minimal degree AND 
     1092        // due to earlier sorting this is the element of minimal degree AND
    10931093        // minimal label
    10941094        // delete the above first element from sPolyList, temp will be either reduced to
     
    11031103            temp->setPoly(tempNF);
    11041104            // try further reductions of temp with polynomials in gPrev
    1105             // with label index = current label index: this is done such that there 
     1105            // with label index = current label index: this is done such that there
    11061106            // is no label corruption during the reduction process
    11071107            //Print("lower label reduction:  ");
    11081108            //pWrite(tempNF);
    11091109            topReduction(temp,sPolyList,gPrev,critPairs,rules,lTag,rTag,gbPrev, rejectedGBList,plus);
    1110        
     1110
    11111111        }
    11121112        else {
     
    11211121    //sPolyList->print();
    11221122    //delete sPolyList;
    1123 }   
     1123}
    11241124
    11251125/*
     
    11281128========================================================================
    11291129*/
    1130 void newReduction(LList* sPolyList, CListOld* critPairs, LList* gPrev, LList* reducers, RList* rules, LTagList* lTag, RTagList* rTag, 
    1131                  ideal gbPrev, int termination, PList* rejectedGBList, int plus) { 
     1130void newReduction(LList* sPolyList, CListOld* critPairs, LList* gPrev, LList* reducers, RList* rules, LTagList* lTag, RTagList* rTag,
     1131                 ideal gbPrev, int termination, PList* rejectedGBList, int plus) {
    11321132    //Print("##########################################In REDUCTION!########################################\n");
    11331133    // check if sPolyList has any elements
     
    11391139        numberOfReductions++;
    11401140        // temp is the first element in the sPolyList which should be reduced
    1141         // due to earlier sorting this is the element of minimal degree AND 
     1141        // due to earlier sorting this is the element of minimal degree AND
    11421142        // minimal label
    11431143        // delete the above first element from sPolyList, temp will be either reduced to
     
    11591159            //pWrite(tempNF);
    11601160            // try further reductions of temp with polynomials in gPrev
    1161             // with label index = current label index: this is done such that there 
     1161            // with label index = current label index: this is done such that there
    11621162            // is no label corruption during the reduction process
    1163             findReducers(temp,sPolyList,gbPrev,gPrev,reducers,critPairs,rules,lTag,rTag, termination, rejectedGBList,plus); 
     1163            findReducers(temp,sPolyList,gbPrev,gPrev,reducers,critPairs,rules,lTag,rTag, termination, rejectedGBList,plus);
    11641164        //}
    11651165        //else {
     
    11801180    //delete sPolyList;
    11811181    //Print("REDUCTION FERTIG\n");
    1182 }     
     1182}
    11831183
    11841184
    11851185/*!
    11861186 * ================================================================================
    1187  * searches for reducers of temp similar to the symbolic preprocessing of F4  and 
     1187 * searches for reducers of temp similar to the symbolic preprocessing of F4  and
    11881188 * divides them into a "good" and "bad" part:
    1189  * 
     1189 *
    11901190 * the "good" ones are the reducers which do not corrupt the label of temp, with
    11911191 * these the normal form of temp is computed
    11921192 *
    1193  * the "bad" ones are the reducers which corrupt the label of temp, they are tested 
     1193 * the "bad" ones are the reducers which corrupt the label of temp, they are tested
    11941194 * later on for possible new rules and S-polynomials to be added to the algorithm
    11951195 * ================================================================================
     
    12591259                                        break;
    12601260                                    }
    1261                              }   
    1262                    
     1261                             }
     1262
    12631263                    }
    12641264                    else {
     
    12671267                                      //pWrite(u);
    12681268                                      //pWrite(tempRed->getTerm());
    1269                                       //pWrite(pHead(tempRed->getPoly())); 
     1269                                      //pWrite(pHead(tempRed->getPoly()));
    12701270                                      addToG  = 0;
    12711271                        }
     
    13121312                                        }
    13131313                                    }
    1314                                 }   
     1314                                }
    13151315                            }
    13161316                            else {
    13171317                              //Print("CRIT 1  ");
    1318                                    
     1318
    13191319                                      if(pLmCmp(ppMult_qq(u,tempRed->getTerm()),l->getTerm()) == 1 ) {
    13201320                                      //Print("NOT ALLOWED REDUCER, CRIT 1:\n");
     
    13691369                            break;
    13701370                        }
    1371                      
     1371
    13721372                    }
    13731373                }
     
    13811381                //Print("TEMPREDPOLY:  ");
    13821382                //pWrite(tempRed->getPoly());
    1383               //pWrite(tempPoly); 
     1383              //pWrite(tempPoly);
    13841384              if(pLmDivisibleByNoComp(tempRed->getPoly(),tempPoly)) {
    13851385                    //Print("A\n");
     
    14121412                                        break;
    14131413                                    }
    1414                              }   
    1415                    
     1414                             }
     1415
    14161416                    }
    14171417                    else {
     
    14201420                                      //pWrite(u);
    14211421                                      //pWrite(tempRed->getTerm());
    1422                                       //pWrite(pHead(tempRed->getPoly())); 
     1422                                      //pWrite(pHead(tempRed->getPoly()));
    14231423                                      //addToG  = 0;
    14241424                        }
     
    14651465                                        }
    14661466                                    }
    1467                                 }   
     1467                                }
    14681468                            }
    14691469                            else {
    14701470                              //Print("CRIT 1  ");
    1471                                    
     1471
    14721472                                      if(pLmCmp(ppMult_qq(u,tempRed->getTerm()),l->getTerm()) == 1 ) {
    14731473                                      //Print("NOT ALLOWED REDUCER, CRIT 1:\n");
     
    14981498                        }
    14991499                    }
    1500                    
     1500
    15011501                }
    15021502                tempRed =   tempRed->getNext();
     
    15151515               // end for top-reduction only
    15161516               tempPoly    =   kBucketGetLm(bucket);
    1517                
     1517
    15181518            }
    15191519        }
     
    15251525            Print("\nELEMENT ADDED TO GPREV: ");
    15261526            pNorm(redPoly);
    1527               if(highestDegree < pDeg(redPoly)) { 
     1527              if(highestDegree < pDeg(redPoly)) {
    15281528                  highestDegree   = pDeg(redPoly);
    1529               }   
     1529              }
    15301530            pWrite(pHead(redPoly));
    15311531            //pWrite(l->getTerm());
     
    15671567            }
    15681568        }
    1569    
     1569
    15701570    // if there are "bad" reducers than try to compute new S-polynomials and rules
    1571    
     1571
    15721572    if(NULL != bad->getFirst()) {
    15731573        //Print("BAD STUFF LIST:\n");
     
    16081608                                //tempRed->getLPoly()->setRule(rules->getFirst()->getRule());
    16091609                                tempBadNew->setDel(1);
    1610                            
     1610
    16111611                                sPolyList->insertByLabel(tempBadNew);
    16121612                                //Print("BAD SPOLYLIST: \n");
     
    16251625        //Print("HIER AUCH\n");
    16261626        //Print("SPOLYLIST IN BAD: \n");
    1627         //sPolyList->print(); 
     1627        //sPolyList->print();
    16281628    //Print("END FIND REDUCERS\n");
    16291629}
     
    17131713            // if label of reductor is greater than the label of l we have to built a new element
    17141714            // and add it to sPolyList
    1715            
     1715
    17161716            if(pLmCmp(tempRed->getTerm(),l->getTerm()) == 1) {
    17171717                // needed sinc pSub destroys the arguments!
     
    17431743                }
    17441744            }
    1745            
    1746             // label of reductor is smaller than the label of l, subtract reductor from l and delete the 
    1747             // gPrevRedCheck pointer added to l during findReductor() as the head term of l changes 
    1748             // after subtraction 
     1745
     1746            // label of reductor is smaller than the label of l, subtract reductor from l and delete the
     1747            // gPrevRedCheck pointer added to l during findReductor() as the head term of l changes
     1748            // after subtraction
    17491749            else {
    1750                
     1750
    17511751                //poly temp_poly_l    =   pInit();
    17521752                //temp_poly_l         =   pCopy(l->getPoly());
     
    17601760                    pNorm(temp);
    17611761                    //pWrite(temp);
    1762                     poly tempNF =   kNF(gbPrev,currQuotient,temp); 
     1762                    poly tempNF =   kNF(gbPrev,currQuotient,temp);
    17631763                    pNorm(tempNF);
    17641764                    if(NULL == tempNF) {
     
    17691769                    }
    17701770                    l->setPoly(tempNF);
    1771                    
     1771
    17721772                    gPrevRedCheck   =   lTag->getFirstCurrentIdx();
    17731773                }
     
    17781778                    break;
    17791779                }
    1780             }   
     1780            }
    17811781        }
    17821782        else {
     
    18161816    poly t      =   pHead(l->getPoly());
    18171817    // if l was already checked use the information in gPrevRedCheck such
    1818     // that we can start searching for new reducers from this point and 
     1818    // that we can start searching for new reducers from this point and
    18191819    // not from the first element of gPrev with the current index
    18201820    temp    =   gPrevRedCheck;
     
    18671867        temp = temp->getNext();
    18681868    }
    1869    
     1869
    18701870//    delete temp;
    18711871 return NULL;
     
    18811881*/
    18821882ideal F5main(ideal id, ring r, int opt, int plus, int termination) {
    1883   switch(opt) { 
     1883  switch(opt) {
    18841884    case 0:
    18851885      Print("\nComputations are done by the standard F5 Algorithm");
     
    18951895      return id;
    18961896  }
    1897  
     1897
    18981898    int timer   =   initTimer();
    18991899    startTimer();
     
    19041904    poly pOne   =   pOne();
    19051905    number nOne =   nInit(1);
    1906     // tag the first element of index i-1 for criterion 1 
     1906    // tag the first element of index i-1 for criterion 1
    19071907    //Print("LTAG BEGINNING: %p\n",lTag);
    1908    
     1908
    19091909    // DEBUGGING STUFF START
    19101910    //Print("NUMBER: %d\n",r->N);
    1911     /* 
     1911    /*
    19121912    int* ev = new int[r->N +1];
    19131913    for(i=0;i<IDELEMS(id);i++) {
     
    19231923    */
    19241924    /*DEBUGGING STUFF END */
    1925    
    1926     // first element in rTag is first element of rules which is NULL RNode, 
     1925
     1926    // first element in rTag is first element of rules which is NULL RNode,
    19271927    // this must be done due to possible later improvements
    19281928    RList* rules    =   new RList();
     
    19331933    i = 1;
    19341934    /*for(j=0; j<IDELEMS(id); j++) {
    1935         if(NULL != id->m[j]) { 
     1935        if(NULL != id->m[j]) {
    19361936            if(pComparePolys(id->m[j],ONE)) {
    19371937                Print("One Polynomial in Input => Computations stopped\n");
     
    19391939                idNew->m[0] = ONE;
    19401940                return(idNew);
    1941             }   
    1942         }
    1943     }*/ 
    1944     ideal idNew     =   kInterRed(id); 
     1941            }
     1942        }
     1943    }*/
     1944    ideal idNew     =   kInterRed(id);
    19451945    id              =   idNew;
    19461946    //qsortDegree(&id->m[0],&id->m[IDELEMS(id)-1]);
     
    19481948    LList* gPrev    =   new LList(ONE, i, id->m[0]);
    19491949    LList* reducers =   new LList();
    1950     //idShow(id); 
     1950    //idShow(id);
    19511951    //Print("%p\n",id->m[0]);
    19521952    //pWrite(id->m[0]);
     
    19681968        LNode* gPrevTag =   gPrev->getLast();
    19691969        //Print("Last POlynomial in GPREV: ");
    1970         //Print("%p\n",gPrevTag);   
     1970        //Print("%p\n",gPrevTag);
    19711971        //pWrite(gPrevTag->getPoly());
    19721972        Print("Iteration: %d\n\n",i);
     
    19751975        //Print("%d\n",gPrev->getLength());
    19761976        //Print("____________________________________ITERATION STEP DONE________________________________________\n");
    1977        
     1977
    19781978        // DEBUGGING STUFF
    19791979        LNode* temp    =   gPrev->getFirst();
    1980    
     1980
    19811981
    19821982        /////////////////////////////////////////////////////////////////////////////////
    1983         //                                                                             // 
     1983        //                                                                             //
    19841984        // one needs to choose one of the following 3 implementations of the algorithm //
    1985         // F5,F5R or F5C                                                               // 
     1985        // F5,F5R or F5C                                                               //
    19861986        //                                                                             //
    1987         /////////////////////////////////////////////////////////////////////////////////                                                                           
    1988        
    1989        
    1990         //   
     1987        /////////////////////////////////////////////////////////////////////////////////
     1988
     1989
     1990        //
    19911991        // standard "F5"
    19921992        //
    1993         if(0 == opt) { 
     1993        if(0 == opt) {
    19941994          if(gPrev->getLength() > gbLength) {
    19951995            if(i < IDELEMS(id)) {
     
    20222022        gbLength    =   gPrev->getLength();
    20232023        }
    2024        
    2025 
    2026         // 
     2024
     2025
     2026        //
    20272027        //  "F5R"
    20282028        //
     
    20602060        gbLength    =   gPrev->getLength();
    20612061        }
    2062        
    2063 
    2064         // 
     2062
     2063
     2064        //
    20652065        // "F5C"
    20662066        //
    2067         if(2 == opt) { 
     2067        if(2 == opt) {
    20682068        if(gPrev->getLength() > gbLength) {
    20692069            if(i < IDELEMS(id)) {
     
    21032103                }
    21042104            }
    2105             gbLength    =   gPrev->getLength(); 
    2106         } 
     2105            gbLength    =   gPrev->getLength();
     2106        }
    21072107        }
    21082108
     
    21122112    //Print("\n\nADDING TIME IN REDUCTION: %d\n\n",reductionTime);
    21132113    Print("\n\nNumber of zero-reductions:           %d\n",reductionsToZero);
    2114     Print("Number of rules:                     %d\n",numberOfRules); 
    2115     Print("Number of rejected F5-critical pairs:%d\n",numberRejectedF5CriticalPairs); 
    2116     Print("Number of reductions:                %d\n",numberOfReductions); 
    2117     Print("Elements not added to G:             %d\n",notInG); 
     2114    Print("Number of rules:                     %d\n",numberOfRules);
     2115    Print("Number of rejected F5-critical pairs:%d\n",numberRejectedF5CriticalPairs);
     2116    Print("Number of reductions:                %d\n",numberOfReductions);
     2117    Print("Elements not added to G:             %d\n",notInG);
    21182118    Print("Highest Degree during computations:  %d\n",highestDegree);
    21192119    Print("Degree d_0 in F5+:                   %d\n",highestDegreeGBCriticalPair);
     
    21342134    highestDegree                 =   0;
    21352135    highestDegreeGBCriticalPair   =   0;
    2136     reductionTime                 =   0; 
     2136    reductionTime                 =   0;
    21372137    spolsTime                     =   0;
    21382138    numberUselessPairs            =   0;
  • kernel/f5gb.h

    re40145 ra9c298  
    3838/*
    3939==================================================
    40 computes incrementally gbs of subsets of the input 
    41 gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1} 
     40computes incrementally gbs of subsets of the input
     41gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1}
    4242==================================================
    4343*/
     
    4747================================================================
    4848computes a list of critical pairs for the next reduction process
    49 the first element is always "useful" thus the critical pair 
    50 computed is either "useful" or "useless" depending on the second 
     49the first element is always "useful" thus the critical pair
     50computed is either "useful" or "useless" depending on the second
    5151element which generates the critical pair.
    5252first element in gPrev is always the newest element which must
     
    6464 * Checks all remaining critical pairs, i.e. those of higher degree,
    6565 * by the two Buchberger criteria.
    66  * return value: 0, if all remaining critical pairs are deleted by 
     66 * return value: 0, if all remaining critical pairs are deleted by
    6767 *                  Buchberger's criteria
    6868 *               1, otherwise
    6969 */
    70 bool arrisCheck(CNode* first,LNode* firstGCurr, long arrisdeg); 
     70bool arrisCheck(CNode* first,LNode* firstGCurr, long arrisdeg);
    7171
    7272/*
    7373================================================================
    7474computes a list of critical pairs for the next reduction process
    75 the first element is always "useless" thus the critical pair 
     75the first element is always "useless" thus the critical pair
    7676computed is "useless".
    7777first element in gPrev is always the newest element which must
     
    131131/*!
    132132 * ================================================================================
    133  * searches for reducers of temp similar to the symbolic preprocessing of F4  and 
     133 * searches for reducers of temp similar to the symbolic preprocessing of F4  and
    134134 * divides them into a "good" and "bad" part:
    135  * 
     135 *
    136136 * the "good" ones are the reducers which do not corrupt the label of temp, with
    137137 * these the normal form of temp is computed
    138138 *
    139  * the "bad" ones are the reducers which corrupt the label of temp, they are tested 
     139 * the "bad" ones are the reducers which corrupt the label of temp, they are tested
    140140 * later on for possible new RuleOlds and S-polynomials to be added to the algorithm
    141141 * ================================================================================
    142142 */
    143 void findReducers(LNode* l, LList* sPolyList, ideal gbPrev, LList* gPrev, LList* reducers, CListOld* critPairs, RList* rules, LTagList* lTag, RTagList* rTag, int termination, PList* rejectedGBList, int plus); 
     143void findReducers(LNode* l, LList* sPolyList, ideal gbPrev, LList* gPrev, LList* reducers, CListOld* critPairs, RList* rules, LTagList* lTag, RTagList* rTag, int termination, PList* rejectedGBList, int plus);
    144144
    145145/*
     
    149149=====================================================================================
    150150*/
    151 inline void topReduction(LNode* l, LList* sPolyList, LList* gPrev, CListOld* critPairs, RList* RuleOlds, LTagList* lTag, RTagList* rTag, ideal gbPrev, PList* rejectedGBList, int plus); 
     151inline void topReduction(LNode* l, LList* sPolyList, LList* gPrev, CListOld* critPairs, RList* RuleOlds, LTagList* lTag, RTagList* rTag, ideal gbPrev, PList* rejectedGBList, int plus);
    152152
    153153/*
     
    159159
    160160poly p_MergeEq_q(poly p, poly q, const ring r);
    161 */   
     161*/
    162162/*
    163163=====================================================================
  • kernel/f5lists.cc

    re40145 ra9c298  
    3939PNode* PNode::insert(poly p) {
    4040  poly q = pOne();
    41   q = pCopy(p); 
     41  q = pCopy(p);
    4242  PNode* temp = this;
    4343  if(NULL == temp) {
     
    8383  first = first->insert(p);
    8484}
    85  
     85
    8686
    8787/*
     
    137137    next                =   NULL;
    138138}
    139        
     139
    140140LNode::LNode(LPolyOld* lp, LNode* l) {
    141141//Print("HIER LNODE\n");
     
    149149next                =   NULL;
    150150}
    151        
     151
    152152LNode::LNode(poly t, int i, poly p, RuleOld* r, LNode* l) {
    153153    LPolyOld* lp           =   new LPolyOld(t,i,p,r);
     
    160160    next                =   ln->getNext();
    161161}
    162        
     162
    163163LNode::~LNode() {
    164164    //delete next;
    165165    //Print("DELETE LNODE\n");
    166     delete data;   
     166    delete data;
    167167}
    168168
     
    191191    }
    192192}
    193        
     193
    194194inline LNode* LNode::insert(poly t, int i, poly p, RuleOld* r) {
    195195    if(NULL == this) {
     
    212212    return newElement;
    213213}
    214        
     214
    215215inline LNode* LNode::insertSP(poly t, int i, poly p, RuleOld* r) {
    216216    LNode* newElement   =   new LNode(t, i, p, r, this);
     
    253253                    //Print("%p\n",temp);
    254254                    //Print("%p\n",temp->data);
    255                    
     255
    256256                    //Print("%p\n",temp->next);
    257257                }
     
    302302                    //Print("%p\n",temp);
    303303                    //Print("%p\n",temp->data);
    304                    
     304
    305305                    //Print("%p\n",temp->next);
    306306                }
     
    443443    last    =   first;
    444444    length  =   1;
    445 } 
     445}
    446446
    447447LList::~LList() {
     
    558558    next = NULL;
    559559}
    560        
     560
    561561LTagNode::LTagNode(LNode* l, LTagNode* n) {
    562562    data = l;
     
    565565
    566566 LTagNode::~LTagNode() {
    567     delete data;   
    568 }
    569        
     567    delete data;
     568}
     569
    570570// declaration with first as parameter due to sorting of LTagList
    571571LTagNode* LTagNode::insert(LNode* l) {
     
    607607LTagList::LTagList() {
    608608    LTagNode* first =   new LTagNode();
    609    
     609
    610610    length          =   0;
    611611}
     
    679679
    680680CNode::CNode() {
    681     data    =   NULL;   
    682     next    =   NULL;   
     681    data    =   NULL;
     682    next    =   NULL;
    683683}
    684684
    685685CNode::CNode(CPairOld* c) {
    686     data    =   c;   
    687     next    =   NULL;   
     686    data    =   c;
     687    next    =   NULL;
    688688}
    689689
    690690CNode::CNode(CPairOld* c, CNode* n) {
    691     data    =   c;   
    692     next    =   n;   
     691    data    =   c;
     692    next    =   n;
    693693}
    694694
     
    699699// insert sorts the critical pairs firstly by increasing total degree, secondly by increasing label
    700700// note: as all critical pairs have the same index here, the second sort is done on the terms of the labels
    701 // working only with linked, but not doubly linked lists due to memory usage we have to check the 
     701// working only with linked, but not doubly linked lists due to memory usage we have to check the
    702702// insertion around the first element separately from the insertion around all other elements in the list
    703703CNode* CNode::insert(CPairOld* c) {
     
    724724                CNode* temp = this;
    725725                while(  NULL != temp->next) {
    726                     if(temp->next->data->getDeg() == c->getDeg() ) { 
     726                    if(temp->next->data->getDeg() == c->getDeg() ) {
    727727                        if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) {
    728728                            temp = temp->next;
     
    732732                            temp->next          =   newElement;
    733733                            return this;
    734                         } 
     734                        }
    735735                    }
    736736                    else {
     
    747747        if( c->getDeg() > this->data->getDeg() ) { // greater degree than the first list element
    748748            CNode* temp =   this;
    749             while( NULL != temp->next ) {   
     749            while( NULL != temp->next ) {
    750750                if( c->getDeg() < temp->next->data->getDeg() ) {
    751751                    CNode* newElement   =   new CNode(c, temp->next);
     
    754754                }
    755755                if( c->getDeg() == temp->next->data->getDeg() ) {
    756                     if(1 != pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) { 
     756                    if(1 != pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),temp->next->data->getLp1Term()))) {
    757757                        CNode* newElement   =   new CNode(c, temp->next);
    758758                        temp->next          =   newElement;
     
    762762                        temp = temp->next;
    763763                        while(  NULL != temp->next ) {
    764                             if( temp->next->data->getDeg() == c->getDeg() ) { 
     764                            if( temp->next->data->getDeg() == c->getDeg() ) {
    765765                                if(1 == pLmCmp(u1,ppMult_qq(temp->next->data->getT1(),
    766766                                               temp->next->data->getLp1Term()))) {
     
    771771                                    temp->next          =   newElement;
    772772                                    return this;
    773                                 } 
     773                                }
    774774                            }
    775775                            else {
     
    810810            temp = temp->next;
    811811        }
    812         CNode* returnCNode  =   temp->next;   
    813         // every CListOld should end with a (NULL,NULL) element for a similar behaviour 
     812        CNode* returnCNode  =   temp->next;
     813        // every CListOld should end with a (NULL,NULL) element for a similar behaviour
    814814        // using termination conditions throughout the algorithm
    815815        temp->next          =   NULL;
     
    10001000
    10011001RNode* RNode::insertOrdered(RuleOld* r) {
    1002     RNode* newElement   =   new RNode(r); 
     1002    RNode* newElement   =   new RNode(r);
    10031003    RNode* temp         =   this;
    10041004    if(NULL == temp) {
     
    10221022RNode* RNode::getNext() {
    10231023    return next;
    1024 }   
     1024}
    10251025
    10261026RuleOld* RNode::getRuleOld() {
     
    10741074    }
    10751075    //Print("FERTIG\n");
    1076 } 
     1076}
    10771077
    10781078void RList::insert(int i, poly t) {
     
    11101110    next = NULL;
    11111111}
    1112  
     1112
    11131113RTagNode::RTagNode(RNode* r) {
    11141114    data = r;
    11151115    next = NULL;
    11161116}
    1117        
     1117
    11181118RTagNode::RTagNode(RNode* r, RTagNode* n) {
    1119    
     1119
    11201120    data = r;
    11211121    next = n;
     
    11231123
    11241124RTagNode::~RTagNode() {
    1125     delete data;   
    1126 }
    1127        
     1125    delete data;
     1126}
     1127
    11281128// declaration with first as parameter due to sorting of RTagList
    11291129RTagNode* RTagNode::insert(RNode* r) {
     
    11561156    else {
    11571157        int j;
    1158         RTagNode* temp = this; 
     1158        RTagNode* temp = this;
    11591159    //Print("\n\nHIER IN GET IDX\n");
    1160     //Print("FOR LOOP: %d\n",length-idx+1);   
     1160    //Print("FOR LOOP: %d\n",length-idx+1);
    11611161    for(j=1; j<=length-idx+1; j++) {
    11621162            temp = temp->next;
  • kernel/f5lists.h

    re40145 ra9c298  
    1313============================
    1414============================
    15 classes for lists used in F5 
     15classes for lists used in F5
    1616============================
    1717============================
     
    3535 */
    3636class PNode {
    37   private: 
     37  private:
    3838    poly   data;
    3939    PNode*  next;
     
    5656    bool check(poly p);
    5757    void print();
    58 }; 
    59    
     58};
     59
    6060/*
    6161=======================================
     
    102102        poly    getPoly();
    103103        poly    getTerm();
    104         int     getIndex(); 
     104        int     getIndex();
    105105        RuleOld*   getRuleOld();
    106106        bool    getDel();
     
    209209/*
    210210======================================================================================
    211 class TopRed(return values of subalgorithm TopRed in f5gb.cc), i.e. the first elements 
     211class TopRed(return values of subalgorithm TopRed in f5gb.cc), i.e. the first elements
    212212             of the lists LList* completed & LList* sPolyList
    213213======================================================================================
     
    238238                CNode(CPairOld* c);
    239239                CNode(CPairOld* c, CNode* n);
    240                 ~CNode(); 
    241         CNode*  insert(CPairOld* c); 
    242         CNode*  insertWithoutSort(CPairOld* cp); 
     240                ~CNode();
     241        CNode*  insert(CPairOld* c);
     242        CNode*  insertWithoutSort(CPairOld* cp);
    243243        CNode*  getMinDeg();
    244244        CPairOld*  getData();
     
    250250        poly    getLp1Term();
    251251        poly    getLp2Term();
    252         poly    getT1(); 
    253         poly*   getAdT1(); 
    254         poly    getT2(); 
    255         poly*   getAdT2(); 
     252        poly    getT1();
     253        poly*   getAdT1();
     254        poly    getT2();
     255        poly*   getAdT2();
    256256        int     getLp1Index();
    257257        int     getLp2Index();
     
    272272    public:
    273273                // for initialization of CListOlds, last element alwas has data=NULL and next=NULL
    274                 CListOld(); 
    275                 CListOld(CPairOld* c); 
    276                 ~CListOld(); 
     274                CListOld();
     275                CListOld(CPairOld* c);
     276                ~CListOld();
    277277        CNode*  getFirst();
    278278        void    insert(CPairOld* c);
  • kernel/fast_maps.cc

    re40145 ra9c298  
    469469        return NULL;
    470470      }
    471       if (/*(*/ p==NULL /*)*/) /* && (e>0)*/ 
     471      if (/*(*/ p==NULL /*)*/) /* && (e>0)*/
    472472      {
    473473        p=p_Copy(pp /*dest_id[i-1]*/,dest_r);
     
    482482  }
    483483  if (is_const)
    484   { 
     484  {
    485485    assume(p==NULL);
    486486    p=p_ISet(1,dest_r);
  • kernel/fast_maps.h

    re40145 ra9c298  
    66 *  Purpose: implementation of fast maps
    77 *  Author:  obachman (Olaf Bachmann), hannes (Hannes Schoenemann),
    8  *           bricken (Michael Brickenstein) 
     8 *           bricken (Michael Brickenstein)
    99 *  Created: 01/02
    1010 *******************************************************************/
     
    3434};
    3535
    36 class macoeff_s 
     36class macoeff_s
    3737{
    3838public:
     
    6060mapoly maMonomial_Create(poly p, ring , sBucket_pt bucket = NULL);
    6161// unconditionally destroys a maMonomial:
    62 // src: LmFree 
    63 // dest: p_Delete 
     62// src: LmFree
     63// dest: p_Delete
    6464// coeffs: delete list
    6565void maMonomial_Destroy(mapoly monomial, ring src_r, ring dest_r = NULL);
     
    6868{
    6969  monomial->ref--;
    70   if (monomial->ref <= 0) 
     70  if (monomial->ref <= 0)
    7171  { maMonomial_Destroy(monomial, src_r, dest_r); return NULL;}
    7272  return monomial;
     
    8787
    8888// creates mpoly and  mideal
    89 void maMap_CreatePolyIdeal(ideal map_id, ring map_r, 
     89void maMap_CreatePolyIdeal(ideal map_id, ring map_r,
    9090                           ring src_r, ring dest_r,
    9191                           mapoly &mp, maideal &mideal);
    9292// creates src_r: rings with weights
    9393//         dest_r: where we do our computations
    94 void maMap_CreateRings(ideal map_id, ring map_r, 
    95                        ideal image_id, ring image_r, 
     94void maMap_CreateRings(ideal map_id, ring map_r,
     95                       ideal image_id, ring image_r,
    9696                       ring &src_r, ring &dest_r, BOOLEAN &no_sort);
    9797
  • kernel/febase.cc

    re40145 ra9c298  
    4646char    prompt_char = '>'; /*1 either '>' or '.'*/
    4747int     yylineno  = 0;
    48 int  myynest = -1; 
     48int  myynest = -1;
    4949int  traceit = 0;
    5050char       my_yylinebuf[80];
  • kernel/feread.cc

    re40145 ra9c298  
    114114    #define rl_completion_matches           completion_matches
    115115  #endif
    116   #ifndef READLINE_READLINE_H_OK 
     116  #ifndef READLINE_READLINE_H_OK
    117117    /* declare everything we need explicitely and do not rely on includes */
    118118    extern char * rl_readline_name;
     
    149149*/
    150150#if defined(HAVE_DYN_RL)
    151 extern "C" 
     151extern "C"
    152152{
    153153  int fe_init_dyn_rl();
  • kernel/gr_kstd2.cc

    re40145 ra9c298  
    274274    //        Print("nach nc_rat_ReduceSpolyNew ");wrp(c_p);PrintLn();
    275275    //        pDelete(&((*h).p));
    276    
     276
    277277        c_p=nc_rat_ReduceSpolyNew(strat->S[c_j],(*h).p, currRing->real_var_start-1,currRing);
    278278        (*h).p=c_p;
  • kernel/hdegree.cc

    re40145 ra9c298  
    985985  int  i;
    986986  int  k = ak;
    987  
     987
    988988  #if HAVE_RINGS
    989989  if (rField_is_Ring(currRing) && (currRing->OrdSgn == -1))
     
    14501450    assume(p_ind!=NULL);
    14511451    assume(res->m[ind]==p_ind);
    1452     hEdge=p_ind; 
     1452    hEdge=p_ind;
    14531453    res->m[ind]=NULL;
    14541454    nDelete(&pGetCoeff(hEdge));
     
    14571457      pIncrExp(hEdge,i);
    14581458    pSetm(hEdge);
    1459    
     1459
    14601460    idDelete(&res);
    14611461    return;
  • kernel/ideals.cc

    re40145 ra9c298  
    12191219  intvec * weights;
    12201220  hom = (tHomog)idHomModule(h1,currQuotient,&weights);
    1221   if /**addOnlyOne &&*/ (/*(*/ !h1IsStb /*)*/) 
     1221  if /**addOnlyOne &&*/ (/*(*/ !h1IsStb /*)*/)
    12221222    temph1 = kStd(h1,currQuotient,hom,&weights,NULL);
    12231223  else
     
    25672567      if (id->m[i] != NULL) pDelete(&id->m[i]);
    25682568   }
    2569    int kk=k;                                                                                                                 
    2570    if (k==0) kk=1; /* ideals must have at least one element(0)*/                                                             
    2571    pEnlargeSet(&(id->m), IDELEMS(id), kk-IDELEMS(id));                                                                       
    2572    IDELEMS(id) = kk; 
     2569   int kk=k;
     2570   if (k==0) kk=1; /* ideals must have at least one element(0)*/
     2571   pEnlargeSet(&(id->m), IDELEMS(id), kk-IDELEMS(id));
     2572   IDELEMS(id) = kk;
    25732573}
    25742574
  • kernel/ideals.h

    re40145 ra9c298  
    2929/// delete an ideal
    3030inline void idDelete (ideal* h, ring r = currRing)
    31 { 
    32   id_Delete(h, r); 
     31{
     32  id_Delete(h, r);
    3333}
    3434
    3535/// initialise the maximal ideal (at 0)
    36 //ideal id_MaxIdeal(int deg, const ring r); 
     36//ideal id_MaxIdeal(int deg, const ring r);
    3737#define idMaxIdeal(D) id_MaxIdeal(D,currRing)
    3838
     
    4848  poly* mm = id->m;
    4949  while ((j >= 0) && (mm[j] == NULL)) j--;
    50   return (j + 1); 
     50  return (j + 1);
    5151}
    5252
  • kernel/khstd.cc

    re40145 ra9c298  
    135135void khCheckLocInhom(ideal Q, intvec *w, intvec *hilb, int &count,
    136136             kStrategy strat)
    137              
     137
    138138/*
    139139This will be used for the local orderings in the case of the inhomogenous ideals.
    140140Assume f1,...,fs are already in the standard basis. Test if hilb(LM(f1),...,LM(fs),1)
    141 is equal to the inputed one. 
     141is equal to the inputed one.
    142142If no, do nothing.
    143143If Yes, we know that all polys that we need are already in the standard basis
     
    198198          return;
    199199   }
    200    
     200
    201201id_Delete(&Lm,currRing);
    202202       
  • kernel/kspoly.cc

    re40145 ra9c298  
    7676  {
    7777    // for the time being: we know currRing==strat->tailRing
    78     // no exp-bound checking needed 
     78    // no exp-bound checking needed
    7979    // (only needed if exp-bound(tailring)<exp-b(currRing))
    8080    if (PR->bucket!=NULL)  nc_kBucketPolyRed(PR->bucket, p2,coef);
    81     else 
     81    else
    8282    {
    8383      poly _p = (PR->t_p != NULL ? PR->t_p : PR->p);
     
    150150    poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
    151151    PR->Clear(); // does the right things
    152     PR->p = qq; 
     152    PR->p = qq;
    153153    PR->t_p = NULL;
    154154    PR->SetShortExpVector();
    155155  }
    156156#endif
    157  
     157
    158158#if defined(KDEBUG) && defined(TEST_OPT_DEBUG_RED)
    159159  if (TEST_OPT_DEBUG)
     
    202202   * --------------------------------------------
    203203   * if strat->incremental
    204    * Since we are subdividing lower index and 
     204   * Since we are subdividing lower index and
    205205   * current index reductions it is enough to
    206206   * look at the polynomial part of the signature
     
    212212   * Schreyer order
    213213   *
    214    * nevertheless, this different behaviour is 
     214   * nevertheless, this different behaviour is
    215215   * taken care of by is_sigsafe
    216216   * => one reduction procedure can be used for
     
    258258    // signature of fm*p1
    259259    if(sigSafe != 1)
    260     { 
     260    {
    261261      PR->is_redundant = TRUE;
    262262      return 3;
     
    283283  {
    284284    // for the time being: we know currRing==strat->tailRing
    285     // no exp-bound checking needed 
     285    // no exp-bound checking needed
    286286    // (only needed if exp-bound(tailring)<exp-b(currRing))
    287287    if (PR->bucket!=NULL)  nc_kBucketPolyRed(PR->bucket, p2,coef);
    288     else 
     288    else
    289289    {
    290290      poly _p = (PR->t_p != NULL ? PR->t_p : PR->p);
     
    357357    poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
    358358    PR->Clear(); // does the right things
    359     PR->p = qq; 
     359    PR->p = qq;
    360360    PR->t_p = NULL;
    361361    PR->SetShortExpVector();
     
    485485    poly qq = p_Shrink(Pair->p, currRing->isLPring, currRing);
    486486    Pair->Clear(); // does the right things
    487     Pair->p = qq; 
     487    Pair->p = qq;
    488488    Pair->t_p = NULL;
    489489    Pair->SetShortExpVector();
     
    540540    poly qq = p_Shrink(PR->p, currRing->isLPring, currRing);
    541541    PR->Clear(); // does the right things
    542     PR->p = qq; 
     542    PR->p = qq;
    543543    PR->t_p = NULL;
    544544    PR->SetShortExpVector();
  • kernel/kstdfac.cc

    re40145 ra9c298  
    10011001          }
    10021002          // delete L[j],
    1003           Li=L; 
     1003          Li=L;
    10041004          if (Lj_prev!=NULL)
    10051005          {
  • kernel/kutil.h

    re40145 ra9c298  
    7979  BOOLEAN is_normalized; // true, if pNorm was called on p, false otherwise
    8080  // used in incremental sba() with F5C:
    81   // we know some of the redundant elements in 
     81  // we know some of the redundant elements in
    8282  // strat->T beforehand, so we can just discard
    8383  // them and do not need to consider them in the
     
    9191
    9292
    93 #ifdef HAVE_PLURAL 
     93#ifdef HAVE_PLURAL
    9494  BOOLEAN is_special; // true, it is a new special S-poly (e.g. for SCA)
    9595#endif
    96  
     96
    9797  // initialization
    9898  KINLINE void Init(ring r = currRing);
     
    420420void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
    421421void initEcartPairMora (LObject* Lp,poly f,poly g,int ecartF,int ecartG);
    422 int posInS (const kStrategy strat, const int length, const poly p, 
     422int posInS (const kStrategy strat, const int length, const poly p,
    423423            const int ecart_p);
    424424int posInT0 (const TSet set,const int length,LObject &p);
     
    508508void initSLSba (ideal F, ideal Q,kStrategy strat);
    509509/*************************************************
    510  * when initializing a new bunch of principal 
     510 * when initializing a new bunch of principal
    511511 * syzygies at the beginning of a new iteration
    512  * step in a signature-based algorithm we 
     512 * step in a signature-based algorithm we
    513513 * compute ONLY the leading elements of those
    514514 * syzygies, NOT the whole syzygy
     
    624624void initBba(ideal F,kStrategy strat);
    625625void initSba(ideal F,kStrategy strat);
    626 void f5c (kStrategy strat, int& olddeg, int& minimcnt, int& hilbeledeg, 
     626void f5c (kStrategy strat, int& olddeg, int& minimcnt, int& hilbeledeg,
    627627          int& hilbcount, int& srmax, int& lrmax, int& reduc, ideal Q,
    628628          intvec *w,intvec *hilb );
     
    771771void enterpairsShift (poly h,int k,int ecart,int pos,kStrategy strat, int atR,int uptodeg, int lV);
    772772
    773 void initenterpairsShift (poly h,int k,int ecart,int isFromQ,kStrategy strat, int atR,int uptodeg, int lV); 
     773void initenterpairsShift (poly h,int k,int ecart,int isFromQ,kStrategy strat, int atR,int uptodeg, int lV);
    774774
    775775void updateSShift(kStrategy strat,int uptodeg,int lV);
  • kernel/linearAlgebra.h

    re40145 ra9c298  
    11/*****************************************************************************\
    2  * Computer Algebra System SINGULAR   
     2 * Computer Algebra System SINGULAR
    33\*****************************************************************************/
    44/** @file lineareAlgebra.h
    5  * 
     5 *
    66 * This file provides basic linear algebra functionality.
    77 *
     
    515515 * d linear equation systems. It is hence an application of other methods
    516516 * defined in this h-file and its corresponding cc-file.
    517  * 
     517 *
    518518 **/
    519519void henselFactors(
  • kernel/mod2.h

    re40145 ra9c298  
    6666/* procedures to compute groebner bases with the f5 implementation */
    6767/* still testing */
    68 #undef HAVE_F5 
     68#undef HAVE_F5
    6969
    7070/* procedures to compute groebner bases with the f5c implementation */
     
    186186       ...
    187187
    188        makes sure that all poly operations in your file are done with 
     188       makes sure that all poly operations in your file are done with
    189189       PDEBUG == 2
    190190 To break after an error occured, set a debugger breakpoint on
    191  dErrorBreak. 
     191 dErrorBreak.
    192192*/
    193193#ifndef PDEBUG
     
    223223     1     : addresses are only marked as free and not really freed.
    224224
    225    OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis 
     225   OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis
    226226   (as can OM_NDEBUG),  e.g.:
    227227     #define OM_CHECK 3
     
    230230     #include "mod2.h"
    231231     #include <omalloc/omalloc.h>
    232    ensures that all memory allocs/free in this file are done with 
    233    OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed 
     232   ensures that all memory allocs/free in this file are done with
     233   OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed
    234234   in this file are only marked as free and never really freed.
    235  
    236    To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set 
    237    om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and 
    238    om_Opts.Keep to the number of addresses which are kept before they are 
     235
     236   To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set
     237   om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and
     238   om_Opts.Keep to the number of addresses which are kept before they are
    239239   actually freed. E.g.:
    240240     int check=om_Opts.MinCheck, track=om_Opts.MinTrack, keep= m_OPts.Keep;
     
    243243     om_Opts.MinCheck = check; omOpts.MinTrack = track; omOpts.Keep = keep;
    244244   ensures that all calls omDebug routines  occuring during the computation of
    245    ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and 
     245   ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and
    246246   calls to omFree only mark addresses as free and not really free them.
    247247
    248    Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies 
    249    how many addresses are kept before they are actually freed, independently 
     248   Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies
     249   how many addresses are kept before they are actually freed, independently
    250250   of the value of OM_KEEP.
    251251
     
    260260     Under dynamic scope, do (e.g., from within the debugger):
    261261       om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
    262    + to find out where "memory corruption" occured, increase value of 
    263      OM_CHECK - the higher this value is, the more consistency checks are 
    264      done (However a value > 3 checks the entire memory each time an omalloc 
     262   + to find out where "memory corruption" occured, increase value of
     263     OM_CHECK - the higher this value is, the more consistency checks are
     264     done (However a value > 3 checks the entire memory each time an omalloc
    265265     routine is used!)
    266    
     266
    267267   Some more tips on the usage of omalloc:
    268    + omAlloc*, omRealloc*, omFree*, omCheck* omDebug* omTest* rotuines 
     268   + omAlloc*, omRealloc*, omFree*, omCheck* omDebug* omTest* rotuines
    269269     assume that sizes are > 0 and pointers are != NULL
    270270   + omalloc*, omrealloc*, omfree* omcheck*, omdebug* omtest* routines allow
    271271     NULL pointers and sizes == 0
    272    + You can safely use any free/realloc routine in combination with any alloc 
     272   + You can safely use any free/realloc routine in combination with any alloc
    273273     routine (including the debug versions): E.g., an address allocated with
    274      omAllocBin can be freed with omfree, or an adress allocated with 
     274     omAllocBin can be freed with omfree, or an adress allocated with
    275275     om(Debug)Alloc can be freed with omfree, or omFree, or omFreeSize, etc.
    276      However, keep in mind that the efficiency decreases from 
     276     However, keep in mind that the efficiency decreases from
    277277     Bin over Size to General routines (i.e., omFreeBin is more efficient than
    278278     omFreeSize which is more efficient than omFree, likewise with the alloc
    279279     routines).
    280280   + if OM_CHECK is undefined or 0, then all omCheck routines do nothing
    281    + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is 
    282      defined, then the "real" alloc/realloc/free macros are used, and all 
     281   + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is
     282     defined, then the "real" alloc/realloc/free macros are used, and all
    283283     omTest, omDebug and omCheck routines are undefined
    284    + to break after an omError occured within a debugger, 
     284   + to break after an omError occured within a debugger,
    285285     set a breakpoint on dErrorBreak
    286    + to do checks from within the debugger, or to do checks with explicit 
     286   + to do checks from within the debugger, or to do checks with explicit
    287287     check level, use omTest routines.
    288288*/
     
    296296#define OM_CHECK 1
    297297#endif
    298 /* Do actually free memory: 
    299    (be careful: if this is set, memory is never really freed, 
     298/* Do actually free memory:
     299   (be careful: if this is set, memory is never really freed,
    300300    but only marked as free) */
    301301#ifndef OM_KEEP
    302302#define OM_KEEP 0
    303303#endif
    304 /* but only after you have freed 1000 more addresses 
     304/* but only after you have freed 1000 more addresses
    305305   (this is actually independent of the value of OM_KEEP and used
    306306   to initialize om_Opts.Keep) */
     
    312312
    313313
    314 /* undef KDEBUG for check of data during std computations 
     314/* undef KDEBUG for check of data during std computations
    315315 *
    316316 * define KDEBUG to
    317317 * 0 for basic tests
    318  * 1 for tests in kSpoly 
    319  * NOTE: You can locally enable tests in kspoly by setting the 
     318 * 1 for tests in kSpoly
     319 * NOTE: You can locally enable tests in kspoly by setting the
    320320 *       define at the beginning of kspoly.cc
    321321 */
     
    433433#ifdef HAVE_ASSUME
    434434#ifndef RDEBUG
    435 #define RDEBUG 
     435#define RDEBUG
    436436#endif
    437437#endif
  • kernel/nc.cc

    re40145 ra9c298  
    11#define PLURAL_INTERNAL_DECLARATIONS
    2    
     2
    33#ifdef HAVE_CONFIG_H
    44#include "singularconfig.h"
     
    287287    var[i]=pCopy(x);
    288288  }
    289   // init NF's 
     289  // init NF's
    290290  for (i=1; i<=N; i++ )
    291291  {
     
    306306    h2->m[j]=0;
    307307    }
    308     // W[1..idElems(I)] 
     308    // W[1..idElems(I)]
    309309    if (flag >0)
    310310    {
     
    372372      syzcnt++;
    373373      idDelete(&s_h3);
    374     } // end if flag >0 
     374    } // end if flag >0
    375375    else
    376376    {
  • kernel/nc.h

    re40145 ra9c298  
    5757        gb = gnc_gr_bba;
    5858    }
    59    
     59
    6060    r->GetNC()->p_Procs.GB = cast_A_to_vptr(gb);
    6161  }
  • kernel/old.Ideal.h

    re40145 ra9c298  
    1717 IdealBase(){
    1818 }
    19  
    20  IdealBase(iterator first, 
    21              iterator last,
    22              const typename
    23              std::vector<poly_type>::allocator_type& __a = allocator_type()):
     19
     20 IdealBase(iterator first,
     21             iterator last,
     22             const typename
     23             std::vector<poly_type>::allocator_type& __a = allocator_type()):
    2424   storage(first,last,__a)
    2525   {
    26    
     26
    2727 }
    2828 ring getRing() const{
     
    8484    }
    8585  }
    86   Ideal(iterator first, 
    87         iterator last,
    88         const allocator_type& __a = allocator_type()):
     86  Ideal(iterator first,
     87        iterator last,
     88        const allocator_type& __a = allocator_type()):
    8989    IdealBase<Poly>(first,last,__a){
    9090  }
     
    9292   //no checks for rings
    9393   int s=size();
    94    
     94
    9595   if (s==0)
    9696    s=1;
    97    
     97
    9898   ideal result=idInit(s,1);
    9999   result->m[0]=NULL;
     
    114114  }
    115115  ideal as_module() const{
    116    
     116
    117117   //no checks for rings
    118118        int s=size();
    119    
     119
    120120        if (s==0)
    121121        s=1;
    122    
     122
    123123        ideal result=idInit(s,1);
    124124        result->m[0]=NULL;
     
    133133            result->rank=idRankFreeModule(result,storage[0].getRing());
    134134   return result;
    135    
     135
    136136  }
    137   Module(iterator first, 
    138         iterator last,
    139         const allocator_type& __a = allocator_type()):
     137  Module(iterator first,
     138        iterator last,
     139        const allocator_type& __a = allocator_type()):
    140140    IdealBase<Vector>(first,last,__a){
    141141  }
  • kernel/old.Number.h

    re40145 ra9c298  
    1515    else {
    1616    r->ref--;
    17    
     17
    1818    }
    1919    //Print("ref count after release: %d", r->ref);
     
    2929class Vector;
    3030class Number{
    31  
     31
    3232 public:
    3333  friend Number operator+(const Number& n1, const Number& n2);
     
    117117    return *this;
    118118  }
    119  
     119
    120120  Number& operator+=(int n2){
    121121    number n2n=n_Init(n2,r.get());
     
    143143    return *this;
    144144  }
    145   Number& operator/=(int n2){ 
     145  Number& operator/=(int n2){
    146146    number n2n=n_Init(n2,r.get());
    147147    number nv=n_Div(n,n2n,r.get());
     
    187187    n_Write(towrite,r.get());
    188188  }
    189  
     189
    190190  ~Number(){
    191191    if (r!=NULL)
  • kernel/old.Poly.h

    re40145 ra9c298  
    100100    }
    101101    p=p_Add_q(p,p_Copy(p2.p,p2.r.get()),r.get());
    102    
     102
    103103    return *this;
    104104  }
     
    121121      return *this;
    122122    }
    123    
     123
    124124    p=p_Mult_nn(p,n.n,r.get());
    125125    return *this;
     
    140140    p=p_Add_q(p,pc,r.get());
    141141
    142    
     142
    143143    return *this;
    144144  }
     
    146146
    147147  PolyImpl& operator=(int n){
    148  
     148
    149149    p_Delete(&p,r.get());
    150150    p=p_ISet(n,r.get());
    151151    return *this;
    152  
    153   }
    154  
     152
     153  }
     154
    155155
    156156  PolyImpl(){
     
    175175  }
    176176  PolyImpl(const Number & n){
    177    
     177
    178178    r=n.r.get();
    179179    this->p=p_NSet(n_Copy(n.n,r.get()),r.get());
    180    
     180
    181181  }
    182182  explicit PolyImpl(int n){
     
    262262    return p_LmIsConstant(t,r);
    263263  }
    264  
     264
    265265};
    266266
     
    269269{
    270270
    271  
     271
    272272 private:
    273273  poly t;
     
    332332    }
    333333    return res;
    334   } 
     334  }
    335335  void copy_on_write(){
    336336    if (!ptr.unique()){
     
    366366    copy_on_write();
    367367    *ptr += *p2.ptr;
    368    
     368
    369369    return *this;
    370370  }
     
    373373    copy_on_write();
    374374    *ptr *=n;
    375    
     375
    376376    return *this;
    377377  }
     
    411411  }
    412412 protected:
    413  
     413
    414414  PolyBase(PolyImpl& impl):ptr(&impl){
    415    
     415
    416416  }
    417417  poly getInternalReference(){
     
    434434  }
    435435  Poly(int n, ring r=currRing):Base(*(new PolyImpl(n,r))){
    436    
     436
    437437  }
    438438  Poly(const char* c, ring r=currRing):Base(c,r){
     
    441441  Poly(const Base& p):Base(p){
    442442  }
    443  
     443
    444444  Poly(const Number& n):Base(*(new PolyImpl(n))){
    445    
     445
    446446  }
    447447  Poly(poly p, ring r):Base(p,r){
    448    
     448
    449449  }
    450450  Poly(poly p, ring r, int):Base(p,r,0){
     
    486486  }
    487487  Vector(int n, ring r=currRing):Base(*(new PolyImpl(n,r))){
    488    
     488
    489489  }
    490490  Vector(const char* c, ring r=currRing):Base(c,r){
     
    493493  Vector(const Base& p):Base(p){
    494494  }
    495  
     495
    496496
    497497  Vector(poly p, ring r):Base(p,r){
    498    
     498
    499499  }
    500500  Vector(poly p, ring r, int):Base(p,r,0){
     
    556556
    557557//assumes monomials commute with numbers
    558 template <poly_variant variant, class create_type, class error_traits> 
    559   inline typename PolyBase<variant,create_type, error_traits>::create_type 
     558template <poly_variant variant, class create_type, class error_traits>
     559  inline typename PolyBase<variant,create_type, error_traits>::create_type
    560560  operator*
    561   (const Number& n, 
     561  (const Number& n,
    562562   const PolyBase<variant,create_type, class error_tratis>& p)
    563563{
     
    589589  return p_EqualPolys(p1.ptr->p,p2.ptr->p,r1);
    590590}
    591 template <poly_variant variant, class create_type,class error_traits> 
    592   inline typename PolyBase<variant,create_type,error_traits>::create_type 
     591template <poly_variant variant, class create_type,class error_traits>
     592  inline typename PolyBase<variant,create_type,error_traits>::create_type
    593593  operator+
    594   (const PolyBase<variant,create_type,error_traits>& b1, 
     594  (const PolyBase<variant,create_type,error_traits>& b1,
    595595   const PolyBase<variant,create_type,error_traits>& b2)
    596596{
     
    609609  return res;
    610610}
    611 template <poly_variant variant, class create_type, class error_traits> 
    612    
    613 inline PolyBase<variant, create_type, error_traits>& 
     611template <poly_variant variant, class create_type, class error_traits>
     612
     613inline PolyBase<variant, create_type, error_traits>&
    614614PolyBase<variant, create_type, error_traits>::operator*=(const Poly & p2){
    615615    copy_on_write();
    616616    *ptr *= *p2.ptr;
    617     
     617 
    618618    return *this;
    619619  }
  • kernel/old.PowerSeries.h

    re40145 ra9c298  
    88  std::input_iterator_tag,
    99  typename traits::expansion_type,
    10   int, 
     10  int,
    1111  shared_ptr<const typename traits::expansion_type>,
    12   const typename traits::expansion_type 
     12  const typename traits::expansion_type
    1313  > {
    1414 private:
     
    2323  denominator_type lastPot;
    2424 public:
    25   PowerSeriesInputIterator(numerator_type num_arg, 
    26                            denominator_type den_arg):
    27     data(den_arg.getRing()), 
     25  PowerSeriesInputIterator(numerator_type num_arg,
     26                           denominator_type den_arg):
     27    data(den_arg.getRing()),
    2828    lastPot(den_arg.getRing()),
    2929    numerator(num_arg),
     
    3737    typename traits::denominator_type::iterator end=denominator.end();
    3838    while(it!=end){
    39      
     39
    4040      if ((*it).isConstant()){
    41         //change this type
    42         c=denominator_type(*it).leadCoef();
    43        
    44         break;
     41        //change this type
     42        c=denominator_type(*it).leadCoef();
     43
     44        break;
    4545      }
    46      
     46
    4747      ++it;
    48      
    49      
    50  
     48
     49
     50
    5151    }
    5252    c=Number(1,r)/c;
     
    5454    denominator*=c;
    5555    toPot=denominator+denominator_type(-1,r);
    56    
     56
    5757    toPot*=Number(-1,r);
    5858    //change this type
     
    6060    data=numerator;
    6161    state=0;
    62    
     62
    6363  }
    6464  PowerSeriesInputIterator(){
     
    7272    while(it!=end){
    7373      if(it->lmTotalDegree()<state){
    74         remove+=expansion_type(*it);
     74        remove+=expansion_type(*it);
    7575      }
    7676      it++;
     
    8686    while(it!=end){
    8787      if(it->lmTotalDegree()==state)
    88         {
    89           res+=expansion_type(*it);
    90         }
     88        {
     89          res+=expansion_type(*it);
     90        }
    9191      it++;
    9292    }
     
    9797    shorten();
    9898    lastPot*=toPot;
    99    
     99
    100100    data+=lastPot*numerator;
    101    
    102  
     101
     102
    103103    return *this;
    104    
     104
    105105  }
    106106  //bad if this are iterators for different PowerSeries
     
    136136  numerator_type numerator;
    137137 public:
    138  
     138
    139139  PowerSeriesBase(){
    140140  }
     
    150150    return iterator();
    151151  }
    152  
     152
    153153
    154154};
  • kernel/old.lplist.h

    re40145 ra9c298  
    129129#endif
    130130#endif
    131  
     131
  • kernel/old.si_gmp.h

    re40145 ra9c298  
    1515#endif
    1616
    17 #endif 
     17#endif
    1818#endif /* ! INCL_CF_GMP_H */
  • kernel/polys.h

    re40145 ra9c298  
    246246 ***************************************************************/
    247247inline int pWeight(int i, const ring R = currRing){ return p_Weight(i, R); }
    248  
     248
    249249
    250250static inline long pTotaldegree(poly p) { return p_Totaldegree(p,currRing); }
     
    306306// On return all components pf *q == 0
    307307inline void pTakeOutComp(poly *p, long comp, poly *q, int *lq, const ring R = currRing)
    308 { 
     308{
    309309  return p_TakeOutComp(p, comp, q, lq, R);
    310310}
  • kernel/preimage.cc

    re40145 ra9c298  
    7171  if (rIsPluralRing(theImageRing))
    7272  {
    73     if ((rIsPluralRing(sourcering)) && (ncRingType(sourcering)!=nc_comm)) 
     73    if ((rIsPluralRing(sourcering)) && (ncRingType(sourcering)!=nc_comm))
    7474    {
    7575      Werror("Sorry, not yet implemented for noncomm. rings");
     
    7878  }
    7979#endif
    80  
     80
    8181  int i,j;
    8282  poly p,/*pp,*/q;
     
    104104
    105105  const ring save_ring = currRing; if (currRing!=tmpR) rChangeCurrRing(tmpR); // due to kStd
    106  
     106
    107107  if (id==NULL)
    108108    j = 0;
     
    120120    {
    121121      p = p_SortMerge(
    122                       pChangeSizeOfPoly(theImageRing, theMap->m[i], 1, imagepvariables, tmpR),
    123                       tmpR);
     122                      pChangeSizeOfPoly(theImageRing, theMap->m[i], 1, imagepvariables, tmpR),
     123                      tmpR);
    124124      p=p_Add_q(p,q,tmpR);
    125125    }
     
    134134  {
    135135    temp1->m[i] = p_SortMerge(
    136                               pChangeSizeOfPoly(theImageRing, id->m[i-sourcering->N], 1, imagepvariables, tmpR),
    137                               tmpR);
     136                              pChangeSizeOfPoly(theImageRing, id->m[i-sourcering->N], 1, imagepvariables, tmpR),
     137                              tmpR);
    138138  }
    139139  for (i=sourcering->N+j0;i<sourcering->N+j;i++)
    140140  {
    141141    temp1->m[i] = p_SortMerge(
    142                               pChangeSizeOfPoly(theImageRing, theImageRing->qideal->m[i-sourcering->N-j0], 1, imagepvariables, tmpR),
    143                               tmpR);
     142                              pChangeSizeOfPoly(theImageRing, theImageRing->qideal->m[i-sourcering->N-j0], 1, imagepvariables, tmpR),
     143                              tmpR);
    144144  }
    145145  // we ignore here homogenity - may be changed later:
     
    163163    {
    164164      q = p_SortMerge(
    165                       pChangeSizeOfPoly(tmpR, p, imagepvariables+1, N, sourcering),
    166                       sourcering);
     165                      pChangeSizeOfPoly(tmpR, p, imagepvariables+1, N, sourcering),
     166                      sourcering);
    167167      if (j>=IDELEMS(temp1))
    168168      {
     
    178178
    179179  if (currRing!=save_ring) rChangeCurrRing(save_ring);
    180  
     180
    181181  rDelete(tmpR);
    182182  return temp1;
  • kernel/ratgring.cc

    re40145 ra9c298  
    3838  }
    3939  pSetComp(m, si_max(pGetComp(a), pGetComp(b)));
    40   /* Don't do a pSetm here, otherwise hres/lres chockes */ 
     40  /* Don't do a pSetm here, otherwise hres/lres chockes */
    4141}
    4242
     
    8585//   }
    8686//   pSetComp(m, si_max(pGetComp(a), pGetComp(b)));
    87 //   /* Don't do a pSetm here, otherwise hres/lres chockes */ 
     87//   /* Don't do a pSetm here, otherwise hres/lres chockes */
    8888// }
    8989
     
    105105}
    106106
    107 /* returns x-coeff of p, i.e. a poly in x, s.t. corresponding xd-monomials 
     107/* returns x-coeff of p, i.e. a poly in x, s.t. corresponding xd-monomials
    108108have the same D-part and the component 0
    109109does not destroy p
     
    143143  }
    144144  //  p_wrp(*p,r);Print(" ");
    145   //  PrintS("end\n"); 
     145  //  PrintS("end\n");
    146146  p_LmDelete(&q,r);
    147147}
     
    153153  p_LmCheckPolyRing1(p1, r);
    154154  p_LmCheckPolyRing1(p2, r);
    155   p_LmCheckPolyRing1(pr, r); 
     155  p_LmCheckPolyRing1(pr, r);
    156156  int i;
    157157  poly t=pr;
     
    166166#ifdef PDEBUG
    167167      PrintS("negative ExpVectorDiff\n");
    168 #endif   
     168#endif
    169169      p_Delete(&t,r);
    170170      break;
     
    201201//  pShift(&K,-2); // 2nd component to 0th comp.
    202202  K2 = pTakeOutComp(&K, 1);
    203 //  K2 = K; 
     203//  K2 = K;
    204204
    205205  PrintS("syz1: "); p_wrp(K1,r);
    206206  PrintS("syz2: "); p_wrp(K2,r);
    207207
    208   /* checking signs before multiplying */   
     208  /* checking signs before multiplying */
    209209  number ck1 = p_GetCoeff(K1,r);
    210210  number ck2 = p_GetCoeff(K2,r);
     
    252252}
    253253
    254 /* PINLINE1 void p_ExpVectorDiff 
     254/* PINLINE1 void p_ExpVectorDiff
    255255   remains as is -> BUT we can do memory shift on smaller number of exp's */
    256256
     
    345345//   K2 = K;
    346346
    347 //   /* checking signs before multiplying */   
     347//   /* checking signs before multiplying */
    348348//   number ck1 = p_GetCoeff(K1,r);
    349349//   number ck2 = p_GetCoeff(K2,r);
     
    473473  PrintS("k: "); p_wrp(K,r); PrintS("\n");
    474474#endif
    475  
     475
    476476  ideal ncsyz = ncGCD(C,K,r);
    477477  poly KK = ncsyz->m[0]; ncsyz->m[0]=NULL; //p_Copy(ncsyz->m[0],r); // k'
     
    487487
    488488#ifdef PDEBUG
    489   PrintS(" t_f: "); p_wrp(p1,r); PrintS("\n"); 
    490   PrintS(" t_g: "); p_wrp(p2,r); PrintS("\n"); 
    491   PrintS(" r_f: "); p_wrp(HF,r); PrintS("\n"); 
    492   PrintS(" r_g: "); p_wrp(HG,r); PrintS("\n"); 
    493   PrintS(" c': "); p_wrp(CC,r); PrintS("\n"); 
    494   PrintS(" k': "); p_wrp(KK,r); PrintS("\n"); 
     489  PrintS(" t_f: "); p_wrp(p1,r); PrintS("\n");
     490  PrintS(" t_g: "); p_wrp(p2,r); PrintS("\n");
     491  PrintS(" r_f: "); p_wrp(HF,r); PrintS("\n");
     492  PrintS(" r_g: "); p_wrp(HG,r); PrintS("\n");
     493  PrintS(" c': "); p_wrp(CC,r); PrintS("\n");
     494  PrintS(" k': "); p_wrp(KK,r); PrintS("\n");
    495495
    496496#endif
     
    589589#ifdef PDEBUG
    590590  PrintS("t_g: "); p_wrp(out,r);
    591   PrintS("k': "); p_wrp(KK,r); PrintS("\n"); 
    592   PrintS("p': "); p_wrp(PP,r); PrintS("\n"); 
     591  PrintS("k': "); p_wrp(KK,r); PrintS("\n");
     592  PrintS("p': "); p_wrp(PP,r); PrintS("\n");
    593593#endif
    594594  id_Delete(&ncsyz,r);
     
    609609
    610610//  out = r->nc->p_Procs.mm_Mult_p(m, out, r); // d^aplha t_g
    611   out = nc_mm_Mult_p(m, out, r); // d^aplha t_g 
     611  out = nc_mm_Mult_p(m, out, r); // d^aplha t_g
    612612  p_Delete(&m,r);
    613613
     
    643643  p_wrp(p_Head(a,r),r);
    644644  PrintS(" and b= ");
    645   p_wrp(p_Head(b,r),r); 
     645  p_wrp(p_Head(b,r),r);
    646646  PrintLn();
    647647#endif
     
    676676      {
    677677        j=i; l=red_length[i];
    678         //        PrintS(" yes\n");
     678        //        PrintS(" yes\n");
    679679      }
    680680      //      else PrintS(" no\n");
     
    693693    }
    694694    poly hh=nc_rat_ReduceSpolyNew(reducer[j], *h, ishift, r);
    695     //    p_Delete(h,r); 
     695    //    p_Delete(h,r);
    696696    *h=hh;
    697697    if (TEST_OPT_DEBUG)
     
    774774  // and pmideglen is the coordinate of one of the smallest among them
    775775
    776   //  poly g = singclap_gcd(p_Copy(p,r),p_Copy(q,r)); 
     776  //  poly g = singclap_gcd(p_Copy(p,r),p_Copy(q,r));
    777777  //  return naGcd(d,d2,currRing);
    778778
     
    781781  {
    782782    d=singclap_gcd(d,pCopy(C[i]));
    783     if (pTotaldegree(d)==0) 
     783    if (pTotaldegree(d)==0)
    784784    {
    785785      // cleanup, pContent, return
     
    800800   C[i]=h;
    801801  }
    802  
    803   // zusammensetzen, 
     802
     803  // zusammensetzen,
    804804  p=NULL; // just to be sure
    805805  for(i=0; i<=k; i++)
  • kernel/ratgring.h

    re40145 ra9c298  
    1515/* MACROS */
    1616
    17 /* the part, related to the interface */ 
     17/* the part, related to the interface */
    1818
    1919/* ring nc_rCreateNCcomm(ring r); */
     
    4949// poly nc_p_Mult_mm_Common(poly p, const poly m, int side, const ring r);
    5050// poly nc_mm_Mult_p(const poly m, poly p, const ring r);
    51 // poly nc_mm_Mult_nn (int *F, int *G, const ring r); 
     51// poly nc_mm_Mult_nn (int *F, int *G, const ring r);
    5252// poly nc_mm_Mult_uu (int *F,int jG,int bG, const ring r);
    5353
  • kernel/sca.cc

    re40145 ra9c298  
    105105  assume( currRing == _currRing );
    106106
    107  
     107
    108108#if MYTEST
    109109   PrintS("<sca_gr_bba>\n");
     
    362362
    363363  if( currRing != save )     rChangeCurrRing(save);
    364  
     364
    365365  return (strat->Shdl);
    366366}
     
    484484    kDebugPrint(strat);
    485485  }
    486  
     486
    487487
    488488  ///////////////////////////////////////////////////////////////
     
    731731        enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
    732732
    733  
    734  
    735  
    736 #if 0   
     733
     734
     735
     736#if 0
    737737        h.sev = pGetShortExpVector(h.p);
    738738        strat->initEcart(&h);
     
    781781
    782782         enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
    783 // the end of "#if 0" (comment) 
    784 #endif 
     783// the end of "#if 0" (comment)
     784#endif
    785785
    786786      } // for all x_i \in Ann(lm(P))
     
    851851
    852852  if( currRing != save )     rChangeCurrRing(save);
    853  
     853
    854854  return (strat->Shdl);
    855855}
     
    920920#ifdef PDEBUG
    921921  assume( strat->homog == bIdHomog );
    922 #endif 
     922#endif
    923923
    924924#ifdef HAVE_ASSUME
     
    12291229
    12301230  if( currRing != save )     rChangeCurrRing(save);
    1231  
     1231
    12321232  return (strat->Shdl);
    12331233}
  • kernel/semic.h

    re40145 ra9c298  
    8181
    8282    spectrum( const spectrum& );
    83    
     83
    8484    ~spectrum( );
    8585
  • kernel/syz0.cc

    re40145 ra9c298  
    527527  if (modcomp!=NULL) (*modcomp)->show(0,0);
    528528#endif
    529    
     529
    530530  newmodcomp = new intvec(Fl+2);
    531531  //for (j=0;j<Fl;j++) pWrite(F[j]);
     
    668668              omFreeSize((ADDRESS)pairs,(Fl + gencQ)*sizeof(poly));
    669669              for(k=0;k<IDELEMS(result);k++) pDelete(&((*Shdl)[k]));
    670                
     670
    671671              kBucketDestroy(&(sy0buck));
    672672              return result;
     
    735735  delete *modcomp;
    736736  *modcomp = newmodcomp;
    737    
     737
    738738  kBucketDestroy(&(sy0buck));
    739739  return result;
     
    896896      res=newres;
    897897    }
    898      
     898
    899899    if ((hom==isHomog)|| (rHasGlobalOrdering(origR)))
    900900    {
    901901      if (syzIndex==0) syInitSort(res[0],&modcomp);
    902        
     902
    903903      if ((syzIndex==0) && !rRing_has_CompLastBlock(currRing))
    904904        res[syzIndex+1] = sySchreyersSyzygiesFB(res[syzIndex],&modcomp,mW,FALSE);
    905905      else
    906906        res[syzIndex+1] = sySchreyersSyzygiesFB(res[syzIndex],&modcomp,mW);
    907        
     907
    908908      mW = res[syzIndex];
    909909    }
  • kernel/syz1.cc

    re40145 ra9c298  
    19981998    }
    19991999  }
    2000    
     2000
    20012001  int sl=strlen(sn);
    20022002  syPrintEmptySpaces1(sl);
     
    24612461  assume(syzstr->syRing != origR); // why?
    24622462  rChangeCurrRing(syzstr->syRing);
    2463    
     2463
    24642464  // set initial ShiftedComps
    24652465  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
  • kernel/syz2.cc

    re40145 ra9c298  
    8888  while ((l>0) && ((syzstr->resPairs[index])[l-1].lcm==NULL)) l--;
    8989  rr = l-1;
    90   while ((rr>=0) && (((syzstr->resPairs[index])[rr].p==NULL) || 
     90  while ((rr>=0) && (((syzstr->resPairs[index])[rr].p==NULL) ||
    9191        ((syzstr->resPairs[index])[rr].order>actdeg))) rr--;
    92   r2 = rr+1; 
     92  r2 = rr+1;
    9393  while ((rr>=0) && ((syzstr->resPairs[index])[rr].order==actdeg)
    9494         && ((syzstr->resPairs[index])[rr].syzind<0))
     
    123123          if (tcp!=NULL)
    124124          {
    125             while ((tcp!=NULL) && 
     125            while ((tcp!=NULL) &&
    126126              ((tcp->first_poly!=i)||(tcp->second_poly!=r1))) tcp = tcp->next;
    127127          }
     
    134134            j = 0;
    135135            while (j<i)
    136             { 
     136            {
    137137              if (nP->m[j]!=NULL)
    138138              {
     
    175175                      while ((ti<l) && (((syzstr->resPairs[index])[ti].ind1!=j)||
    176176                             ((syzstr->resPairs[index])[ti].ind2!=i))) ti++;
    177                       if (ti<l) 
     177                      if (ti<l)
    178178                      {
    179179#ifdef SHOW_SPRFL
     
    571571  while (kk>=0)
    572572  {
    573     if (toGo==0) 
     573    if (toGo==0)
    574574    {
    575575      while (kk>=0)
     
    617617        q = kBucketGetLm(syzstr->bucket);
    618618        j = 0;
    619         while (j<kres) 
     619        while (j<kres)
    620620        {
    621           if ((redset[j].p!=NULL) && (pLmDivisibleBy(redset[j].p,q)) 
     621          if ((redset[j].p!=NULL) && (pLmDivisibleBy(redset[j].p,q))
    622622              && ((redset[j].ind1!=tso.ind1) || (redset[j].ind2!=tso.ind2)))
    623623          {
     
    761761      i = 0;
    762762      delete spl1;
    763       spl1 = ivStrip(spl2); 
     763      spl1 = ivStrip(spl2);
    764764      delete spl2;
    765765      if (spl1!=NULL)
     
    768768        kk = (*spl1)[i]-1;
    769769      }
    770     } 
     770    }
    771771#endif
    772772#ifdef USE_HEURISTIC2
     
    918918  for (i=1;i<=syzstr->length;i++)
    919919  {
    920     if (!idIs0(syzstr->orderedRes[i])) 
     920    if (!idIs0(syzstr->orderedRes[i]))
    921921    {
    922922      toreor = syzstr->orderedRes[i];
     
    931931        toreor->m[j] = NULL;
    932932      }
    933       m = 0; 
     933      m = 0;
    934934      for (j=0;j<togo;j++)
    935935      {
     
    952952
    953953/*2
    954 * the CoCoA-algorithm for free resolutions, using a formula 
     954* the CoCoA-algorithm for free resolutions, using a formula
    955955* for remaining pairs based on Hilbert-functions
    956956*/
     
    972972    return syzstr;
    973973  }
    974  
     974
    975975  // Creare dp,S ring and change to it
    976976  syzstr->syRing = rAssure_dp_C(origR);
     
    10871087  kBucketDestroy(&(syzstr->bucket));
    10881088  kBucketDestroy(&(syzstr->syz_bucket));
    1089   if (origR != syzstr->syRing) 
     1089  if (origR != syzstr->syRing)
    10901090    rChangeCurrRing(origR);
    10911091  else
  • kernel/syz3.cc

    re40145 ra9c298  
    55* ABSTRACT: resolutions
    66*/
    7  
     7
    88#ifdef HAVE_CONFIG_H
    99#include "singularconfig.h"
     
    2929#include <kernel/timer.h>
    3030#include <polys/matpol.h>
    31  
     31
    3232//#define SHOW_PROT
    3333//#define SHOW_RED
     
    4949int discard_pairs;
    5050int short_pairs;
    51  
    52 /*3 
     51
     52/*3
    5353* assumes the ideals old_ideal and new_ideal to be homogeneous
    5454* tests wether the new_ideal is a regular extension of the old_ideal
     
    6464  int i;
    6565  BOOLEAN isRegular=TRUE;
    66  
     66
    6767  for (i=old_hilbs->length()+deg-1;i>=deg;i--)
    6868    (*shifted_old_hilbs)[i] = (*old_hilbs)[i-deg];
     
    8686  return isRegular;
    8787}
    88  
     88
    8989/*3
    9090* shows the resolution stored in syzstr->orderedRes