My Project
Loading...
Searching...
No Matches
int_cf.cc
Go to the documentation of this file.
1/* emacs edit mode for this file is -*- C++ -*- */
2
3
4#include "config.h"
5
6
7#include "cf_assert.h"
8
9#include "cf_defs.h"
10#include "int_cf.h"
11#include "canonicalform.h"
12#include "cf_factory.h"
13
14/** bool InternalCF::isOne, isZero () const
15 * @sa CanonicalForm::isOne(), CanonicalForm::isZero()
16**/
17bool
19{
20 return false;
21}
22
23bool
25{
26 return false;
27}
28
29
30/** CanonicalForm InternalCF::lc (), Lc (), LC ()
31 * @sa CanonicalForm::lc(), Lc(), LC()
32**/
35{
36 return CanonicalForm( copyObject() );
37}
38
41{
42 return CanonicalForm( copyObject() );
43}
44
47{
48 return CanonicalForm( copyObject() );
49}
50
51/** int InternalCF::degree ()
52 * @sa CanonicalForm::degree()
53**/
54int
56{
57 if ( isZero() )
58 return -1;
59 else
60 return 0;
61}
62
63/** CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree ()
64 * @sa CanonicalForm::tailcoeff(), taildegree()
65**/
68{
69 return CanonicalForm( copyObject() );
70}
71
72int
74{
75 if ( isZero() )
76 return -1;
77 else
78 return 0;
79}
80
81/** InternalCF * InternalCF::num (), den ()
82 * @sa CanonicalForm::num(), den()
83**/
86{
87 return copyObject();
88}
89
92{
93 return CFFactory::basic( 1 );
94}
95
96/** InternalCF * InternalCF::sqrt ()
97 * @sa CanonicalForm::sqrt()
98**/
101{
102 ASSERT1( 0, "sqrt() not implemented for class %s", this->classname() );
103 return 0;
104}
105
106/** int InternalCF::ilog2 ()
107 * @sa CanonicalForm::ilog2()
108**/
109int
111{
112 ASSERT1( 0, "ilog2() not implemented for class %s", this->classname() );
113 return 0;
114}
115
116/** CanonicalForm InternalCF::coeff ( int i )
117 * @sa CanonicalForm::operator []()
118**/
121{
122 if ( i == 0 )
123 return CanonicalForm( copyObject() );
124 else
125 return CanonicalForm( 0 );
126}
127
128/** InternalCF * InternalCF::bgcdsame, bgcdcoeff ( const InternalCF * const )
129 * @sa CanonicalForm::bgcd()
130**/
132InternalCF::bgcdsame ( const InternalCF * const ) const
133{
134 ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() );
135 return CFFactory::basic( 0 );
136}
137
140{
141 ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() );
142 return CFFactory::basic( 0 );
143}
144
145/** InternalCF * InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b )
146 * @sa CanonicalForm::bextgcd()
147**/
150{
151 ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() );
152 a = 0; b = 0;
153 return CFFactory::basic( 0 );
154}
155
158{
159 ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() );
160 a = 0; b = 0;
161 return CFFactory::basic( 0 );
162}
163
164long
166{
167 ASSERT1( 0, "intval() not implemented for class %s", this->classname() );
168 return 0;
169}
170
173{
174 ASSERT1( 0, "invert() not implemented for class %s", this->classname() );
175 return 0;
176}
177
180{
181 ASSERT1( 0, "tryMulsame() not implemented for class %s", this->classname() );
182 return 0;
183}
184
187{
188 ASSERT1( 0, "tryInvert() not implemented for class %s", this->classname() );
189 return 0;
190}
191
192bool
194{
195 ASSERT1( 0, "tryDivremsamet() not implemented for class %s", this->classname() );
196 return 0;
197}
198
199bool
201{
202 ASSERT1( 0, "tryDivremcoefft() not implemented for class %s", this->classname() );
203 return 0;
204}
205
208{
209 ASSERT1( 0, "tryDivsame() not implemented for class %s", this->classname() );
210 return 0;
211}
212
215{
216 ASSERT1( 0, "tryDivcoeff() not implemented for class %s", this->classname() );
217 return 0;
218}
219
222{
223 ASSERT1( 0, "tryDividecoeff() not implemented for class %s", this->classname() );
224 return 0;
225}
Header for factory's main class CanonicalForm.
int i
Definition: cfEzgcd.cc:132
CanonicalForm b
Definition: cfModGcd.cc:4103
assertions for Factory
#define ASSERT1(expression, message, parameter1)
Definition: cf_assert.h:101
factory switches.
Interface to generate InternalCF's over various domains from intrinsic types or mpz_t's.
static InternalCF * basic(int value)
Definition: cf_factory.cc:61
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
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 CanonicalForm tailcoeff()
CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree ()
Definition: int_cf.cc:67
virtual CanonicalForm lc()
CanonicalForm InternalCF::lc (), Lc (), LC ()
Definition: int_cf.cc:34
virtual const char * classname() const PVIRT_CHARCC("classname")
virtual bool tryDivremsamet(InternalCF *, InternalCF *&, InternalCF *&, const CanonicalForm &, bool &)
Definition: int_cf.cc:193
virtual InternalCF * tryDividecoeff(InternalCF *, bool, const CanonicalForm &, bool &)
Definition: int_cf.cc:221
virtual long intval() const
Definition: int_cf.cc:165
virtual bool isZero() const
Definition: int_cf.cc:24
virtual InternalCF * tryInvert(const CanonicalForm &, bool &)
Definition: int_cf.cc:186
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 CanonicalForm LC()
Definition: int_cf.cc:46
virtual InternalCF * num()
InternalCF * InternalCF::num (), den ()
Definition: int_cf.cc:85
virtual InternalCF * den()
Definition: int_cf.cc:91
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 InternalCF * invert()
Definition: int_cf.cc:172
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 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
Factory's internal CanonicalForm's.