My Project
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes
InternalCF Class Reference

virtual class for internal CanonicalForm's More...

#include <int_cf.h>

Public Member Functions

 InternalCF ()
 
 InternalCF (const InternalCF &)
 
virtual ~InternalCF ()
 
int deleteObject ()
 
InternalCFcopyObject ()
 
virtual InternalCFdeepCopyObject () const PVIRT_INTCF("deepCopyObject")
 
virtual const char * classname () const PVIRT_CHARCC("classname")
 
virtual InternalCFgenZero () PVIRT_INTCF("genZero")
 
virtual InternalCFgenOne () PVIRT_INTCF("genOne")
 
virtual int level () const
 
virtual int levelcoeff () const
 
virtual int type () const
 
virtual Variable variable () const
 
virtual void print (OSTREAM &, char *) PVIRT_VOID("print")
 
virtual bool inBaseDomain () const
 
virtual bool inExtension () const
 
virtual bool inCoeffDomain () const
 
virtual bool inPolyDomain () const
 
virtual bool inQuotDomain () const
 
virtual bool isZero () const
 
virtual bool isOne () const
 bool InternalCF::isOne, isZero () const More...
 
virtual bool isUnivariate () const
 
virtual long intval () const
 
virtual int intmod (int) const
 
virtual int sign () const PVIRT_INT("sign")
 
virtual InternalCFnum ()
 InternalCF * InternalCF::num (), den () More...
 
virtual InternalCFden ()
 
virtual InternalCFneg () PVIRT_INTCF("neg")
 
virtual InternalCFinvert ()
 
virtual InternalCFtryInvert (const CanonicalForm &, bool &)
 
virtual int comparesame (InternalCF *) PVIRT_INT("comparesame")
 
virtual int comparecoeff (InternalCF *) PVIRT_INT("comparecoeff")
 
virtual InternalCFaddsame (InternalCF *) PVIRT_INTCF("addsame")
 
virtual InternalCFsubsame (InternalCF *) PVIRT_INTCF("subsame")
 
virtual InternalCFmulsame (InternalCF *) PVIRT_INTCF("mulsame")
 
virtual InternalCFtryMulsame (InternalCF *, const CanonicalForm &)
 
virtual InternalCFdividesame (InternalCF *) PVIRT_INTCF("dividesame")
 
virtual InternalCFmodulosame (InternalCF *) PVIRT_INTCF("modulosame")
 
virtual InternalCFdivsame (InternalCF *) PVIRT_INTCF("divsame")
 
virtual InternalCFtryDivsame (InternalCF *, const CanonicalForm &, bool &)
 
virtual InternalCFmodsame (InternalCF *) PVIRT_INTCF("modsame")
 
virtual void divremsame (InternalCF *, InternalCF *&, InternalCF *&) PVIRT_VOID("divremsame")
 
virtual bool divremsamet (InternalCF *, InternalCF *&, InternalCF *&) PVIRT_BOOL("divremsamet")
 
virtual bool tryDivremsamet (InternalCF *, InternalCF *&, InternalCF *&, const CanonicalForm &, bool &)
 
virtual InternalCFaddcoeff (InternalCF *) PVIRT_INTCF("addcoeff")
 
virtual InternalCFsubcoeff (InternalCF *, bool) PVIRT_INTCF("subcoeff")
 
virtual InternalCFmulcoeff (InternalCF *) PVIRT_INTCF("mulcoeff")
 
virtual InternalCFdividecoeff (InternalCF *, bool) PVIRT_INTCF("dividecoeff")
 
virtual InternalCFtryDividecoeff (InternalCF *, bool, const CanonicalForm &, bool &)
 
virtual InternalCFmodulocoeff (InternalCF *, bool) PVIRT_INTCF("dividecoeff")
 
virtual InternalCFdivcoeff (InternalCF *, bool) PVIRT_INTCF("divcoeff")
 
virtual InternalCFtryDivcoeff (InternalCF *, bool, const CanonicalForm &, bool &)
 
virtual InternalCFmodcoeff (InternalCF *, bool) PVIRT_INTCF("modcoeff")
 
virtual void divremcoeff (InternalCF *, InternalCF *&, InternalCF *&, bool) PVIRT_VOID("divremcoeff")
 
virtual bool divremcoefft (InternalCF *, InternalCF *&, InternalCF *&, bool) PVIRT_BOOL("divremcoefft")
 
virtual bool tryDivremcoefft (InternalCF *, InternalCF *&, InternalCF *&, bool, const CanonicalForm &, bool &)
 
