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