source: git/factory/int_cf.cc @ 542864

fieker-DuValspielwiese
Last change on this file since 542864 was e4fe2b, checked in by Oleksandr Motsak <motsak@…>, 13 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
RevLine 
[493c477]1/* emacs edit mode for this file is -*- C++ -*- */
[341696]2/* $Id$ */
[2dd068]3
[e4fe2b]4#include "config.h"
[9d7aaa]5
[650f2d8]6#include "cf_assert.h"
[20040f]7
[2dd068]8#include "cf_defs.h"
9#include "int_cf.h"
10#include "canonicalform.h"
[ab0444]11#include "cf_factory.h"
[2dd068]12
[f23b9a]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
[ab0444]28//{{{ CanonicalForm InternalCF::lc (), Lc (), LC ()
29// docu: see CanonicalForm::lc(), Lc(), LC()
30CanonicalForm
31InternalCF::lc ()
32{
33    return CanonicalForm( copyObject() );
34}
[2dd068]35
36CanonicalForm
[ab0444]37InternalCF::Lc ()
[2dd068]38{
39    return CanonicalForm( copyObject() );
40}
41
42CanonicalForm
[ab0444]43InternalCF::LC ()
[2dd068]44{
45    return CanonicalForm( copyObject() );
46}
[ab0444]47//}}}
[2dd068]48
[ab0444]49//{{{ int InternalCF::degree ()
50// docu: see CanonicalForm::degree()
[2dd068]51int
[ab0444]52InternalCF::degree ()
[2dd068]53{
54    if ( isZero() )
[806c18]55        return -1;
[2dd068]56    else
[806c18]57        return 0;
[2dd068]58}
[ab0444]59//}}}
[2dd068]60
[ab0444]61//{{{ CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree ()
62// docu: see CanonicalForm::tailcoeff(), taildegree()
[2dd068]63CanonicalForm
[ab0444]64InternalCF::tailcoeff ()
[2dd068]65{
66    return CanonicalForm( copyObject() );
67}
68
69int
[ab0444]70InternalCF::taildegree ()
[2dd068]71{
[a1ec00e]72    if ( isZero() )
[806c18]73        return -1;
[a1ec00e]74    else
[806c18]75        return 0;
[2dd068]76}
[ab0444]77//}}}
[2dd068]78
[24725be]79//{{{ InternalCF * InternalCF::num (), den ()
[ab0444]80// docu: see CanonicalForm::num(), den()
[24725be]81InternalCF *
[ab0444]82InternalCF::num ()
[2dd068]83{
[ab0444]84    return copyObject();
[2dd068]85}
86
[24725be]87InternalCF *
[ab0444]88InternalCF::den ()
[2dd068]89{
[ab0444]90    return CFFactory::basic( 1 );
[2dd068]91}
[ab0444]92//}}}
[2dd068]93
[24725be]94//{{{ InternalCF * InternalCF::sqrt ()
[ab0444]95// docu: see CanonicalForm::sqrt()
[24725be]96InternalCF *
[ab0444]97InternalCF::sqrt ()
[2dd068]98{
[a1ec00e]99    ASSERT1( 0, "sqrt() not implemented for class %s", this->classname() );
[2dd068]100    return 0;
101}
[ab0444]102//}}}
[2dd068]103
[ab0444]104//{{{ int InternalCF::ilog2 ()
105// docu: see CanonicalForm::ilog2()
106int
107InternalCF::ilog2 ()
[2dd068]108{
[a1ec00e]109    ASSERT1( 0, "ilog2() not implemented for class %s", this->classname() );
[ab0444]110    return 0;
[2dd068]111}
[ab0444]112//}}}
[2dd068]113
[a1ec00e]114//{{{ CanonicalForm InternalCF::coeff ( int i )
115// docu: see CanonicalForm::operator []()
[ab0444]116CanonicalForm
[ea023f]117InternalCF::coeff ( int i )
[2dd068]118{
[ab0444]119    if ( i == 0 )
[806c18]120        return CanonicalForm( copyObject() );
[ab0444]121    else
[806c18]122        return CanonicalForm( 0 );
[2dd068]123}
[a1ec00e]124//}}}
[2dd068]125
[05d0b3]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
[2dd068]162int
[ab0444]163InternalCF::intval() const
[2dd068]164{
[a1ec00e]165    ASSERT1( 0, "intval() not implemented for class %s", this->classname() );
[2dd068]166    return 0;
167}
168
169InternalCF*
[ab0444]170InternalCF::invert()
[2dd068]171{
[a1ec00e]172    ASSERT1( 0, "invert() not implemented for class %s", this->classname() );
[179ba9]173    return 0;
174}
[e28e6d]175
176InternalCF*
[0349c20]177InternalCF::tryMulsame( InternalCF*, const CanonicalForm&)
[e28e6d]178{
179    ASSERT1( 0, "tryMulsame() not implemented for class %s", this->classname() );
180    return 0;
181}
182
183InternalCF*
[0349c20]184InternalCF::tryInvert ( const CanonicalForm&, bool&)
[e28e6d]185{
186    ASSERT1( 0, "tryInvert() not implemented for class %s", this->classname() );
187    return 0;
188}
189
190bool
[0349c20]191InternalCF::tryDivremsamet ( InternalCF*, InternalCF*&, InternalCF*&, const CanonicalForm&, bool&)
[e28e6d]192{
193    ASSERT1( 0, "tryDivremsamet() not implemented for class %s", this->classname() );
194    return 0;
195}
196
197bool
[0349c20]198InternalCF::tryDivremcoefft ( InternalCF*, InternalCF*&, InternalCF*&, bool, const CanonicalForm&, bool&)
[e28e6d]199{
200    ASSERT1( 0, "tryDivremcoefft() not implemented for class %s", this->classname() );
201    return 0;
202}
203
204InternalCF*
[0349c20]205InternalCF::tryDivsame ( InternalCF*, const CanonicalForm&, bool&)
[e28e6d]206{
207    ASSERT1( 0, "tryDivsame() not implemented for class %s", this->classname() );
208    return 0;
209}
210
211InternalCF*
[0349c20]212InternalCF::tryDivcoeff ( InternalCF*, bool, const CanonicalForm&, bool&)
[e28e6d]213{
214    ASSERT1( 0, "tryDivcoeff() not implemented for class %s", this->classname() );
215    return 0;
216}
217
218InternalCF*
[0349c20]219InternalCF::tryDividecoeff ( InternalCF*, bool, const CanonicalForm&, bool&)
[e28e6d]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.