virtual InternalCFbgcdsame (const InternalCF *const) const
 InternalCF * InternalCF::bgcdsame, bgcdcoeff ( const InternalCF * const ) More...
 
virtual InternalCFbgcdcoeff (const InternalCF *const)
 
virtual InternalCFbextgcdsame (InternalCF *, CanonicalForm &, CanonicalForm &)
 InternalCF * InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b ) More...
 
virtual InternalCFbextgcdcoeff (InternalCF *, CanonicalForm &, CanonicalForm &)
 
virtual InternalCFsqrt ()
 InternalCF * InternalCF::sqrt () More...
 
virtual int ilog2 ()
 int InternalCF::ilog2 () More...
 
virtual CanonicalForm lc ()
 CanonicalForm InternalCF::lc (), Lc (), LC () More...
 
virtual CanonicalForm Lc ()
 
virtual CanonicalForm LC ()
 
virtual CanonicalForm coeff (int i)
 CanonicalForm InternalCF::coeff ( int i ) More...
 
virtual int degree ()
 int InternalCF::degree () More...
 
virtual int taildegree ()
 
virtual CanonicalForm tailcoeff ()
 CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree () More...
 
- Public Member Functions inherited from omallocClass
void * operator new (size_t size) throw (std::bad_alloc)
 
void operator delete (void *block) throw ()
 
void * operator new[] (size_t size) throw (std::bad_alloc)
 
void operator delete[] (void *block) throw ()
 
void * operator new (size_t size, const std::nothrow_t &) throw ()
 
void * operator new[] (size_t size, const std::nothrow_t &) throw ()
 

Protected Member Functions

int getRefCount ()
 
void incRefCount ()
 
int decRefCount ()
 

Private Attributes

int refCount
 

Detailed Description

virtual class for internal CanonicalForm's

InternalCF will become an InternalPoly, InternalInteger, InternalRational

Definition at line 41 of file int_cf.h.

Constructor & Destructor Documentation

◆ InternalCF() [1/2]

InternalCF::InternalCF ( )
inline

Definition at line 55 of file int_cf.h.

55{ refCount = 1; };
int refCount
Definition: int_cf.h:49

◆ InternalCF() [2/2]

InternalCF::InternalCF ( const InternalCF )
inline

Definition at line 56 of file int_cf.h.

57 {
58 ASSERT( 0, "ups there is something wrong in your code");
59 };
#define ASSERT(expression, message)
Definition: cf_assert.h:99

◆ ~InternalCF()

virtual InternalCF::~InternalCF ( )
inlinevirtual

Definition at line 60 of file int_cf.h.

60{};

Member Function Documentation

◆ addcoeff()

virtual InternalCF * InternalCF::addcoeff ( InternalCF )
virtual

◆ addsame()

virtual InternalCF * InternalCF::addsame ( InternalCF )
virtual

◆ bextgcdcoeff()

InternalCF * InternalCF::bextgcdcoeff ( InternalCF ,
CanonicalForm a,
CanonicalForm b 
)
virtual

Reimplemented in InternalInteger, and InternalRational.

Definition at line 157 of file int_cf.cc.

158{
159 ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() );
160 a = 0; b = 0;
161 return CFFactory::basic( 0 );
162}
CanonicalForm b
Definition: cfModGcd.cc:4103
#define ASSERT1(expression, message, parameter1)
Definition: cf_assert.h:101
static InternalCF * basic(int value)
Definition: cf_factory.cc:61
virtual const char * classname() const PVIRT_CHARCC("classname")

◆ bextgcdsame()

InternalCF * InternalCF::bextgcdsame ( InternalCF ,
CanonicalForm a,
CanonicalForm b 
)
virtual

InternalCF * InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b )

See also
CanonicalForm::bextgcd()

Reimplemented in InternalInteger, and InternalRational.

Definition at line 149 of file int_cf.cc.

150{
151 ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() );
152 a = 0; b = 0;
153 return CFFactory::basic( 0 );
154}

◆ bgcdcoeff()

InternalCF * InternalCF::bgcdcoeff ( const InternalCF * const  )
virtual

Reimplemented in InternalInteger, and InternalRational.

Definition at line 139 of file int_cf.cc.

140{
141 ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() );
142 return CFFactory::basic( 0 );
143}

◆ bgcdsame()

InternalCF * InternalCF::bgcdsame ( const InternalCF * const  ) const
virtual

InternalCF * InternalCF::bgcdsame, bgcdcoeff ( const InternalCF * const )

See also
CanonicalForm::bgcd()

Reimplemented in InternalInteger, and InternalRational.

Definition at line 132 of file int_cf.cc.

