My Project
Loading...
Searching...
No Matches
int_cf.h
Go to the documentation of this file.
1/* emacs edit mode for this file is -*- C++ -*- */
2
3/**
4 * @file int_cf.h
5 *
6 * Factory's internal CanonicalForm's
7**/
8#ifndef INCL_INT_CF_H
9#define INCL_INT_CF_H
10
11// #include "config.h"
12
13#ifndef NOSTREAMIO
14#ifdef HAVE_IOSTREAM
15#include <iostream>
16#define OSTREAM std::ostream
17#elif defined(HAVE_IOSTREAM_H)
18#include <iostream.h>
19#define OSTREAM ostream
20#endif
21#endif /* NOSTREAMIO */
22
23#include "cf_assert.h"
24
25#include "cf_defs.h"
26#include "variable.h"
27
28#ifdef HAVE_OMALLOC
29#ifndef XMEMORY_H
31#endif
32#endif
33
34class CanonicalForm;
35
36/**
37 * virtual class for internal CanonicalForm's
38 *
39 * InternalCF will become an InternalPoly, InternalInteger, InternalRational
40**/
42#ifdef HAVE_OMALLOC
43#ifndef XMEMORY_H
44 : public omallocClass
45#endif
46#endif
47{
48private:
50protected:
51 int getRefCount() { return refCount; };
52 void incRefCount() { refCount++; };
53 int decRefCount() { return --refCount; };
54public:
55 InternalCF() { refCount = 1; };
57 {
58 ASSERT( 0, "ups there is something wrong in your code");
59 };
60 virtual ~InternalCF() {};
61 int deleteObject() { return decRefCount() == 0; }
62 InternalCF* copyObject() { incRefCount(); return this; }
67 virtual int level() const { return LEVELBASE; }
68 virtual int levelcoeff() const { return UndefinedDomain; }
69 virtual int type() const { return UndefinedDomain; }
70 virtual Variable variable() const { return Variable(); }
71#ifndef NOSTREAMIO
72 virtual void print( OSTREAM&, char* ) PVIRT_VOID("print");
73#endif /* NOSTREAMIO */
74 virtual bool inBaseDomain() const { return true; }
75 virtual bool inExtension() const { return false; }
76 virtual bool inCoeffDomain() const { return true; }
77 virtual bool inPolyDomain() const { return false; }
78 virtual bool inQuotDomain() const { return false; }
79 virtual bool isZero() const;
80 virtual bool isOne() const;
81 virtual bool isUnivariate() const { return false; }
82 virtual long intval() const;
83 virtual int intmod( int ) const { return 0; }
84 virtual int sign() const PVIRT_INT("sign");
85
86 virtual InternalCF* num();
87 virtual InternalCF* den();
88
90 virtual InternalCF* invert(); // semantically const, changes refCount
91 virtual InternalCF* tryInvert( const CanonicalForm&, bool& );
94
102 virtual InternalCF* tryDivsame ( InternalCF* , const CanonicalForm&, bool& );
106 virtual bool tryDivremsamet ( InternalCF*, InternalCF*&, InternalCF*&, const CanonicalForm&, bool& );
107
112 virtual InternalCF* tryDividecoeff ( InternalCF*, bool, const CanonicalForm&, bool& );
115 virtual InternalCF* tryDivcoeff ( InternalCF*, bool, const CanonicalForm&, bool& );
119 virtual bool tryDivremcoefft( InternalCF*, InternalCF*&, InternalCF*&, bool, const CanonicalForm&, bool& );
120
122 virtual InternalCF * bgcdcoeff ( const InternalCF * const ); // semantically const, changes refcount
123
124 virtual InternalCF * bextgcdsame ( InternalCF *, CanonicalForm &, CanonicalForm & ); // semantically const, changes refcount
125 virtual InternalCF * bextgcdcoeff ( InternalCF *, CanonicalForm &, CanonicalForm & ); // semantically const, changes refcount
126
127 virtual InternalCF* sqrt();
128 virtual int ilog2();
129 virtual CanonicalForm lc();
130 virtual CanonicalForm Lc();
131 virtual CanonicalForm LC();
132 virtual CanonicalForm coeff( int i );
133 virtual int degree();
134 virtual int taildegree();
135 virtual CanonicalForm tailcoeff();
136};
137
138#endif /* ! INCL_INT_CF_H */
int i
Definition: cfEzgcd.cc:132
assertions for Factory
#define PVIRT_CHARCC(msg)
Definition: cf_assert.h:125
#define PVIRT_INT(msg)
Definition: cf_assert.h:123
#define PVIRT_INTCF(msg)
Definition: cf_assert.h:119
#define PVIRT_BOOL(msg)
Definition: cf_assert.h:121
#define ASSERT(expression, message)
Definition: cf_assert.h:99
#define PVIRT_VOID(msg)
Definition: cf_assert.h:117
factory switches.
#define LEVELBASE
Definition: cf_defs.h:25
#define UndefinedDomain
Definition: cf_defs.h:16
factory's main class
Definition: canonicalform.h:86
virtual class for internal CanonicalForm's
Definition: int_cf.h:47
virtual InternalCF * tryMulsame(InternalCF *, const CanonicalForm &)
Definition: int_cf.cc:179
virtual int intmod(int) const
Definition: int_cf.h:83
virtual InternalCF * addcoeff(InternalCF *) PVIRT_INTCF("addcoeff")
InternalCF * copyObject()
Definition: int_cf.h:62
virtual CanonicalForm Lc()
Definition: int_cf.cc:40
virtual InternalCF * tryDivcoeff(InternalCF *, bool, const CanonicalForm &, bool &)
Definition: int_cf.cc:214
virtual InternalCF * modulosame(InternalCF *) PVIRT_INTCF("modulosame")
virtual void divremcoeff(InternalCF *, InternalCF *&, InternalCF *&, bool) PVIRT_VOID("divremcoeff")
virtual ~InternalCF()
Definition: int_cf.h:60
virtual InternalCF * addsame(InternalCF *) PVIRT_INTCF("addsame")
virtual CanonicalForm tailcoeff()
CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree ()
Definition: int_cf.cc:67
virtual InternalCF * divsame(InternalCF *) PVIRT_INTCF("divsame")
virtual bool inPolyDomain() const
Definition: int_cf.h:77
virtual CanonicalForm lc()
CanonicalForm InternalCF::lc (), Lc (), LC ()
Definition: int_cf.cc:34
virtual InternalCF * mulcoeff(InternalCF *) PVIRT_INTCF("mulcoeff")
virtual const char * classname() const PVIRT_CHARCC("classname")
InternalCF()
Definition: int_cf.h:55
virtual bool tryDivremsamet(InternalCF *, InternalCF *&, InternalCF *&, const CanonicalForm &, bool &)
Definition: int_cf.cc:193
virtual InternalCF * subsame(InternalCF *) PVIRT_INTCF("subsame")
virtual InternalCF * tryDividecoeff(InternalCF *, bool, const CanonicalForm &, bool &)
Definition: int_cf.cc:221
virtual InternalCF * divcoeff(InternalCF *, bool) PVIRT_INTCF("divcoeff")
virtual InternalCF * subcoeff(InternalCF *, bool) PVIRT_INTCF("subcoeff")
virtual long intval() const
Definition: int_cf.cc:165
virtual InternalCF * dividecoeff(InternalCF *, bool) PVIRT_INTCF("dividecoeff")
virtual bool isZero() const
Definition: int_cf.cc:24
int getRefCount()
Definition: int_cf.h:51
void incRefCount()
Definition: int_cf.h:52
virtual InternalCF * tryInvert(const CanonicalForm &, bool &)
Definition: int_cf.cc:186
virtual bool inExtension() const
Definition: int_cf.h:75
virtual InternalCF * genOne() PVIRT_INTCF("genOne")
virtual void print(OSTREAM &, char *) PVIRT_VOID("print")
virtual int levelcoeff() const
Definition: int_cf.h:68
virtual int degree()
int InternalCF::degree ()
Definition: int_cf.cc:55
virtual InternalCF * bextgcdsame(InternalCF *, CanonicalForm &, CanonicalForm &)
InternalCF * InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b )
Definition: int_cf.cc:149
virtual int ilog2()
int InternalCF::ilog2 ()
Definition: int_cf.cc:110
virtual int comparesame(InternalCF *) PVIRT_INT("comparesame")
InternalCF(const InternalCF &)
Definition: int_cf.h:56
virtual bool inCoeffDomain() const
Definition: int_cf.h:76
virtual CanonicalForm LC()
Definition: int_cf.cc:46
virtual InternalCF * modsame(InternalCF *) PVIRT_INTCF("modsame")
virtual InternalCF * num()
InternalCF * InternalCF::num (), den ()
Definition: int_cf.cc:85
int decRefCount()
Definition: int_cf.h:53
virtual int comparecoeff(InternalCF *) PVIRT_INT("comparecoeff")
virtual InternalCF * den()
Definition: int_cf.cc:91
virtual Variable variable() const
Definition: int_cf.h:70
virtual InternalCF * sqrt()
InternalCF * InternalCF::sqrt ()
Definition: int_cf.cc:100
virtual bool tryDivremcoefft(InternalCF *, InternalCF *&, InternalCF *&, bool, const CanonicalForm &, bool &)
Definition: int_cf.cc:200
virtual int sign() const PVIRT_INT("sign")
virtual bool inBaseDomain() const
Definition: int_cf.h:74
virtual InternalCF * invert()
Definition: int_cf.cc:172
virtual InternalCF * dividesame(InternalCF *) PVIRT_INTCF("dividesame")
virtual InternalCF * deepCopyObject() const PVIRT_INTCF("deepCopyObject")
virtual InternalCF * modulocoeff(InternalCF *, bool) PVIRT_INTCF("dividecoeff")
int deleteObject()
Definition: int_cf.h:61
virtual InternalCF * tryDivsame(InternalCF *, const CanonicalForm &, bool &)
Definition: int_cf.cc:207
virtual InternalCF * bgcdsame(const InternalCF *const) const
InternalCF * InternalCF::bgcdsame, bgcdcoeff ( const InternalCF * const )
Definition: int_cf.cc:132
virtual CanonicalForm coeff(int i)
CanonicalForm InternalCF::coeff ( int i )
Definition: int_cf.cc:120
virtual int level() const
Definition: int_cf.h:67
virtual void divremsame(InternalCF *, InternalCF *&, InternalCF *&) PVIRT_VOID("divremsame")
virtual bool isUnivariate() const
Definition: int_cf.h:81
int refCount
Definition: int_cf.h:49
virtual bool inQuotDomain() const
Definition: int_cf.h:78
virtual bool divremcoefft(InternalCF *, InternalCF *&, InternalCF *&, bool) PVIRT_BOOL("divremcoefft")
virtual int type() const
Definition: int_cf.h:69
virtual InternalCF * modcoeff(InternalCF *, bool) PVIRT_INTCF("modcoeff")
virtual InternalCF * genZero() PVIRT_INTCF("genZero")
virtual InternalCF * bextgcdcoeff(InternalCF *, CanonicalForm &, CanonicalForm &)
Definition: int_cf.cc:157
virtual bool isOne() const
bool InternalCF::isOne, isZero () const
Definition: int_cf.cc:18
virtual InternalCF * bgcdcoeff(const InternalCF *const)
Definition: int_cf.cc:139
virtual int taildegree()
Definition: int_cf.cc:73
virtual InternalCF * neg() PVIRT_INTCF("neg")
virtual InternalCF * mulsame(InternalCF *) PVIRT_INTCF("mulsame")
virtual bool divremsamet(InternalCF *, InternalCF *&, InternalCF *&) PVIRT_BOOL("divremsamet")
factory's class for variables
Definition: variable.h:33
#define const
Definition: fegetopt.c:39
#define OSTREAM
Definition: int_cf.h:16
operations on variables