source: git/factory/int_cf.h @ d54166

fieker-DuValspielwiese
Last change on this file since d54166 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: 4.2 KB
Line 
1// emacs edit mode for this file is -*- C++ -*-
2// $Id: int_cf.h,v 1.2 1997-04-15 09:10:59 schmidt Exp $
3
4#ifndef INCL_INTERNALCF_H
5#define INCL_INTERNALCF_H
6
7/*
8$Log: not supported by cvs2svn $
9Revision 1.1  1997/03/27 10:04:57  schmidt
10stream-io wrapped by NOSTREAMIO
11debug output changed to ASSERT
12PVIRT fucntionality moved to assert.h
13
14Revision 1.0  1996/05/17 10:59:41  stobbe
15Initial revision
16
17*/
18
19#include <config.h>
20
21#ifndef NOSTREAMIO
22#include <iostream.h>
23#endif /* NOSTREAMIO */
24
25#include "assert.h"
26
27#include "cf_defs.h"
28#include "variable.h"
29
30class CanonicalForm;
31
32class InternalCF {
33private:
34    int refCount;
35protected:
36    int getRefCount() { return refCount; };
37    void incRefCount() { refCount++; };
38    int decRefCount() { return --refCount; };
39public:
40    InternalCF() { refCount = 1; };
41    InternalCF( const InternalCF& )
42    {
43        ASSERT( 0, "ups there is something wrong in your code");
44    };
45    virtual ~InternalCF() {};
46    int deleteObject() { return decRefCount() == 0; }
47    InternalCF* copyObject() { incRefCount(); return this; }
48    virtual InternalCF* deepCopyObject() const PVIRT_INTCF("deepCopyObject");
49    virtual const char * const classname() const PVIRT_CHARCC("classname");
50    virtual InternalCF* genZero() PVIRT_INTCF("genZero");
51    virtual InternalCF* genOne() PVIRT_INTCF("genOne");
52    virtual int level() const { return LEVELBASE; }
53    virtual int levelcoeff() const { return UndefinedDomain; }
54    virtual int type() const { return UndefinedDomain; }
55    virtual Variable variable() const { return Variable(); }
56#ifndef NOSTREAMIO
57    virtual void print( ostream&, char* ) PVIRT_VOID("print");
58#endif /* NOSTREAMIO */
59    virtual bool inBaseDomain() const { return true; }
60    virtual bool inExtension() const { return false; }
61    virtual bool inCoeffDomain() const { return true; }
62    virtual bool inPolyDomain() const { return false; }
63    virtual bool inQuotDomain() const { return false; }
64    virtual bool isZero() const PVIRT_BOOL("isZero");
65    virtual bool isOne() const PVIRT_BOOL("isOne");
66    virtual bool isUnivariate() const { return false; }
67    virtual int intval() const;
68    virtual int intmod( int ) const { return 0; }
69    virtual int sign() const;
70
71    virtual InternalCF* num();
72    virtual InternalCF* den();
73
74    virtual InternalCF* neg() PVIRT_INTCF("neg");
75    virtual InternalCF* invert(); // semantically const, changes refCount const
76    virtual int comparesame ( InternalCF* ) PVIRT_INT("comparesame");
77
78    virtual InternalCF* addsame( InternalCF* ) PVIRT_INTCF("addsame");
79    virtual InternalCF* subsame( InternalCF* ) PVIRT_INTCF("subsame");
80    virtual InternalCF* mulsame( InternalCF* ) PVIRT_INTCF("mulsame");
81    virtual InternalCF* dividesame( InternalCF* ) PVIRT_INTCF("dividesame");
82    virtual InternalCF* modulosame( InternalCF* ) PVIRT_INTCF("modulosame");
83    virtual InternalCF* divsame( InternalCF* ) PVIRT_INTCF("divsame");
84    virtual InternalCF* modsame( InternalCF* ) PVIRT_INTCF("modsame");
85    virtual void divremsame( InternalCF*, InternalCF*&, InternalCF*& ) PVIRT_VOID("divremsame");
86    virtual bool divremsamet( InternalCF*, InternalCF*&, InternalCF*& ) PVIRT_BOOL("divremsamet");
87
88    virtual int comparecoeff ( InternalCF* );
89
90    virtual InternalCF* addcoeff( InternalCF* ) PVIRT_INTCF("addcoeff");
91    virtual InternalCF* subcoeff( InternalCF*, bool ) PVIRT_INTCF("subcoeff");
92    virtual InternalCF* mulcoeff( InternalCF* ) PVIRT_INTCF("mulcoeff");
93    virtual InternalCF* dividecoeff( InternalCF*, bool ) PVIRT_INTCF("dividecoeff");
94    virtual InternalCF* modulocoeff( InternalCF*, bool ) PVIRT_INTCF("dividecoeff");
95    virtual InternalCF* divcoeff( InternalCF*, bool ) PVIRT_INTCF("divcoeff");
96    virtual InternalCF* modcoeff( InternalCF*, bool ) PVIRT_INTCF("modcoeff");
97    virtual void divremcoeff( InternalCF*, InternalCF*&, InternalCF*&, bool ) PVIRT_VOID("divremcoeff");
98    virtual bool divremcoefft( InternalCF*, InternalCF*&, InternalCF*&, bool ) PVIRT_BOOL("divremcoefft");
99
100    virtual InternalCF* sqrt();
101    virtual CanonicalForm lc();
102    virtual CanonicalForm LC();
103    virtual CanonicalForm coeff( int i );
104    virtual int degree();
105    virtual int taildegree();
106    virtual CanonicalForm tailcoeff();
107};
108
109#define OBJDEL( x ) if ( (x)->deleteObject() ) delete (x)
110
111#endif /* INCL_INTERNALCF_H */
Note: See TracBrowser for help on using the repository browser.