133{
134 ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() );
135 return CFFactory::basic( 0 );
136}

◆ classname()

virtual const char * InternalCF::classname ( ) const
virtual

◆ coeff()

CanonicalForm InternalCF::coeff ( int  i)
virtual

CanonicalForm InternalCF::coeff ( int i )

See also
CanonicalForm::operator []()

Reimplemented in InternalPoly.

Definition at line 120 of file int_cf.cc.

121{
122 if ( i == 0 )
123 return CanonicalForm( copyObject() );
124 else
125 return CanonicalForm( 0 );
126}
int i
Definition: cfEzgcd.cc:132
factory's main class
Definition: canonicalform.h:86
InternalCF * copyObject()
Definition: int_cf.h:62

◆ comparecoeff()

virtual int InternalCF::comparecoeff ( InternalCF )
virtual

◆ comparesame()

virtual int InternalCF::comparesame ( InternalCF )
virtual

◆ copyObject()

InternalCF * InternalCF::copyObject ( )
inline

Definition at line 62 of file int_cf.h.

62{ incRefCount(); return this; }
void incRefCount()
Definition: int_cf.h:52

◆ decRefCount()

int InternalCF::decRefCount ( )
inlineprotected

Definition at line 53 of file int_cf.h.

53{ return --refCount; };

◆ deepCopyObject()

virtual InternalCF * InternalCF::deepCopyObject ( ) const
virtual

◆ degree()

int InternalCF::degree ( )
virtual

int InternalCF::degree ()

See also
CanonicalForm::degree()

Reimplemented in InternalPoly.

Definition at line 55 of file int_cf.cc.

56{
57 if ( isZero() )
58 return -1;
59 else
60 return 0;
61}
virtual bool isZero() const
Definition: int_cf.cc:24

◆ deleteObject()

int InternalCF::deleteObject ( )
inline

Definition at line 61 of file int_cf.h.

61{ return decRefCount() == 0; }
int decRefCount()
Definition: int_cf.h:53

◆ den()

InternalCF * InternalCF::den ( )
virtual

Reimplemented in InternalRational.

Definition at line 91 of file int_cf.cc.

92{
93 return CFFactory::basic( 1 );
94}

◆ divcoeff()

virtual InternalCF * InternalCF::divcoeff ( InternalCF ,
bool   
)
virtual

◆ dividecoeff()

virtual InternalCF * InternalCF::dividecoeff ( InternalCF ,
bool   
)
virtual

◆ dividesame()

virtual InternalCF * InternalCF::dividesame ( InternalCF )
virtual

◆ divremcoeff()

virtual void InternalCF::divremcoeff ( InternalCF ,
InternalCF *&  ,
InternalCF *&  ,
bool   
)
virtual

◆ divremcoefft()

virtual bool InternalCF::divremcoefft ( InternalCF ,
InternalCF *&  ,
InternalCF *&  ,
bool   
)
virtual

◆ divremsame()

virtual void InternalCF::divremsame ( InternalCF ,
InternalCF *&  ,
InternalCF *&   
)
virtual

◆ divremsamet()

virtual bool InternalCF::divremsamet ( InternalCF ,
InternalCF *&  ,
InternalCF *&   
)
virtual

◆ divsame()

virtual InternalCF * InternalCF::divsame ( InternalCF )
virtual

◆ genOne()

virtual InternalCF * InternalCF::genOne ( )
virtual

◆ genZero()

virtual InternalCF * InternalCF::genZero ( )
virtual

◆ getRefCount()

int InternalCF::getRefCount ( )
inlineprotected

Definition at line 51 of file int_cf.h.

51{ return refCount; };

◆ ilog2()

int InternalCF::ilog2 ( )
virtual

int InternalCF::ilog2 ()

See also
CanonicalForm::ilog2()

Reimplemented in InternalInteger.

Definition at line 110 of file int_cf.cc.

111{
112 ASSERT1( 0, "ilog2() not implemented for class %s", this->classname() );
113 return 0;
114}

◆ inBaseDomain()

virtual bool InternalCF::inBaseDomain ( ) const
inlinevirtual

Reimplemented in InternalPoly.

Definition at line 74 of file int_cf.h.

74{ return true; }

◆ inCoeffDomain()

virtual bool InternalCF::inCoeffDomain ( ) const
inlinevirtual

Reimplemented in InternalPoly.

Definition at line 76 of file int_cf.h.

76{ return true; }

◆ incRefCount()

void InternalCF::incRefCount ( )
inlineprotected

Definition at line 52 of file int_cf.h.

52{ refCount++; };

◆ inExtension()

