Loading...
Searching...
No Matches
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.

: _factor(1), _exp(0) {}
Factor::_factor
T _factor
Definition ftmpl_factor.h:20
Factor::_exp
int _exp
Definition ftmpl_factor.h:21

## Factor() [2/4]

template<class T>

Factor< T >::Factor | ( | const Factor< T > & | f | ) |

inline

Definition at line 24 of file ftmpl_factor.h.

: _factor(f._factor), _exp(f._exp) {}
Factor
Definition ftmpl_factor.h:18

## Factor() [3/4]

template<class T>

Factor< T >::Factor | ( | const T & | f,
|  | int | e )

inline

Definition at line 25 of file ftmpl_factor.h.

: _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.

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

## ~Factor()

template<class T>

Factor< T >::~Factor | ( |  | ) |

inline

Definition at line 27 of file ftmpl_factor.h.

{}

## Member Function Documentation

## exp()

template<class T>

int Factor< T >::exp | ( |  | ) | const

inline

Definition at line 31 of file ftmpl_factor.h.

{ return _exp; }

## factor()

template<class T>

T Factor< T >::factor | ( |  | ) | const

inline

Definition at line 30 of file ftmpl_factor.h.

{ 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.

{ _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.

{ _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.

{ _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.

{
if ( this != &f ) {
_factor = f._factor;
_exp = f._exp;
}
return *this;
}

## operator=() [2/2]

template<class T>

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

Definition at line 16 of file ftmpl_factor.cc.

{
_factor = f;
_exp = 1;
return *this;
}

## print()

template<class T>

void Factor< T >::print | ( | OSTREAM & | s | ) | const

Definition at line 31 of file ftmpl_factor.cc.

{
if ( exp() == 1 )
s << factor();
else
s << "(" << factor() << ")^" << exp();
}
Factor::exp
int exp() const
Definition ftmpl_factor.h:31
Factor::factor
T factor() const
Definition ftmpl_factor.h:30

## value()

template<class T>

T Factor< T >::value | ( |  | ) | const

inline

Definition at line 32 of file ftmpl_factor.h.

{ return power( _factor, _exp ); }
power
CanonicalForm power(const CanonicalForm &f, int n)
exponentiation
Definition canonicalform.cc:1896

## 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:

- factory/include/factory/templates/ftmpl_factor.h
- factory/templates/ftmpl_factor.cc