1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id$ */ |
---|
3 | |
---|
4 | #include "config.h" |
---|
5 | |
---|
6 | #include "cf_assert.h" |
---|
7 | |
---|
8 | #include "cf_defs.h" |
---|
9 | #include "int_cf.h" |
---|
10 | #include "canonicalform.h" |
---|
11 | #include "cf_factory.h" |
---|
12 | |
---|
13 | //{{{ bool InternalCF::isOne, isZero () const |
---|
14 | // docu: see CanonicalForm::isOne(), CanonicalForm::isZero() |
---|
15 | bool |
---|
16 | InternalCF::isOne () const |
---|
17 | { |
---|
18 | return false; |
---|
19 | } |
---|
20 | |
---|
21 | bool |
---|
22 | InternalCF::isZero () const |
---|
23 | { |
---|
24 | return false; |
---|
25 | } |
---|
26 | //}}} |
---|
27 | |
---|
28 | //{{{ CanonicalForm InternalCF::lc (), Lc (), LC () |
---|
29 | // docu: see CanonicalForm::lc(), Lc(), LC() |
---|
30 | CanonicalForm |
---|
31 | InternalCF::lc () |
---|
32 | { |
---|
33 | return CanonicalForm( copyObject() ); |
---|
34 | } |
---|
35 | |
---|
36 | CanonicalForm |
---|
37 | InternalCF::Lc () |
---|
38 | { |
---|
39 | return CanonicalForm( copyObject() ); |
---|
40 | } |
---|
41 | |
---|
42 | CanonicalForm |
---|
43 | InternalCF::LC () |
---|
44 | { |
---|
45 | return CanonicalForm( copyObject() ); |
---|
46 | } |
---|
47 | //}}} |
---|
48 | |
---|
49 | //{{{ int InternalCF::degree () |
---|
50 | // docu: see CanonicalForm::degree() |
---|
51 | int |
---|
52 | InternalCF::degree () |
---|
53 | { |
---|
54 | if ( isZero() ) |
---|
55 | return -1; |
---|
56 | else |
---|
57 | return 0; |
---|
58 | } |
---|
59 | //}}} |
---|
60 | |
---|
61 | //{{{ CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree () |
---|
62 | // docu: see CanonicalForm::tailcoeff(), taildegree() |
---|
63 | CanonicalForm |
---|
64 | InternalCF::tailcoeff () |
---|
65 | { |
---|
66 | return CanonicalForm( copyObject() ); |
---|
67 | } |
---|
68 | |
---|
69 | int |
---|
70 | InternalCF::taildegree () |
---|
71 | { |
---|
72 | if ( isZero() ) |
---|
73 | return -1; |
---|
74 | else |
---|
75 | return 0; |
---|
76 | } |
---|
77 | //}}} |
---|
78 | |
---|
79 | //{{{ InternalCF * InternalCF::num (), den () |
---|
80 | // docu: see CanonicalForm::num(), den() |
---|
81 | InternalCF * |
---|
82 | InternalCF::num () |
---|
83 | { |
---|
84 | return copyObject(); |
---|
85 | } |
---|
86 | |
---|
87 | InternalCF * |
---|
88 | InternalCF::den () |
---|
89 | { |
---|
90 | return CFFactory::basic( 1 ); |
---|
91 | } |
---|
92 | //}}} |
---|
93 | |
---|
94 | //{{{ InternalCF * InternalCF::sqrt () |
---|
95 | // docu: see CanonicalForm::sqrt() |
---|
96 | InternalCF * |
---|
97 | InternalCF::sqrt () |
---|
98 | { |
---|
99 | ASSERT1( 0, "sqrt() not implemented for class %s", this->classname() ); |
---|
100 | return 0; |
---|
101 | } |
---|
102 | //}}} |
---|
103 | |
---|
104 | //{{{ int InternalCF::ilog2 () |
---|
105 | // docu: see CanonicalForm::ilog2() |
---|
106 | int |
---|
107 | InternalCF::ilog2 () |
---|
108 | { |
---|
109 | ASSERT1( 0, "ilog2() not implemented for class %s", this->classname() ); |
---|
110 | return 0; |
---|
111 | } |
---|
112 | //}}} |
---|
113 | |
---|
114 | //{{{ CanonicalForm InternalCF::coeff ( int i ) |
---|
115 | // docu: see CanonicalForm::operator []() |
---|
116 | CanonicalForm |
---|
117 | InternalCF::coeff ( int i ) |
---|
118 | { |
---|
119 | if ( i == 0 ) |
---|
120 | return CanonicalForm( copyObject() ); |
---|
121 | else |
---|
122 | return CanonicalForm( 0 ); |
---|
123 | } |
---|
124 | //}}} |
---|
125 | |
---|
126 | //{{{ InternalCF * InternalCF::bgcdsame, bgcdcoeff ( const InternalCF * const ) |
---|
127 | // docu: see CanonicalForm::bgcd() |
---|
128 | InternalCF * |
---|
129 | InternalCF::bgcdsame ( const InternalCF * const ) const |
---|
130 | { |
---|
131 | ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() ); |
---|
132 | return CFFactory::basic( 0 ); |
---|
133 | } |
---|
134 | |
---|
135 | InternalCF * |
---|
136 | InternalCF::bgcdcoeff ( const InternalCF * const ) |
---|
137 | { |
---|
138 | ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() ); |
---|
139 | return CFFactory::basic( 0 ); |
---|
140 | } |
---|
141 | //}}} |
---|
142 | |
---|
143 | //{{{ InternalCF * InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b ) |
---|
144 | // docu: see CanonicalForm::bextgcd() |
---|
145 | InternalCF * |
---|
146 | InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b ) |
---|
147 | { |
---|
148 | ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() ); |
---|
149 | a = 0; b = 0; |
---|
150 | return CFFactory::basic( 0 ); |
---|
151 | } |
---|
152 | |
---|
153 | InternalCF * |
---|
154 | InternalCF::bextgcdcoeff ( InternalCF *, CanonicalForm & a, CanonicalForm & b ) |
---|
155 | { |
---|
156 | ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() ); |
---|
157 | a = 0; b = 0; |
---|
158 | return CFFactory::basic( 0 ); |
---|
159 | } |
---|
160 | //}}} |
---|
161 | |
---|
162 | int |
---|
163 | InternalCF::intval() const |
---|
164 | { |
---|
165 | ASSERT1( 0, "intval() not implemented for class %s", this->classname() ); |
---|
166 | return 0; |
---|
167 | } |
---|
168 | |
---|
169 | InternalCF* |
---|
170 | InternalCF::invert() |
---|
171 | { |
---|
172 | ASSERT1( 0, "invert() not implemented for class %s", this->classname() ); |
---|
173 | return 0; |
---|
174 | } |
---|
175 | |
---|
176 | InternalCF* |
---|
177 | InternalCF::tryMulsame( InternalCF*, const CanonicalForm&) |
---|
178 | { |
---|
179 | ASSERT1( 0, "tryMulsame() not implemented for class %s", this->classname() ); |
---|
180 | return 0; |
---|
181 | } |
---|
182 | |
---|
183 | InternalCF* |
---|
184 | InternalCF::tryInvert ( const CanonicalForm&, bool&) |
---|
185 | { |
---|
186 | ASSERT1( 0, "tryInvert() not implemented for class %s", this->classname() ); |
---|
187 | return 0; |
---|
188 | } |
---|
189 | |
---|
190 | bool |
---|
191 | InternalCF::tryDivremsamet ( InternalCF*, InternalCF*&, InternalCF*&, const CanonicalForm&, bool&) |
---|
192 | { |
---|
193 | ASSERT1( 0, "tryDivremsamet() not implemented for class %s", this->classname() ); |
---|
194 | return 0; |
---|
195 | } |
---|
196 | |
---|
197 | bool |
---|
198 | InternalCF::tryDivremcoefft ( InternalCF*, InternalCF*&, InternalCF*&, bool, const CanonicalForm&, bool&) |
---|
199 | { |
---|
200 | ASSERT1( 0, "tryDivremcoefft() not implemented for class %s", this->classname() ); |
---|
201 | return 0; |
---|
202 | } |
---|
203 | |
---|
204 | InternalCF* |
---|
205 | InternalCF::tryDivsame ( InternalCF*, const CanonicalForm&, bool&) |
---|
206 | { |
---|
207 | ASSERT1( 0, "tryDivsame() not implemented for class %s", this->classname() ); |
---|
208 | return 0; |
---|
209 | } |
---|
210 | |
---|
211 | InternalCF* |
---|
212 | InternalCF::tryDivcoeff ( InternalCF*, bool, const CanonicalForm&, bool&) |
---|
213 | { |
---|
214 | ASSERT1( 0, "tryDivcoeff() not implemented for class %s", this->classname() ); |
---|
215 | return 0; |
---|
216 | } |
---|
217 | |
---|
218 | InternalCF* |
---|
219 | InternalCF::tryDividecoeff ( InternalCF*, bool, const CanonicalForm&, bool&) |
---|
220 | { |
---|
221 | ASSERT1( 0, "tryDividecoeff() not implemented for class %s", this->classname() ); |
---|
222 | return 0; |
---|
223 | } |
---|