virtual bool InternalCF::inExtension ( ) const
inlinevirtual

Reimplemented in InternalPoly.

Definition at line 75 of file int_cf.h.

75{ return false; }

◆ inPolyDomain()

virtual bool InternalCF::inPolyDomain ( ) const
inlinevirtual

Reimplemented in InternalPoly.

Definition at line 77 of file int_cf.h.

77{ return false; }

◆ inQuotDomain()

virtual bool InternalCF::inQuotDomain ( ) const
inlinevirtual

Reimplemented in InternalPoly.

Definition at line 78 of file int_cf.h.

78{ return false; }

◆ intmod()

virtual int InternalCF::intmod ( int  ) const
inlinevirtual

Reimplemented in InternalInteger, and InternalPrimePower.

Definition at line 83 of file int_cf.h.

83{ return 0; }

◆ intval()

long InternalCF::intval ( ) const
virtual

Reimplemented in InternalInteger, InternalPrimePower, and InternalRational.

Definition at line 165 of file int_cf.cc.

166{
167 ASSERT1( 0, "intval() not implemented for class %s", this->classname() );
168 return 0;
169}

◆ invert()

InternalCF * InternalCF::invert ( )
virtual

Reimplemented in InternalPoly.

Definition at line 172 of file int_cf.cc.

173{
174 ASSERT1( 0, "invert() not implemented for class %s", this->classname() );
175 return 0;
176}

◆ isOne()

bool InternalCF::isOne ( ) const
virtual

bool InternalCF::isOne, isZero () const

See also
CanonicalForm::isOne(), CanonicalForm::isZero()

Reimplemented in InternalPrimePower.

Definition at line 18 of file int_cf.cc.

19{
20 return false;
21}

◆ isUnivariate()

virtual bool InternalCF::isUnivariate ( ) const
inlinevirtual

Reimplemented in InternalPoly.

Definition at line 81 of file int_cf.h.

81{ return false; }

◆ isZero()

bool InternalCF::isZero ( ) const
virtual

Reimplemented in InternalPrimePower.

Definition at line 24 of file int_cf.cc.

25{
26 return false;
27}

◆ lc()

CanonicalForm InternalCF::lc ( )
virtual

CanonicalForm InternalCF::lc (), Lc (), LC ()

See also
CanonicalForm::lc(), Lc(), LC()

Reimplemented in InternalPoly.

Definition at line 34 of file int_cf.cc.

35{
36 return CanonicalForm( copyObject() );
37}

◆ Lc()

CanonicalForm InternalCF::Lc ( )
virtual

Reimplemented in InternalPoly.

Definition at line 40 of file int_cf.cc.

41{
42 return CanonicalForm( copyObject() );
43}

◆ LC()

CanonicalForm InternalCF::LC ( )
virtual

Reimplemented in InternalPoly.

Definition at line 46 of file int_cf.cc.

47{
48 return CanonicalForm( copyObject() );
49}

◆ level()

virtual int InternalCF::level ( ) const
inlinevirtual

Reimplemented in InternalPoly.

Definition at line 67 of file int_cf.h.

67{ return LEVELBASE; }
#define LEVELBASE
Definition: cf_defs.h:25

◆ levelcoeff()

virtual int InternalCF::levelcoeff ( ) const
inlinevirtual

Reimplemented in InternalInteger, InternalPrimePower, and InternalRational.

Definition at line 68 of file int_cf.h.

68{ return UndefinedDomain; }
#define UndefinedDomain
Definition: cf_defs.h:16

◆ modcoeff()

virtual InternalCF * InternalCF::modcoeff ( InternalCF ,
bool   
)
virtual

◆ modsame()

virtual InternalCF * InternalCF::modsame ( InternalCF )
virtual

◆ modulocoeff()

virtual InternalCF * InternalCF::modulocoeff ( InternalCF ,
bool   
)
virtual

◆ modulosame()

virtual InternalCF * InternalCF::modulosame ( InternalCF )
virtual

◆ mulcoeff()

virtual InternalCF * InternalCF::mulcoeff ( InternalCF )
virtual

◆ mulsame()

virtual InternalCF * InternalCF::mulsame ( InternalCF )
virtual

◆ neg()

virtual InternalCF * InternalCF::neg ( )
virtual

◆ num()

InternalCF * InternalCF::num ( )
virtual

InternalCF * InternalCF::num (), den ()

See also
CanonicalForm::num(), den()

Reimplemented in InternalRational.

Definition at line 85 of file int_cf.cc.

86{
87 return copyObject();
88}

◆ print()

