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