My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
factory
templates
ftmpl_afactor.cc
Go to the documentation of this file.
1
/* emacs edit mode for this file is -*- C++ -*- */
2
3
#include "
factory/templates/ftmpl_afactor.h
"
4
5
template
<
class
T>
6
AFactor<T>
&
AFactor<T>::operator=
(
const
AFactor<T>
&
f
)
7
{
8
if
(
this
!= &
f
)
9
{
10
_minpoly
=
f
._minpoly;
11
_factor
=
f
._factor;
12
_exp
=
f
._exp;
13
}
14
return
*
this
;
15
}
16
17
template
<
class
T>
18
int
operator==
(
const
AFactor<T>
&f1,
const
AFactor<T>
&f2 )
19
{
20
return
(f1.
exp
() == f2.
exp
()) && (f1.
factor
() == f2.
factor
()) && (f1.
minpoly
() == f2.
minpoly
());
//minpoly comparison may not be enough but checking the fields they define are equal
21
}
22
23
#ifndef NOSTREAMIO
24
template
<
class
T>
25
void
AFactor<T>::print
(
OSTREAM
&
s
)
const
26
{
27
if
(
exp
() == 1 )
28
s
<<
"("
<<
factor
() <<
", "
<<
minpoly
() <<
")"
;
29
else
30
s
<<
"(("
<<
factor
() <<
")^"
<<
exp
() <<
", "
<<
minpoly
() <<
")"
;
31
}
32
33
template
<
class
T>
34
OSTREAM
&
operator<<
(
OSTREAM
& os,
const
AFactor<T>
&
f
)
35
{
36
f
.print( os );
37
return
os;
38
}
39
#endif
/* NOSTREAMIO */
OSTREAM
#define OSTREAM
Definition
canonicalform.h:16
f
FILE * f
Definition
checklibs.c:9
AFactor
Definition
ftmpl_afactor.h:17
AFactor::minpoly
T minpoly() const
Definition
ftmpl_afactor.h:30
AFactor::exp
int exp() const
Definition
ftmpl_afactor.h:31
AFactor::factor
T factor() const
Definition
ftmpl_afactor.h:29
AFactor::_minpoly
T _minpoly
Definition
ftmpl_afactor.h:20
AFactor::_exp
int _exp
Definition
ftmpl_afactor.h:21
AFactor::AFactor
AFactor()
Definition
ftmpl_afactor.h:23
AFactor::_factor
T _factor
Definition
ftmpl_afactor.h:19
AFactor::print
void print(OSTREAM &) const
Definition
ftmpl_afactor.cc:25
AFactor::operator=
AFactor< T > & operator=(const AFactor< T > &)
Definition
ftmpl_afactor.cc:6
s
const CanonicalForm int s
Definition
facAbsFact.cc:51
factor
CanonicalForm factor
Definition
facAbsFact.cc:97
operator<<
OSTREAM & operator<<(OSTREAM &os, const AFactor< T > &f)
Definition
ftmpl_afactor.cc:34
operator==
int operator==(const AFactor< T > &f1, const AFactor< T > &f2)
Definition
ftmpl_afactor.cc:18
ftmpl_afactor.h
OSTREAM
#define OSTREAM
Definition
ftmpl_afactor.h:9
exp
gmp_float exp(const gmp_float &a)
Definition
mpr_complex.cc:349
Generated on
for My Project by
doxygen 1.17.0
for
Singular