virtual void InternalCF::print ( OSTREAM ,
char *   
)
virtual

Reimplemented in InternalPrimePower.

◆ sign()

virtual int InternalCF::sign ( ) const
virtual

◆ sqrt()

InternalCF * InternalCF::sqrt ( )
virtual

InternalCF * InternalCF::sqrt ()

See also
CanonicalForm::sqrt()

Reimplemented in InternalInteger.

Definition at line 100 of file int_cf.cc.

101{
102 ASSERT1( 0, "sqrt() not implemented for class %s", this->classname() );
103 return 0;
104}

◆ subcoeff()

virtual InternalCF * InternalCF::subcoeff ( InternalCF ,
bool   
)
virtual

◆ subsame()

virtual InternalCF * InternalCF::subsame ( InternalCF )
virtual

◆ tailcoeff()

CanonicalForm InternalCF::tailcoeff ( )
virtual

CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree ()

See also
CanonicalForm::tailcoeff(), taildegree()

Reimplemented in InternalPoly.

Definition at line 67 of file int_cf.cc.

68{
69 return CanonicalForm( copyObject() );
70}

◆ taildegree()

int InternalCF::taildegree ( )
virtual

Reimplemented in InternalPoly.

Definition at line 73 of file int_cf.cc.

74{
75 if ( isZero() )
76 return -1;
77 else
78 return 0;
79}

◆ tryDivcoeff()

InternalCF * InternalCF::tryDivcoeff ( InternalCF ,
bool  ,
const CanonicalForm ,
bool &   
)
virtual

Reimplemented in InternalPoly.

Definition at line 214 of file int_cf.cc.

215{
216 ASSERT1( 0, "tryDivcoeff() not implemented for class %s", this->classname() );
217 return 0;
218}

◆ tryDividecoeff()

InternalCF * InternalCF::tryDividecoeff ( InternalCF ,
bool  ,
const CanonicalForm ,
bool &   
)
virtual

Reimplemented in InternalPoly.

Definition at line 221 of file int_cf.cc.

222{
223 ASSERT1( 0, "tryDividecoeff() not implemented for class %s", this->classname() );
224 return 0;
225}

◆ tryDivremcoefft()

bool InternalCF::tryDivremcoefft ( InternalCF ,
InternalCF *&  ,
InternalCF *&  ,
bool  ,
const CanonicalForm ,
bool &   
)
virtual

Reimplemented in InternalPoly.

Definition at line 200 of file int_cf.cc.

201{
202 ASSERT1( 0, "tryDivremcoefft() not implemented for class %s", this->classname() );
203 return 0;
204}

◆ tryDivremsamet()

bool InternalCF::tryDivremsamet ( InternalCF ,
InternalCF *&  ,
InternalCF *&  ,
const CanonicalForm ,
bool &   
)
virtual

Reimplemented in InternalPoly.

Definition at line 193 of file int_cf.cc.

194{
195 ASSERT1( 0, "tryDivremsamet() not implemented for class %s", this->classname() );
196 return 0;
197}

◆ tryDivsame()

InternalCF * InternalCF::tryDivsame ( InternalCF ,
const CanonicalForm ,
bool &   
)
virtual

Reimplemented in InternalPoly.

Definition at line 207 of file int_cf.cc.

208{
209 ASSERT1( 0, "tryDivsame() not implemented for class %s", this->classname() );
210 return 0;
211}

◆ tryInvert()

InternalCF * InternalCF::tryInvert ( const CanonicalForm ,
bool &   
)
virtual

Reimplemented in InternalPoly.

Definition at line 186 of file int_cf.cc.

187{
188 ASSERT1( 0, "tryInvert() not implemented for class %s", this->classname() );
189 return 0;
190}

◆ tryMulsame()

InternalCF * InternalCF::tryMulsame ( InternalCF ,
const CanonicalForm  
)
virtual

Reimplemented in InternalPoly.

Definition at line 179 of file int_cf.cc.

180{
181 ASSERT1( 0, "tryMulsame() not implemented for class %s", this->classname() );
182 return 0;
183}

◆ type()

virtual int InternalCF::type ( ) const
inlinevirtual

Definition at line 69 of file int_cf.h.

69{ return UndefinedDomain; }

◆ variable()

virtual Variable InternalCF::variable ( ) const
inlinevirtual

Reimplemented in InternalPoly.

Definition at line 70 of file int_cf.h.

70{ return Variable(); }
factory's class for variables
Definition: variable.h:33

Field Documentation

◆ refCount

int InternalCF::refCount
private

Definition at line 49 of file int_cf.h.


The documentation for this class was generated from the following files: