Ignore:
Timestamp:
Sep 24, 2014, 1:05:36 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
65a40710c408315804772d0a7ff078203be9d9bf
Parents:
46f37cb57098799d8399fc704c5b3ca2020ca0c1
Message:
format
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/PolyEnumerator.h

    r46f37cb rfea494  
    11// -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    22/*****************************************************************************\
    3  * Computer Algebra System SINGULAR   
     3 * Computer Algebra System SINGULAR
    44\*****************************************************************************/
    55/** @file PolyEnumerator.h
    6  * 
     6 *
    77 * Concrete implementation of enumerators over polynomials
    88 *
     
    2222
    2323/** @class CBasePolyEnumerator
    24  * 
     24 *
    2525 * Base polynomial enumerator for simple iteration over terms of polynomials.
    2626 *
    2727 * Note that the first element desn't exist directly after Reset() call.
    28  * 
     28 *
    2929 * The class doesn't inherit from IAccessor and thus doesn't override Current().
    3030 *
     
    3737  private:
    3838    poly m_poly; ///< essentially immutable original iterable object
    39    
     39
    4040    static const spolyrec m_prevposition_struct; ///< tag for "-1" position
    4141
     
    5656      m_poly = p;
    5757      m_position = const_cast<poly>(&m_prevposition_struct);
    58       assume( !IsValid() ); 
     58      assume( !IsValid() );
    5959    }
    6060
     
    6363        IBaseEnumerator(), m_poly(p), m_position(const_cast<poly>(&m_prevposition_struct))
    6464    {
    65       assume( !IsValid() ); 
    66     }
    67    
     65      assume( !IsValid() );
     66    }
     67
    6868    /// Sets the position marker to the leading term.
    6969    virtual void Reset()
    7070    {
    7171      m_position = const_cast<poly>(&m_prevposition_struct);
    72       assume( !IsValid() ); 
     72      assume( !IsValid() );
    7373    }
    7474
     
    9393        }
    9494      }
    95      
     95
    9696      if (m_position == &m_prevposition_struct) // -1 position?
    9797      {
     
    114114
    115115/** @class CPolyCoeffsEnumerator
    116  * 
     116 *
    117117 * This is a polynomial enumerator for simple iteration over
    118118 * coefficients of polynomials.
    119  * 
     119 *
    120120 * It is required to inherit this class from IEnumerator<number> for
    121121 * its use in coeffs and implement IAccessor<number> interface.
     
    131131  public:
    132132    CPolyCoeffsEnumerator(poly p): CBasePolyEnumerator(p) {}
    133    
     133
    134134    /// Gets the current element in the collection (read and write).
    135135    virtual IPolyCoeffsEnumerator::reference Current()
    136136    {
    137137      assume( IsValid() );
    138       return pGetCoeff(m_position);     
     138      return pGetCoeff(m_position);
    139139    }
    140140
     
    169169    {
    170170      return m_global_enumerator.IsValid() &&  m_local_enumerator.IsValid();
    171     }   
    172    
     171    }
     172
    173173  public:
    174    
     174
    175175    /// NOTE: carefull: don't destruct the input enumerator before doing it with this one...
    176176    /// this also changes the original IPolyCoeffsEnumerator& itr!
     
    198198      assume( FALSE ); return MoveNext(); // this should not happen as p should be non-zero, but just in case...
    199199    }
    200    
     200
    201201    virtual void Reset()
    202202    {
     
    221221
    222222
    223 #endif 
     223#endif
    224224/* #ifndef POLYENUMERATOR_H */
    225225
Note: See TracChangeset for help on using the changeset viewer.