source: git/factory/int_cf.cc @ 1bd66a

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