My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
factory
include
factory
templates
ftmpl_factor.h
Go to the documentation of this file.
1
/* emacs edit mode for this file is -*- C++ -*- */
2
3
#ifndef INCL_FACTOR_H
4
#define INCL_FACTOR_H
5
6
#ifndef NOSTREAMIO
7
#ifdef HAVE_IOSTREAM
8
#include <iostream>
9
#define OSTREAM std::ostream
10
#elif defined(HAVE_IOSTREAM_H)
11
#include <iostream.h>
12
#define OSTREAM ostream
13
#endif
14
#endif
/* NOSTREAMIO */
15
16
17
template
<
class
T>
18
class
Factor
{
19
private
:
20
T
_factor
;
21
int
_exp
;
22
public
:
23
Factor
() :
_factor
(1),
_exp
(0) {}
24
Factor
(
const
Factor<T>
&
f
) :
_factor
(
f
.
_factor
),
_exp
(
f
.
_exp
) {}
25
Factor
(
const
T
&
f
,
int
e ) :
_factor
(
f
),
_exp
(e) {}
26
Factor
(
const
T
&
f
) :
_factor
(
f
),
_exp
(1) {}
27
~Factor
() {}
28
Factor<T>
&
operator=
(
const
Factor<T>
& );
29
Factor<T>
&
operator=
(
const
T
& );
30
T
factor
()
const
{
return
_factor
; }
31
int
exp
()
const
{
return
_exp
; }
32
T
value
()
const
{
return
power
(
_factor
,
_exp
); }
33
Factor<T>
&
operator+=
(
int
i
) {
_exp
+=
i
;
return
*
this
; }
34
Factor<T>
&
operator*=
(
int
i
) {
_exp
*=
i
;
return
*
this
; }
35
Factor<T>
&
operator*=
(
const
T
&
f
) {
_factor
*=
f
;
return
*
this
; }
36
#ifndef NOSTREAMIO
37
void
print
(
OSTREAM
& )
const
;
38
#endif
/* NOSTREAMIO */
39
};
40
41
template
<
class
T>
int
42
operator==
(
const
Factor<T>
&,
const
Factor<T>
& );
43
44
#ifndef NOSTREAMIO
45
template
<
class
T>
46
OSTREAM
&
operator<<
(
OSTREAM
& os,
const
Factor<T>
&
f
);
47
#endif
/* NOSTREAMIO */
48
49
#endif
/* ! INCL_FACTOR_H */
power
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
Definition
canonicalform.cc:1896
OSTREAM
#define OSTREAM
Definition
canonicalform.h:16
i
int i
Definition
cfEzgcd.cc:132
f
FILE * f
Definition
checklibs.c:9
Factor
Definition
ftmpl_factor.h:18
Factor::operator=
Factor< T > & operator=(const Factor< T > &)
Definition
ftmpl_factor.cc:6
Factor::~Factor
~Factor()
Definition
ftmpl_factor.h:27
Factor::print
void print(OSTREAM &) const
Definition
ftmpl_factor.cc:31
Factor::Factor
Factor(const Factor< T > &f)
Definition
ftmpl_factor.h:24
Factor::operator+=
Factor< T > & operator+=(int i)
Definition
ftmpl_factor.h:33
Factor::operator*=
Factor< T > & operator*=(int i)
Definition
ftmpl_factor.h:34
Factor::exp
int exp() const
Definition
ftmpl_factor.h:31
Factor::value
T value() const
Definition
ftmpl_factor.h:32
Factor::factor
T factor() const
Definition
ftmpl_factor.h:30
Factor< CanonicalForm >::_factor
CanonicalForm _factor
Definition
ftmpl_factor.h:20
Factor::Factor
Factor(const T &f)
Definition
ftmpl_factor.h:26
Factor::Factor
Factor(const T &f, int e)
Definition
ftmpl_factor.h:25
Factor< CanonicalForm >::_exp
int _exp
Definition
ftmpl_factor.h:21
Factor::Factor
Factor()
Definition
ftmpl_factor.h:23
operator<<
OSTREAM & operator<<(OSTREAM &os, const Factor< T > &f)
Definition
ftmpl_factor.cc:40
operator==
int operator==(const Factor< T > &, const Factor< T > &)
Definition
ftmpl_factor.cc:24
T
STATIC_VAR jList * T
Definition
janet.cc:30
Generated on
for My Project by
doxygen 1.17.0
for
Singular