source: git/factory/int_cf.cc @ e4fe2b

jengelh-datetimespielwiese
Last change on this file since e4fe2b was e4fe2b, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
FIX: Fixed huge BUG in cf_gmp.h CHG: starting to cleanup factory
  • Property mode set to 100644
File size: 4.7 KB
Line 
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()
15bool
16InternalCF::isOne () const
17{
18    return false;
19}
20
21bool
22InternalCF::isZero () const
23{
24    return false;
25}
26//}}}
27
28//{{{ CanonicalForm InternalCF::lc (), Lc (), LC ()
29// docu: see CanonicalForm::lc(), Lc(), LC()
30CanonicalForm
31InternalCF::lc ()
32{
33    return CanonicalForm( copyObject() );
34}
35
36CanonicalForm
37InternalCF::Lc ()
38{
39    return CanonicalForm( copyObject() );
40}
41
42CanonicalForm
43InternalCF::LC ()
44{
45    return CanonicalForm( copyObject() );
46}
47//}}}
48
49//{{{ int InternalCF::degree ()
50// docu: see CanonicalForm::degree()
51int
52InternalCF::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()
63CanonicalForm
64InternalCF::tailcoeff ()
65{
66    return CanonicalForm( copyObject() );
67}
68
69int
70InternalCF::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()
81InternalCF *
82InternalCF::num ()
83{
84    return copyObject();
85}
86
87InternalCF *
88InternalCF::den ()
89{
90    return CFFactory::basic( 1 );
91}
92//}}}
93
94//{{{ InternalCF * InternalCF::sqrt ()
95// docu: see CanonicalForm::sqrt()
96InternalCF *
97InternalCF::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()
106int
107InternalCF::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 []()
116CanonicalForm
117InternalCF::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()
128InternalCF *
129InternalCF::bgcdsame ( const InternalCF * const ) const
130{
131    ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() );
132    return CFFactory::basic( 0 );
133}
134
135InternalCF *
136InternalCF::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()
145InternalCF *
146InternalCF::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
153InternalCF *
154InternalCF::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
162int
163InternalCF::intval() const
164{
165    ASSERT1( 0, "intval() not implemented for class %s", this->classname() );
166    return 0;
167}
168
169InternalCF*
170InternalCF::invert()
171{
172    ASSERT1( 0, "invert() not implemented for class %s", this->classname() );
173    return 0;
174}
175
176InternalCF*
177InternalCF::tryMulsame( InternalCF*, const CanonicalForm&)
178{
179    ASSERT1( 0, "tryMulsame() not implemented for class %s", this->classname() );
180    return 0;
181}
182
183InternalCF*
184InternalCF::tryInvert ( const CanonicalForm&, bool&)
185{
186    ASSERT1( 0, "tryInvert() not implemented for class %s", this->classname() );
187    return 0;
188}
189
190bool
191InternalCF::tryDivremsamet ( InternalCF*, InternalCF*&, InternalCF*&, const CanonicalForm&, bool&)
192{
193    ASSERT1( 0, "tryDivremsamet() not implemented for class %s", this->classname() );
194    return 0;
195}
196
197bool
198InternalCF::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
204InternalCF*
205InternalCF::tryDivsame ( InternalCF*, const CanonicalForm&, bool&)
206{
207    ASSERT1( 0, "tryDivsame() not implemented for class %s", this->classname() );
208    return 0;
209}
210
211InternalCF*
212InternalCF::tryDivcoeff ( InternalCF*, bool, const CanonicalForm&, bool&)
213{
214    ASSERT1( 0, "tryDivcoeff() not implemented for class %s", this->classname() );
215    return 0;
216}
217
218InternalCF*
219InternalCF::tryDividecoeff ( InternalCF*, bool, const CanonicalForm&, bool&)
220{
221    ASSERT1( 0, "tryDividecoeff() not implemented for class %s", this->classname() );
222    return 0;
223}
Note: See TracBrowser for help on using the repository browser.