source: git/factory/int_poly.h @ d8d9e9

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