source: git/factory/int_poly.h @ 9d7aaa

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