source: git/factory/int_cf.cc @ 362fc67

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