source: git/factory/int_cf.cc @ 194f5e5

spielwiese
Last change on this file since 194f5e5 was 05d0b3, checked in by Jens Schmidt <schmidt@…>, 26 years ago
* int_cf.cc, int_int.cc int_rat.cc (bgcdsame, bgcdcoeff, bextgcdsame, bextgcdcoeff): new methods. Declarations added. git-svn-id: file:///usr/local/Singular/svn/trunk@1043 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: int_cf.cc,v 1.10 1998-01-22 10:54:00 schmidt Exp $ */
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//{{{ CanonicalForm InternalCF::lc (), Lc (), LC ()
14// docu: see CanonicalForm::lc(), Lc(), LC()
15CanonicalForm
16InternalCF::lc ()
17{
18    return CanonicalForm( copyObject() );
19}
20
21CanonicalForm
22InternalCF::Lc ()
23{
24    return CanonicalForm( copyObject() );
25}
26
27CanonicalForm
28InternalCF::LC ()
29{
30    return CanonicalForm( copyObject() );
31}
32//}}}
33
34//{{{ int InternalCF::degree ()
35// docu: see CanonicalForm::degree()
36int
37InternalCF::degree ()
38{
39    if ( isZero() )
40        return -1;
41    else
42        return 0;
43}
44//}}}
45
46//{{{ CanonicalForm InternalCF::tailcoeff (), int InternalCF::taildegree ()
47// docu: see CanonicalForm::tailcoeff(), taildegree()
48CanonicalForm
49InternalCF::tailcoeff ()
50{
51    return CanonicalForm( copyObject() );
52}
53
54int
55InternalCF::taildegree ()
56{
57    if ( isZero() )
58        return -1;
59    else
60        return 0;
61}
62//}}}
63
64//{{{ InternalCF * InternalCF::num (), den ()
65// docu: see CanonicalForm::num(), den()
66InternalCF *
67InternalCF::num ()
68{
69    return copyObject();
70}
71
72InternalCF *
73InternalCF::den ()
74{
75    return CFFactory::basic( 1 );
76}
77//}}}
78
79//{{{ InternalCF * InternalCF::sqrt ()
80// docu: see CanonicalForm::sqrt()
81InternalCF *
82InternalCF::sqrt ()
83{
84    ASSERT1( 0, "sqrt() not implemented for class %s", this->classname() );
85    return 0;
86}
87//}}}
88
89//{{{ int InternalCF::ilog2 ()
90// docu: see CanonicalForm::ilog2()
91int
92InternalCF::ilog2 ()
93{
94    ASSERT1( 0, "ilog2() not implemented for class %s", this->classname() );
95    return 0;
96}
97//}}}
98
99//{{{ CanonicalForm InternalCF::coeff ( int i )
100// docu: see CanonicalForm::operator []()
101CanonicalForm
102InternalCF::coeff ( int i )
103{
104    if ( i == 0 )
105        return CanonicalForm( copyObject() );
106    else
107        return CanonicalForm( 0 );
108}
109//}}}
110
111//{{{ InternalCF * InternalCF::bgcdsame, bgcdcoeff ( const InternalCF * const )
112// docu: see CanonicalForm::bgcd()
113InternalCF *
114InternalCF::bgcdsame ( const InternalCF * const ) const
115{
116    ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() );
117    return CFFactory::basic( 0 );
118}
119
120InternalCF *
121InternalCF::bgcdcoeff ( const InternalCF * const )
122{
123    ASSERT1( 0, "bgcd() not implemented for class %s", this->classname() );
124    return CFFactory::basic( 0 );
125}
126//}}}
127
128//{{{ InternalCF * InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b )
129// docu: see CanonicalForm::bextgcd()
130InternalCF *
131InternalCF::bextgcdsame ( InternalCF *, CanonicalForm & a, CanonicalForm & b )
132{
133    ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() );
134    a = 0; b = 0;
135    return CFFactory::basic( 0 );
136}
137
138InternalCF *
139InternalCF::bextgcdcoeff ( InternalCF *, CanonicalForm & a, CanonicalForm & b )
140{
141    ASSERT1( 0, "bextgcd() not implemented for class %s", this->classname() );
142    a = 0; b = 0;
143    return CFFactory::basic( 0 );
144}
145//}}}
146
147int
148InternalCF::intval() const
149{
150    ASSERT1( 0, "intval() not implemented for class %s", this->classname() );
151    return 0;
152}
153
154InternalCF*
155InternalCF::invert()
156{
157    ASSERT1( 0, "invert() not implemented for class %s", this->classname() );
158    return 0;
159}
Note: See TracBrowser for help on using the repository browser.