source: git/libpolys/polys/nc/summator.h @ 98b2b91

spielwiese
Last change on this file since 98b2b91 was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 1.6 KB
Line 
1#ifndef SUMMATOR_H
2#define SUMMATOR_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6
7// #include <summator.h> // for CPolynomialSummator class
8
9#include <polys/monomials/ring.h>
10#include <polys/monomials/p_polys.h>
11
12
13// //////////////////////////////////////////////////////////////////////// //
14// CPolynomialSummator: unifies bucket and polynomial summation as the
15// later is brocken in buckets :(
16#ifdef HAVE_PLURAL
17class CPolynomialSummator
18{
19  private:
20    ring m_basering;
21    bool m_bUsePolynomial;
22    union
23    {
24      sBucket_pt m_bucket;
25      poly       m_poly;
26    } m_temp;
27  public:
28    CPolynomialSummator(ring rBaseRing, bool bUsePolynomial = false);
29//    CPolynomialSummator(ring rBaseRing, poly pInitialSum, int iLength = 0, bool bUsePolynomial = false);
30    ~CPolynomialSummator();
31
32    // adds and destroes the summand
33    void AddAndDelete(poly pSummand, int iLength);
34    void AddAndDelete(poly pSummand);
35
36    inline void operator +=(poly pSummand){ AddAndDelete(pSummand); }
37
38    // only adds and keeps the summand
39    // please use AddAndDelete instead!
40    void Add(poly pSummand, int iLength);
41    void Add(poly pSummand);
42
43    // get the final result and clear (set to zero) the summator
44    poly AddUpAndClear();
45    poly AddUpAndClear(int *piLength);
46
47    inline operator poly() { return AddUpAndClear(); }
48
49    /// Copy constructor
50    CPolynomialSummator(const CPolynomialSummator&);
51
52  private:
53
54    /// no assignment operator yet
55    CPolynomialSummator& operator= (const CPolynomialSummator&);
56};
57
58#endif
59#endif // ifndef  SUMMATOR_H
60
Note: See TracBrowser for help on using the repository browser.