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 | **/ |
---|
17 | bool |
---|
18 | InternalCF::isOne () const |
---|
19 | { |
---|
20 | return false; |
---|
21 | } |
---|
22 | |
---|
23 | bool |
---|
24 | InternalCF::isZero () const |
---|
25 | { |
---|
26 | return false; |
---|
27 | } |
---|
28 | |
---|
29 | |
---|
30 | /** CanonicalForm InternalCF::lc (), Lc (), LC () |
---|
31 | * @sa CanonicalForm::lc(), Lc(), LC() |
---|
32 | **/ |
---|
33 | CanonicalForm |
---|
34 | InternalCF::lc () |
---|
35 | { |
---|
36 | return CanonicalForm( copyObject() ); |
---|
37 | } |
---|
38 | |
---|
39 | CanonicalForm |
---|
40 | InternalCF::Lc () |
---|
41 | { |
---|
42 | return CanonicalForm( copyObject() ); |
---|
43 | } |
---|
44 | |
---|
45 | CanonicalForm |
---|
46 | InternalCF::LC () |
---|
47 | { |
---|
48 | return CanonicalForm( copyObject() ); |
---|
49 | } |
---|
50 | |
---|
51 | /** int InternalCF::degree () |
---|
52 | * @sa CanonicalForm::degree() |
---|
53 | **/ |
---|
54 | int |
---|
55 | InternalCF::degree () |
---|
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 | **/ |
---|
66 | CanonicalForm |
---|
67 | InternalCF::tailcoeff () |
---|
68 | { |
---|
69 | return CanonicalForm( copyObject() ); |
---|
70 | } |
---|
71 | |
---|
72 | int |
---|
73 | InternalCF::taildegree () |
---|
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 | **/ |
---|
84 | InternalCF * |
---|
85 | InternalCF::num () |
---|
86 | { |
---|
87 | return copyObject(); |
---|
88 | } |
---|
89 | |
---|
90 | InternalCF * |
---|
91 | InternalCF::den () |
---|
92 | { |
---|
93 | return CFFactory::basic( 1L ); |
---|
94 | } |
---|
95 | |
---|
96 | /** InternalCF * InternalCF::sqrt () |
---|
97 | * @sa CanonicalForm::sqrt() |
---|
98 | **/ |
---|
99 | InternalCF * |
---|
100 | InternalCF::sqrt () |
---|
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 | **/ |
---|
109 | int |
---|
110 | InternalCF::ilog2 () |
---|
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 | **/ |
---|
119 | CanonicalForm |
---|
120 | InternalCF::coeff ( int i ) |
---|
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 | **/ |
---|
131 | InternalCF * |
---|
132 | InternalCF::bgcdsame ( const InternalCF * const ) const |
---|
133 | { |
---|
134 | ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() ); |
---|
135 | return CFFactory::basic( 0L ); |
---|
136 | } |
---|
137 | |
---|
138 | InternalCF * |
---|
139 | InternalCF::bgcdcoeff ( const InternalCF * const ) |
---|
140 | { |
---|
141 | ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() ); |
---|
142 | return CFFactory::basic( 0L ); |
---|
143 | } |
---|
144 | |
---|
145 | /** InternalCF * InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b ) |
---|
146 | * @sa CanonicalForm::bextgcd() |
---|
147 | **/ |
---|
148 | InternalCF * |
---|
149 | InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b ) |
---|
150 | { |
---|
151 | ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() ); |
---|
152 | a = 0; b = 0; |
---|
153 | return CFFactory::basic( 0L ); |
---|
154 | } |
---|
155 | |
---|
156 | InternalCF * |
---|
157 | InternalCF::bextgcdcoeff ( InternalCF *, CanonicalForm & a, CanonicalForm & b ) |
---|
158 | { |
---|
159 | ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() ); |
---|
160 | a = 0; b = 0; |
---|
161 | return CFFactory::basic( 0L ); |
---|
162 | } |
---|
163 | |
---|
164 | long |
---|
165 | InternalCF::intval() const |
---|
166 | { |
---|
167 | ASSERT1( 0, "intval() not implemented for class %s", this->classname() ); |
---|
168 | return 0; |
---|
169 | } |
---|
170 | |
---|
171 | InternalCF* |
---|
172 | InternalCF::invert() |
---|
173 | { |
---|
174 | ASSERT1( 0, "invert() not implemented for class %s", this->classname() ); |
---|
175 | return 0; |
---|
176 | } |
---|
177 | |
---|
178 | InternalCF* |
---|
179 | InternalCF::tryMulsame( InternalCF*, const CanonicalForm&) |
---|
180 | { |
---|
181 | ASSERT1( 0, "tryMulsame() not implemented for class %s", this->classname() ); |
---|
182 | return 0; |
---|
183 | } |
---|
184 | |
---|
185 | InternalCF* |
---|
186 | InternalCF::tryInvert ( const CanonicalForm&, bool&) |
---|
187 | { |
---|
188 | ASSERT1( 0, "tryInvert() not implemented for class %s", this->classname() ); |
---|
189 | return 0; |
---|
190 | } |
---|
191 | |
---|
192 | bool |
---|
193 | InternalCF::tryDivremsamet ( InternalCF*, InternalCF*&, InternalCF*&, const CanonicalForm&, bool&) |
---|
194 | { |
---|
195 | ASSERT1( 0, "tryDivremsamet() not implemented for class %s", this->classname() ); |
---|
196 | return 0; |
---|
197 | } |
---|
198 | |
---|
199 | bool |
---|
200 | InternalCF::tryDivremcoefft ( InternalCF*, InternalCF*&, InternalCF*&, bool, const CanonicalForm&, bool&) |
---|
201 | { |
---|
202 | ASSERT1( 0, "tryDivremcoefft() not implemented for class %s", this->classname() ); |
---|
203 | return 0; |
---|
204 | } |
---|
205 | |
---|
206 | InternalCF* |
---|
207 | InternalCF::tryDivsame ( InternalCF*, const CanonicalForm&, bool&) |
---|
208 | { |
---|
209 | ASSERT1( 0, "tryDivsame() not implemented for class %s", this->classname() ); |
---|
210 | return 0; |
---|
211 | } |
---|
212 | |
---|
213 | InternalCF* |
---|
214 | InternalCF::tryDivcoeff ( InternalCF*, bool, const CanonicalForm&, bool&) |
---|
215 | { |
---|
216 | ASSERT1( 0, "tryDivcoeff() not implemented for class %s", this->classname() ); |
---|
217 | return 0; |
---|
218 | } |
---|
219 | |
---|
220 | InternalCF* |
---|
221 | InternalCF::tryDividecoeff ( InternalCF*, bool, const CanonicalForm&, bool&) |
---|
222 | { |
---|
223 | ASSERT1( 0, "tryDividecoeff() not implemented for class %s", this->classname() ); |
---|
224 | return 0; |
---|
225 | } |
---|