My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
libpolys
polys
nc
summator.h
Go to the documentation of this file.
1
#ifndef SUMMATOR_H
2
#define SUMMATOR_H
3
/****************************************
4
* Computer Algebra System SINGULAR *
5
****************************************/
6
7
#define HAVE_SUMMATOR 1
8
9
#ifdef HAVE_SUMMATOR
10
#include "
polys/monomials/ring.h
"
11
#include "
polys/sbuckets.h
"
12
13
// TODO: redesign into templates with no extra run-time cost!!!
14
// TODO: make several out of CPolynomialSummator with similar (?) usage
15
// pattern/interface!!!
16
17
// //////////////////////////////////////////////////////////////////////// //
18
/// CPolynomialSummator: unifies bucket and polynomial summation as the
19
/// later is broken in buckets :(
20
class
CPolynomialSummator
21
{
22
private
:
23
const
ring&
m_basering
;
24
const
bool
m_bUsePolynomial
;
25
union
26
{
27
sBucket_pt
m_bucket;
28
// kBucket_pt m_kbucket;
29
poly m_poly;
30
}
m_temp
;
31
public
:
32
CPolynomialSummator
(
const
ring& rBaseRing,
bool
bUsePolynomial =
false
);
33
// CPolynomialSummator(ring rBaseRing, poly pInitialSum, int iLength = 0, bool bUsePolynomial = false);
34
~CPolynomialSummator
();
35
36
// adds and destroes the summand
37
void
AddAndDelete
(poly pSummand,
int
iLength);
38
void
AddAndDelete
(poly pSummand);
39
40
inline
void
operator +=
(poly pSummand){
AddAndDelete
(pSummand); }
41
42
// only adds and keeps the summand
43
// please use AddAndDelete instead!
44
void
Add
(poly pSummand,
int
iLength);
45
void
Add
(poly pSummand);
46
47
// get the final result and clear (set to zero) the summator
48
poly
AddUpAndClear
();
49
poly
AddUpAndClear
(
int
*piLength);
50
51
inline
operator
poly() {
return
AddUpAndClear
(); }
52
53
/// Copy constructor
54
CPolynomialSummator
(
const
CPolynomialSummator
&);
55
private
:
56
57
/// no assignment operator yet
58
CPolynomialSummator
&
operator=
(
const
CPolynomialSummator
&);
59
};
60
61
#endif
// ifdef HAVE_SUMMATOR
62
#endif
// ifndef SUMMATOR_H
63
CPolynomialSummator
CPolynomialSummator: unifies bucket and polynomial summation as the later is broken in buckets :(.
Definition
summator.h:21
CPolynomialSummator::m_basering
const ring & m_basering
Definition
summator.h:23
CPolynomialSummator::AddAndDelete
void AddAndDelete(poly pSummand, int iLength)
Definition
summator.cc:100
CPolynomialSummator::Add
void Add(poly pSummand, int iLength)
Definition
summator.cc:173
CPolynomialSummator::operator=
CPolynomialSummator & operator=(const CPolynomialSummator &)
no assignment operator yet
CPolynomialSummator::AddUpAndClear
poly AddUpAndClear()
Definition
summator.cc:124
CPolynomialSummator::m_temp
union CPolynomialSummator::@171202203372044306230374236371043003006056160311 m_temp
CPolynomialSummator::m_bUsePolynomial
const bool m_bUsePolynomial
Definition
summator.h:24
CPolynomialSummator::~CPolynomialSummator
~CPolynomialSummator()
Definition
summator.cc:71
CPolynomialSummator::CPolynomialSummator
CPolynomialSummator(const ring &rBaseRing, bool bUsePolynomial=false)
Definition
summator.cc:34
CPolynomialSummator::operator+=
void operator+=(poly pSummand)
Definition
summator.h:40
ring.h
sbuckets.h
sBucket_pt
sBucket * sBucket_pt
Definition
sbuckets.h:16
Generated on
for My Project by
doxygen 1.17.0
for
Singular