source: git/factory/int_poly.h @ 791c0a

spielwiese
Last change on this file since 791c0a was 791c0a, checked in by Jens Schmidt <schmidt@…>, 27 years ago
* int_poly.cc (Lc): new method. Declaration added. git-svn-id: file:///usr/local/Singular/svn/trunk@798 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.7 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: int_poly.h,v 1.4 1997-10-10 10:36:16 schmidt Exp $ */
3
4#ifndef INCL_INT_POLY_H
5#define INCL_INT_POLY_H
6
7#include <config.h>
8
9#ifndef NOSTREAMIO
10#include <iostream.h>
11#endif /* NOSTREAMIO */
12
13#include "cf_defs.h"
14#include "int_cf.h"
15#include "variable.h"
16#include "canonicalform.h"
17
18
19class term {
20private:
21    term * next;
22    CanonicalForm coeff;
23    int exp;
24public:
25    term() : next(0), coeff(0), exp(0) {}
26    term( term * n, const CanonicalForm & c, int e ) : next(n), coeff(c), exp(e) {}
27    friend class InternalPoly;
28    friend class CFIterator;
29};
30
31typedef term * termList;
32
33
34class InternalPoly : public InternalCF {
35private:
36    termList firstTerm, lastTerm;
37    Variable var;
38    InternalPoly( termList, termList, const Variable & );
39
40    static termList copyTermList ( termList, termList&, bool negate = false );
41    static termList deepCopyTermList ( termList, termList& );
42    static void freeTermList ( termList );
43    static void negateTermList ( termList );
44    static termList addTermList ( termList, termList, termList&, bool negate );
45    static void mulTermList ( termList, const CanonicalForm& , const int );
46    static termList divTermList ( termList, const CanonicalForm&, termList& );
47    static termList modTermList ( termList, const CanonicalForm&, termList& );
48    static void appendTermList ( termList&, termList&, const CanonicalForm&, const int );
49    static termList mulAddTermList ( termList theList, termList aList, const CanonicalForm & c, const int exp, termList & lastTerm, bool negate );
50    static termList reduceTermList ( termList first, termList redterms, termList & last );
51public:
52    InternalPoly();
53    InternalPoly( const Variable & v, const int e, const CanonicalForm& c );
54    InternalPoly( const InternalPoly& );
55    ~InternalPoly();
56    InternalCF* deepCopyObject() const;
57    const char * const classname() const { return "InternalPoly"; }
58    int level() const { return var.level(); }
59    Variable variable() const { return var; }
60    int degree();
61    CanonicalForm lc();
62    CanonicalForm Lc();
63    CanonicalForm LC();
64    int taildegree();
65    CanonicalForm tailcoeff();
66    CanonicalForm coeff( int i );
67#ifndef NOSTREAMIO
68    void print( ostream&, char* );
69#endif /* NOSTREAMIO */
70    bool isZero() const { return false; }
71    bool isOne() const { return false; }
72    bool inBaseDomain() const { return false; }
73    bool inExtension() const { return var.level() < 0; }
74    bool inCoeffDomain() const { return var.level() < 0; }
75    bool inPolyDomain() const { return var.level() > 0; }
76    bool inQuotDomain() const { return false; }
77    InternalCF* genZero();
78    InternalCF* genOne();
79
80    bool isUnivariate() const;
81
82    InternalCF* neg();
83    InternalCF* invert();
84
85    int comparesame ( InternalCF* );
86
87    InternalCF* addsame( InternalCF* );
88    InternalCF* subsame( InternalCF* );
89    InternalCF* mulsame( InternalCF* );
90    InternalCF* dividesame( InternalCF* );
91    InternalCF* modulosame( InternalCF* );
92    InternalCF* divsame( InternalCF* );
93    InternalCF* modsame( InternalCF* );
94    void divremsame( InternalCF*, InternalCF*&, InternalCF*& );
95    bool divremsamet( InternalCF*, InternalCF*&, InternalCF*& );
96
97    int comparecoeff ( InternalCF* );
98
99    InternalCF* addcoeff( InternalCF* );
100    InternalCF* subcoeff( InternalCF*, bool );
101    InternalCF* mulcoeff( InternalCF* );
102    InternalCF* dividecoeff( InternalCF*, bool );
103    InternalCF* modulocoeff( InternalCF*, bool );
104    InternalCF* divcoeff( InternalCF*, bool );
105    InternalCF* modcoeff( InternalCF*, bool );
106    void divremcoeff( InternalCF*, InternalCF*&, InternalCF*&, bool );
107    bool divremcoefft( InternalCF*, InternalCF*&, InternalCF*&, bool );
108
109    int sign() const;
110
111    friend class CFIterator;
112};
113
114#endif /* ! INCL_INT_POLY_H */
Note: See TracBrowser for help on using the repository browser.