source: git/factory/int_cf.cc @ d8a7da

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