source: git/factory/int_poly.h @ 05e7d13

spielwiese
Last change on this file since 05e7d13 was 2266ec, checked in by Jens Schmidt <schmidt@…>, 26 years ago
* int_rat.cc, int_int.cc, int_rat.h, int_int.h, int_poly.h (isZero, isOne): methods removed. Declarations adapted. git-svn-id: file:///usr/local/Singular/svn/trunk@2238 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.6 1998-06-26 16:15:08 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 divideTermList ( termList, const CanonicalForm&, termList& );
47    static termList divTermList ( termList, const CanonicalForm&, termList& );
48    static termList modTermList ( termList, const CanonicalForm&, termList& );
49    static void appendTermList ( termList&, termList&, const CanonicalForm&, const int );
50    static termList mulAddTermList ( termList theList, termList aList, const CanonicalForm & c, const int exp, termList & lastTerm, bool negate );
51    static termList reduceTermList ( termList first, termList redterms, termList & last );
52public:
53    InternalPoly();
54    InternalPoly( const Variable & v, const int e, const CanonicalForm& c );
55    InternalPoly( const InternalPoly& );
56    ~InternalPoly();
57    InternalCF* deepCopyObject() const;
58    const char * const classname() const { return "InternalPoly"; }
59    int level() const { return var.level(); }
60    Variable variable() const { return var; }
61    int degree();
62    CanonicalForm lc();
63    CanonicalForm Lc();
64    CanonicalForm LC();
65    int taildegree();
66    CanonicalForm tailcoeff();
67    CanonicalForm coeff( int i );
68#ifndef NOSTREAMIO
69    void print( ostream&, char* );
70#endif /* NOSTREAMIO */
71    bool inBaseDomain() const { return false; }
72    bool inExtension() const { return var.level() < 0; }
73    bool inCoeffDomain() const { return var.level() < 0; }
74    bool inPolyDomain() const { return var.level() > 0; }
75    bool inQuotDomain() const { return false; }
76    InternalCF* genZero();
77    InternalCF* genOne();
78
79    bool isUnivariate() const;
80
81    InternalCF* neg();
82    InternalCF* invert();
83
84    int comparesame ( InternalCF* );
85
86    InternalCF* addsame( InternalCF* );
87    InternalCF* subsame( InternalCF* );
88    InternalCF* mulsame( InternalCF* );
89    InternalCF* dividesame( InternalCF* );
90    InternalCF* modulosame( InternalCF* );
91    InternalCF* divsame( InternalCF* );
92    InternalCF* modsame( InternalCF* );
93    void divremsame( InternalCF*, InternalCF*&, InternalCF*& );
94    bool divremsamet( InternalCF*, InternalCF*&, InternalCF*& );
95
96    int comparecoeff ( InternalCF* );
97
98    InternalCF* addcoeff( InternalCF* );
99    InternalCF* subcoeff( InternalCF*, bool );
100    InternalCF* mulcoeff( InternalCF* );
101    InternalCF* dividecoeff( InternalCF*, bool );
102    InternalCF* modulocoeff( InternalCF*, bool );
103    InternalCF* divcoeff( InternalCF*, bool );
104    InternalCF* modcoeff( InternalCF*, bool );
105    void divremcoeff( InternalCF*, InternalCF*&, InternalCF*&, bool );
106    bool divremcoefft( InternalCF*, InternalCF*&, InternalCF*&, bool );
107
108    int sign() const;
109
110    friend class CFIterator;
111};
112
113#endif /* ! INCL_INT_POLY_H */
Note: See TracBrowser for help on using the repository browser.