My Project  debian-1:4.1.2-p1+ds-2
Public Member Functions | Private Attributes
Factor< T > Class Template Reference

#include <ftmpl_factor.h>

Public Member Functions

 Factor ()
 
 Factor (const Factor< T > &f)
 
 Factor (const T &f, int e)
 
 Factor (const T &f)
 
 ~Factor ()
 
Factor< T > & operator= (const Factor< T > &)
 
Factor< T > & operator= (const T &)
 
T factor () const
 
int exp () const
 
T value () const
 
Factor< T > & operator+= (int i)
 
Factor< T > & operator*= (int i)
 
Factor< T > & operator*= (const T &f)
 
void print (OSTREAM &) const
 

Private Attributes

T _factor
 
int _exp
 

Detailed Description

template<class T>
class Factor< T >

Definition at line 18 of file ftmpl_factor.h.

Constructor & Destructor Documentation

◆ Factor() [1/4]

template<class T>
Factor< T >::Factor ( )
inline

Definition at line 23 of file ftmpl_factor.h.

23 : _factor(1), _exp(0) {}

◆ Factor() [2/4]

template<class T>
Factor< T >::Factor ( const Factor< T > &  f)
inline

Definition at line 24 of file ftmpl_factor.h.

24 : _factor(f._factor), _exp(f._exp) {}

◆ Factor() [3/4]

template<class T>
Factor< T >::Factor ( const T f,
int  e 
)
inline

Definition at line 25 of file ftmpl_factor.h.

25 : _factor(f), _exp(e) {}

◆ Factor() [4/4]

template<class T>
Factor< T >::Factor ( const T f)
inline

Definition at line 26 of file ftmpl_factor.h.

26 : _factor(f), _exp(1) {}

◆ ~Factor()

template<class T>
Factor< T >::~Factor ( )
inline

Definition at line 27 of file ftmpl_factor.h.

27 {}

Member Function Documentation

◆ exp()

template<class T>
int Factor< T >::exp ( ) const
inline

Definition at line 31 of file ftmpl_factor.h.

31 { return _exp; }

◆ factor()

template<class T>
T Factor< T >::factor ( ) const
inline

Definition at line 30 of file ftmpl_factor.h.

30 { return _factor; }

◆ operator*=() [1/2]

template<class T>
Factor<T>& Factor< T >::operator*= ( const T f)
inline

Definition at line 35 of file ftmpl_factor.h.

35 { _factor *= f; return *this; }

◆ operator*=() [2/2]

template<class T>
Factor<T>& Factor< T >::operator*= ( int  i)
inline

Definition at line 34 of file ftmpl_factor.h.

34 { _exp *= i; return *this; }

◆ operator+=()

template<class T>
Factor<T>& Factor< T >::operator+= ( int  i)
inline

Definition at line 33 of file ftmpl_factor.h.

33 { _exp += i; return *this; }

◆ operator=() [1/2]

template<class T >
Factor< T > & Factor< T >::operator= ( const Factor< T > &  f)

Definition at line 6 of file ftmpl_factor.cc.

7 {
8  if ( this != &f ) {
9  _factor = f._factor;
10  _exp = f._exp;
11  }
12  return *this;
13 }

◆ operator=() [2/2]

template<class T >
Factor< T > & Factor< T >::operator= ( const T f)

Definition at line 16 of file ftmpl_factor.cc.

17 {
18  _factor = f;
19  _exp = 1;
20  return *this;
21 }

◆ print()

template<class T >
void Factor< T >::print ( OSTREAM s) const

Definition at line 31 of file ftmpl_factor.cc.

32 {
33  if ( exp() == 1 )
34  s << factor();
35  else
36  s << "(" << factor() << ")^" << exp();
37 }

◆ value()

template<class T>
T Factor< T >::value ( ) const
inline

Definition at line 32 of file ftmpl_factor.h.

32 { return power( _factor, _exp ); }

Field Documentation

◆ _exp

template<class T>
int Factor< T >::_exp
private

Definition at line 21 of file ftmpl_factor.h.

◆ _factor

template<class T>
T Factor< T >::_factor
private

Definition at line 20 of file ftmpl_factor.h.


The documentation for this class was generated from the following files:
f
FILE * f
Definition: checklibs.c:9
Factor::factor
T factor() const
Definition: ftmpl_factor.h:30
power
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
Definition: canonicalform.cc:1837
i
int i
Definition: cfEzgcd.cc:125
Factor::exp
int exp() const
Definition: ftmpl_factor.h:31
Factor::_factor
T _factor
Definition: ftmpl_factor.h:20
Factor::_exp
int _exp
Definition: ftmpl_factor.h:21
s
const CanonicalForm int s
Definition: facAbsFact.cc:55