Loading...
Searching...
No Matches
int_cf.h
Go to the documentation of this file.
/* emacs edit mode for this file is -*- C++ -*- */
/**
* @file int_cf.h
*
* Factory's internal CanonicalForm's
**/
#ifndef INCL_INT_CF_H
#define INCL_INT_CF_H
// #include "config.h"
#ifndef NOSTREAMIO
#ifdef HAVE_IOSTREAM
#include <iostream>
#define OSTREAM std::ostream
#elif defined(HAVE_IOSTREAM_H)
#include <iostream.h>
#define OSTREAM ostream
#endif
#endif /* NOSTREAMIO */
#include "cf_assert.h"
#include "cf_defs.h"
#include "variable.h"
#ifdef HAVE_OMALLOC
#ifndef XMEMORY_H
#include "omalloc/omallocClass.h"
#endif
#endif
class CanonicalForm;
/**
* virtual class for internal CanonicalForm's
*
* InternalCF will become an InternalPoly, InternalInteger, InternalRational
**/
class InternalCF
#ifdef HAVE_OMALLOC
#ifndef XMEMORY_H
: public omallocClass
#endif
#endif
{
private:
int refCount;
protected:
int getRefCount() { return refCount; };
void incRefCount() { refCount++; };
int decRefCount() { return --refCount; };
public:
InternalCF() { refCount = 1; };
InternalCF( const InternalCF& )
{
ASSERT( 0, "ups there is something wrong in your code");
};
virtual ~InternalCF() {};
int deleteObject() { return decRefCount() == 0; }
InternalCF* copyObject() { incRefCount(); return this; }
virtual InternalCF* deepCopyObject() const PVIRT_INTCF("deepCopyObject");
virtual const char * classname() const PVIRT_CHARCC("classname");
virtual InternalCF* genZero() PVIRT_INTCF("genZero");
virtual InternalCF* genOne() PVIRT_INTCF("genOne");
virtual int level() const { return LEVELBASE; }
virtual int levelcoeff() const { return UndefinedDomain; }
virtual int type() const { return UndefinedDomain; }
virtual Variable variable() const { return Variable(); }
#ifndef NOSTREAMIO
virtual void print( OSTREAM&, char* ) PVIRT_VOID("print");
#endif /* NOSTREAMIO */
virtual bool inBaseDomain() const { return true; }
virtual bool inExtension() const { return false; }
virtual bool inCoeffDomain() const { return true; }
virtual bool inPolyDomain() const { return false; }
virtual bool inQuotDomain() const { return false; }
virtual bool isZero() const;
virtual bool isOne() const;
virtual bool isUnivariate() const { return false; }
virtual long intval() const;
virtual int intmod( int ) const { return 0; }
virtual int sign() const PVIRT_INT("sign");
virtual InternalCF* num();
virtual InternalCF* den();
virtual InternalCF* neg() PVIRT_INTCF("neg");
virtual InternalCF* invert(); // semantically const, changes refCount
virtual InternalCF* tryInvert( const CanonicalForm&, bool& );
virtual int comparesame ( InternalCF * ) PVIRT_INT("comparesame");
virtual int comparecoeff ( InternalCF * ) PVIRT_INT("comparecoeff");
virtual InternalCF* addsame( InternalCF* ) PVIRT_INTCF("addsame");
virtual InternalCF* subsame( InternalCF* ) PVIRT_INTCF("subsame");
virtual InternalCF* mulsame( InternalCF* ) PVIRT_INTCF("mulsame");
virtual InternalCF* tryMulsame( InternalCF*, const CanonicalForm& );
virtual InternalCF* dividesame( InternalCF* ) PVIRT_INTCF("dividesame");
virtual InternalCF* modulosame( InternalCF* ) PVIRT_INTCF("modulosame");
virtual InternalCF* divsame( InternalCF* ) PVIRT_INTCF("divsame");
virtual InternalCF* tryDivsame ( InternalCF* , const CanonicalForm&, bool& );
virtual InternalCF* modsame( 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 InternalCF* addcoeff( InternalCF* ) PVIRT_INTCF("addcoeff");
virtual InternalCF* subcoeff( InternalCF*, bool ) PVIRT_INTCF("subcoeff");
virtual InternalCF* mulcoeff( InternalCF* ) PVIRT_INTCF("mulcoeff");
virtual InternalCF* dividecoeff( InternalCF*, bool ) PVIRT_INTCF("dividecoeff");
virtual InternalCF* tryDividecoeff ( InternalCF*, bool, const CanonicalForm&, bool& );
virtual InternalCF* modulocoeff( InternalCF*, bool ) PVIRT_INTCF("dividecoeff");
virtual InternalCF* divcoeff( InternalCF*, bool ) PVIRT_INTCF("divcoeff");
virtual InternalCF* tryDivcoeff ( InternalCF*, bool, const CanonicalForm&, bool& );
virtual InternalCF* modcoeff( 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 InternalCF * bgcdsame ( const InternalCF * const ) const;
virtual InternalCF * bgcdcoeff ( const InternalCF * const ); // semantically const, changes refcount
virtual InternalCF * bextgcdsame ( InternalCF *, CanonicalForm &, CanonicalForm & ); // semantically const, changes refcount
virtual InternalCF * bextgcdcoeff ( InternalCF *, CanonicalForm &, CanonicalForm & ); // semantically const, changes refcount
virtual InternalCF* sqrt();
virtual int ilog2();
virtual CanonicalForm lc();
virtual CanonicalForm Lc();
virtual CanonicalForm LC();
virtual CanonicalForm coeff( int i );
virtual int degree();
virtual int taildegree();
virtual CanonicalForm tailcoeff();
};
#endif /* ! INCL_INT_CF_H */
i
int i
Definition cfEzgcd.cc:132
cf_assert.h
assertions for Factory
PVIRT_CHARCC
#define PVIRT_CHARCC(msg)
Definition cf_assert.h:125
PVIRT_INT
#define PVIRT_INT(msg)
Definition cf_assert.h:123
PVIRT_INTCF
#define PVIRT_INTCF(msg)
Definition cf_assert.h:119
PVIRT_BOOL
#define PVIRT_BOOL(msg)
Definition cf_assert.h:121
ASSERT
#define ASSERT(expression, message)
Definition cf_assert.h:99
PVIRT_VOID
#define PVIRT_VOID(msg)
Definition cf_assert.h:117
cf_defs.h
factory switches.
LEVELBASE
#define LEVELBASE
Definition cf_defs.h:25
UndefinedDomain
#define UndefinedDomain
Definition cf_defs.h:16
CanonicalForm
factory's main class
Definition canonicalform.h:86
InternalCF::tryMulsame
virtual InternalCF * tryMulsame(InternalCF *, const CanonicalForm &)
Definition int_cf.cc:179
InternalCF::intmod
virtual int intmod(int) const
Definition int_cf.h:83
InternalCF::addcoeff
virtual InternalCF * addcoeff(InternalCF *) PVIRT_INTCF("addcoeff")
InternalCF::copyObject
InternalCF * copyObject()
Definition int_cf.h:62
InternalCF::Lc
virtual CanonicalForm Lc()
Definition int_cf.cc:40
InternalCF::tryDivcoeff
virtual InternalCF * tryDivcoeff(InternalCF *, bool, const CanonicalForm &, bool &)
Definition int_cf.cc:214
InternalCF::modulosame
virtual InternalCF * modulosame(InternalCF *) PVIRT_INTCF("modulosame")
InternalCF::divremcoeff
virtual void divremcoeff(InternalCF *, InternalCF *&, InternalCF *&, bool) PVIRT_VOID("divremcoeff")
InternalCF::~InternalCF
virtual ~InternalCF()
Definition int_cf.h:60
InternalCF::addsame
virtual InternalCF * addsame(InternalCF *) PVIRT_INTCF("addsame")
InternalCF::tailcoeff
virtual CanonicalForm tailcoeff()
CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree ().
Definition int_cf.cc:67
InternalCF::divsame
virtual InternalCF * divsame(InternalCF *) PVIRT_INTCF("divsame")
InternalCF::inPolyDomain
virtual bool inPolyDomain() const
Definition int_cf.h:77
InternalCF::lc
virtual CanonicalForm lc()
CanonicalForm InternalCF::lc (), Lc (), LC ().
Definition int_cf.cc:34
InternalCF::mulcoeff
virtual InternalCF * mulcoeff(InternalCF *) PVIRT_INTCF("mulcoeff")
InternalCF::classname
virtual const char * classname() const PVIRT_CHARCC("classname")
InternalCF::InternalCF
InternalCF()
Definition int_cf.h:55
InternalCF::tryDivremsamet
virtual bool tryDivremsamet(InternalCF *, InternalCF *&, InternalCF *&, const CanonicalForm &, bool &)
Definition int_cf.cc:193
InternalCF::subsame
virtual InternalCF * subsame(InternalCF *) PVIRT_INTCF("subsame")
InternalCF::tryDividecoeff
virtual InternalCF * tryDividecoeff(InternalCF *, bool, const CanonicalForm &, bool &)
Definition int_cf.cc:221
InternalCF::divcoeff
virtual InternalCF * divcoeff(InternalCF *, bool) PVIRT_INTCF("divcoeff")
InternalCF::subcoeff
virtual InternalCF * subcoeff(InternalCF *, bool) PVIRT_INTCF("subcoeff")
InternalCF::intval
virtual long intval() const
Definition int_cf.cc:165
InternalCF::dividecoeff
virtual InternalCF * dividecoeff(InternalCF *, bool) PVIRT_INTCF("dividecoeff")
InternalCF::isZero
virtual bool isZero() const
Definition int_cf.cc:24
InternalCF::getRefCount
int getRefCount()
Definition int_cf.h:51
InternalCF::incRefCount
void incRefCount()
Definition int_cf.h:52
InternalCF::tryInvert
virtual InternalCF * tryInvert(const CanonicalForm &, bool &)
Definition int_cf.cc:186
InternalCF::inExtension
virtual bool inExtension() const
Definition int_cf.h:75
InternalCF::genOne
virtual InternalCF * genOne() PVIRT_INTCF("genOne")
InternalCF::print
virtual void print(OSTREAM &, char *) PVIRT_VOID("print")
InternalCF::levelcoeff
virtual int levelcoeff() const
Definition int_cf.h:68
InternalCF::degree
virtual int degree()
int InternalCF::degree ()
Definition int_cf.cc:55
InternalCF::bextgcdsame
virtual InternalCF * bextgcdsame(InternalCF *, CanonicalForm &, CanonicalForm &)
InternalCF * InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b ).
Definition int_cf.cc:149
InternalCF::ilog2
virtual int ilog2()
int InternalCF::ilog2 ()
Definition int_cf.cc:110
InternalCF::comparesame
virtual int comparesame(InternalCF *) PVIRT_INT("comparesame")
InternalCF::InternalCF
InternalCF(const InternalCF &)
Definition int_cf.h:56
InternalCF::inCoeffDomain
virtual bool inCoeffDomain() const
Definition int_cf.h:76
InternalCF::LC
virtual CanonicalForm LC()
Definition int_cf.cc:46
InternalCF::modsame
virtual InternalCF * modsame(InternalCF *) PVIRT_INTCF("modsame")
InternalCF::num
virtual InternalCF * num()
InternalCF * InternalCF::num (), den ().
Definition int_cf.cc:85
InternalCF::decRefCount
int decRefCount()
Definition int_cf.h:53
InternalCF::comparecoeff
virtual int comparecoeff(InternalCF *) PVIRT_INT("comparecoeff")
InternalCF::den
virtual InternalCF * den()
Definition int_cf.cc:91
InternalCF::variable
virtual Variable variable() const
Definition int_cf.h:70
InternalCF::sqrt
virtual InternalCF * sqrt()
InternalCF * InternalCF::sqrt ().
Definition int_cf.cc:100
InternalCF::tryDivremcoefft
virtual bool tryDivremcoefft(InternalCF *, InternalCF *&, InternalCF *&, bool, const CanonicalForm &, bool &)
Definition int_cf.cc:200
InternalCF::sign
virtual int sign() const PVIRT_INT("sign")
InternalCF::inBaseDomain
virtual bool inBaseDomain() const
Definition int_cf.h:74
InternalCF::invert
virtual InternalCF * invert()
Definition int_cf.cc:172
InternalCF::dividesame
virtual InternalCF * dividesame(InternalCF *) PVIRT_INTCF("dividesame")
InternalCF::deepCopyObject
virtual InternalCF * deepCopyObject() const PVIRT_INTCF("deepCopyObject")
InternalCF::modulocoeff
virtual InternalCF * modulocoeff(InternalCF *, bool) PVIRT_INTCF("dividecoeff")
InternalCF::deleteObject
int deleteObject()
Definition int_cf.h:61
InternalCF::tryDivsame
virtual InternalCF * tryDivsame(InternalCF *, const CanonicalForm &, bool &)
Definition int_cf.cc:207
InternalCF::bgcdsame
virtual InternalCF * bgcdsame(const InternalCF *const) const
InternalCF * InternalCF::bgcdsame, bgcdcoeff ( const InternalCF * const ).
Definition int_cf.cc:132
InternalCF::coeff
virtual CanonicalForm coeff(int i)
CanonicalForm InternalCF::coeff ( int i ).
Definition int_cf.cc:120
InternalCF::level
virtual int level() const
Definition int_cf.h:67
InternalCF::divremsame
virtual void divremsame(InternalCF *, InternalCF *&, InternalCF *&) PVIRT_VOID("divremsame")
InternalCF::isUnivariate
virtual bool isUnivariate() const
Definition int_cf.h:81
InternalCF::refCount
int refCount
Definition int_cf.h:49
InternalCF::inQuotDomain
virtual bool inQuotDomain() const
Definition int_cf.h:78
InternalCF::divremcoefft
virtual bool divremcoefft(InternalCF *, InternalCF *&, InternalCF *&, bool) PVIRT_BOOL("divremcoefft")
InternalCF::type
virtual int type() const
Definition int_cf.h:69
InternalCF::modcoeff
virtual InternalCF * modcoeff(InternalCF *, bool) PVIRT_INTCF("modcoeff")
InternalCF::genZero
virtual InternalCF * genZero() PVIRT_INTCF("genZero")
InternalCF::bextgcdcoeff
virtual InternalCF * bextgcdcoeff(InternalCF *, CanonicalForm &, CanonicalForm &)
Definition int_cf.cc:157
InternalCF::isOne
virtual bool isOne() const
bool InternalCF::isOne, isZero () const
Definition int_cf.cc:18
InternalCF::bgcdcoeff
virtual InternalCF * bgcdcoeff(const InternalCF *const)
Definition int_cf.cc:139
InternalCF::taildegree
virtual int taildegree()
Definition int_cf.cc:73
InternalCF::neg
virtual InternalCF * neg() PVIRT_INTCF("neg")
InternalCF::mulsame
virtual InternalCF * mulsame(InternalCF *) PVIRT_INTCF("mulsame")
InternalCF::divremsamet
virtual bool divremsamet(InternalCF *, InternalCF *&, InternalCF *&) PVIRT_BOOL("divremsamet")
Variable
factory's class for variables
Definition factory.h:127
omallocClass
Definition omallocClass.h:20
const
#define const
Definition fegetopt.c:39
OSTREAM
#define OSTREAM
Definition int_cf.h:16
omallocClass.h
variable.h
operations on variables