source: git/factory/int_cf.h @ 240392

spielwiese
Last change on this file since 240392 was 240392, checked in by Jens Schmidt <schmidt@…>, 27 years ago
* int_cf.h (class InternalCF): new declaration of ilog2 git-svn-id: file:///usr/local/Singular/svn/trunk@523 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.0 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: int_cf.h,v 1.5 1997-07-16 10:18:23 schmidt Exp $ */
3
4#ifndef INCL_INT_CF_H
5#define INCL_INT_CF_H
6
7#include <config.h>
8
9#ifndef NOSTREAMIO
10#include <iostream.h>
11#endif /* NOSTREAMIO */
12
13#include "assert.h"
14
15#include "cf_defs.h"
16#include "variable.h"
17
18class CanonicalForm;
19
20class InternalCF {
21private:
22    int refCount;
23protected:
24    int getRefCount() { return refCount; };
25    void incRefCount() { refCount++; };
26    int decRefCount() { return --refCount; };
27public:
28    InternalCF() { refCount = 1; };
29    InternalCF( const InternalCF& )
30    {
31        ASSERT( 0, "ups there is something wrong in your code");
32    };
33    virtual ~InternalCF() {};
34    int deleteObject() { return decRefCount() == 0; }
35    InternalCF* copyObject() { incRefCount(); return this; }
36    virtual InternalCF* deepCopyObject() const PVIRT_INTCF("deepCopyObject");
37    virtual const char * const classname() const PVIRT_CHARCC("classname");
38    virtual InternalCF* genZero() PVIRT_INTCF("genZero");
39    virtual InternalCF* genOne() PVIRT_INTCF("genOne");
40    virtual int level() const { return LEVELBASE; }
41    virtual int levelcoeff() const { return UndefinedDomain; }
42    virtual int type() const { return UndefinedDomain; }
43    virtual Variable variable() const { return Variable(); }
44#ifndef NOSTREAMIO
45    virtual void print( ostream&, char* ) PVIRT_VOID("print");
46#endif /* NOSTREAMIO */
47    virtual bool inBaseDomain() const { return true; }
48    virtual bool inExtension() const { return false; }
49    virtual bool inCoeffDomain() const { return true; }
50    virtual bool inPolyDomain() const { return false; }
51    virtual bool inQuotDomain() const { return false; }
52    virtual bool isZero() const PVIRT_BOOL("isZero");
53    virtual bool isOne() const PVIRT_BOOL("isOne");
54    virtual bool isUnivariate() const { return false; }
55    virtual int intval() const;
56    virtual int intmod( int ) const { return 0; }
57    virtual int sign() const;
58
59    virtual InternalCF* num();
60    virtual InternalCF* den();
61
62    virtual InternalCF* neg() PVIRT_INTCF("neg");
63    virtual InternalCF* invert(); // semantically const, changes refCount const
64    virtual int comparesame ( InternalCF* ) PVIRT_INT("comparesame");
65
66    virtual InternalCF* addsame( InternalCF* ) PVIRT_INTCF("addsame");
67    virtual InternalCF* subsame( InternalCF* ) PVIRT_INTCF("subsame");
68    virtual InternalCF* mulsame( InternalCF* ) PVIRT_INTCF("mulsame");
69    virtual InternalCF* dividesame( InternalCF* ) PVIRT_INTCF("dividesame");
70    virtual InternalCF* modulosame( InternalCF* ) PVIRT_INTCF("modulosame");
71    virtual InternalCF* divsame( InternalCF* ) PVIRT_INTCF("divsame");
72    virtual InternalCF* modsame( InternalCF* ) PVIRT_INTCF("modsame");
73    virtual void divremsame( InternalCF*, InternalCF*&, InternalCF*& ) PVIRT_VOID("divremsame");
74    virtual bool divremsamet( InternalCF*, InternalCF*&, InternalCF*& ) PVIRT_BOOL("divremsamet");
75
76    virtual int comparecoeff ( InternalCF* );
77
78    virtual InternalCF* addcoeff( InternalCF* ) PVIRT_INTCF("addcoeff");
79    virtual InternalCF* subcoeff( InternalCF*, bool ) PVIRT_INTCF("subcoeff");
80    virtual InternalCF* mulcoeff( InternalCF* ) PVIRT_INTCF("mulcoeff");
81    virtual InternalCF* dividecoeff( InternalCF*, bool ) PVIRT_INTCF("dividecoeff");
82    virtual InternalCF* modulocoeff( InternalCF*, bool ) PVIRT_INTCF("dividecoeff");
83    virtual InternalCF* divcoeff( InternalCF*, bool ) PVIRT_INTCF("divcoeff");
84    virtual InternalCF* modcoeff( InternalCF*, bool ) PVIRT_INTCF("modcoeff");
85    virtual void divremcoeff( InternalCF*, InternalCF*&, InternalCF*&, bool ) PVIRT_VOID("divremcoeff");
86    virtual bool divremcoefft( InternalCF*, InternalCF*&, InternalCF*&, bool ) PVIRT_BOOL("divremcoefft");
87
88    virtual InternalCF* sqrt();
89    virtual int ilog2();
90    virtual CanonicalForm lc();
91    virtual CanonicalForm LC();
92    virtual CanonicalForm coeff( int i );
93    virtual int degree();
94    virtual int taildegree();
95    virtual CanonicalForm tailcoeff();
96};
97
98#endif /* ! INCL_INT_CF_H */
Note: See TracBrowser for help on using the repository browser.