/usr/include/singular/singular/polys/nc/summator.h is in libsingular4-dev-common 1:4.1.0-p3+ds-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #ifndef SUMMATOR_H
#define SUMMATOR_H
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
// #include <polys/nc/summator.h> // for CPolynomialSummator class
#define HAVE_SUMMATOR 1
#ifdef HAVE_SUMMATOR
// struct snumber; typedef struct snumber * number;
class sBucket; typedef sBucket* sBucket_pt;
struct spolyrec; typedef struct spolyrec polyrec; typedef polyrec* poly;
struct ip_sring; typedef struct ip_sring* ring; typedef struct ip_sring const* const_ring;
class kBucket; typedef kBucket* kBucket_pt;
// TODO: redesign into templates with no extra run-time cost!!!
// TODO: make several out of CPolynomialSummator with similar (?) usage
// pattern/interface!!!
// //////////////////////////////////////////////////////////////////////// //
/// CPolynomialSummator: unifies bucket and polynomial summation as the
/// later is brocken in buckets :(
class CPolynomialSummator
{
private:
const ring& m_basering;
const bool m_bUsePolynomial;
union
{
sBucket_pt m_bucket;
// kBucket_pt m_kbucket;
poly m_poly;
} m_temp;
public:
CPolynomialSummator(const ring& rBaseRing, bool bUsePolynomial = false);
// CPolynomialSummator(ring rBaseRing, poly pInitialSum, int iLength = 0, bool bUsePolynomial = false);
~CPolynomialSummator();
// adds and destroes the summand
void AddAndDelete(poly pSummand, int iLength);
void AddAndDelete(poly pSummand);
inline void operator +=(poly pSummand){ AddAndDelete(pSummand); }
// only adds and keeps the summand
// please use AddAndDelete instead!
void Add(poly pSummand, int iLength);
void Add(poly pSummand);
// get the final result and clear (set to zero) the summator
poly AddUpAndClear();
poly AddUpAndClear(int *piLength);
inline operator poly() { return AddUpAndClear(); }
/// Copy constructor
CPolynomialSummator(const CPolynomialSummator&);
private:
/// no assignment operator yet
CPolynomialSummator& operator= (const CPolynomialSummator&);
};
#endif // ifdef HAVE_SUMMATOR
#endif // ifndef SUMMATOR_H
|