source: git/factory/int_cf.cc @ c1b9927

spielwiese
Last change on this file since c1b9927 was 806c18, checked in by Hans Schoenemann <hannes@…>, 13 years ago
format git-svn-id: file:///usr/local/Singular/svn/trunk@13655 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.4 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id$ */
3
4#include <config.h>
5
6#include "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}
Note: See TracBrowser for help on using the repository browser.