Loading...
Searching...
No Matches
ftmpl_factor.cc
Go to the documentation of this file.
/* emacs edit mode for this file is -*- C++ -*- */
#include "factory/templates/ftmpl_factor.h"
template <class T>
Factor<T>& Factor<T>::operator= ( const Factor<T>& f )
{
if ( this != &f ) {
_factor = f._factor;
_exp = f._exp;
}
return *this;
}
template <class T>
Factor<T>& Factor<T>::operator= ( const T & f )
{
_factor = f;
_exp = 1;
return *this;
}
template <class T>
int operator== ( const Factor<T> &f1, const Factor<T> &f2 )
{
return (f1.exp() == f2.exp()) && (f1.factor() == f2.factor());
}
#ifndef NOSTREAMIO
template <class T>
void Factor<T>::print ( OSTREAM& s ) const
{
if ( exp() == 1 )
s << factor();
else
s << "(" << factor() << ")^" << exp();
}
template <class T>
OSTREAM& operator<< ( OSTREAM & os, const Factor<T> & f )
{
f.print( os );
return os;
}
#endif /* NOSTREAMIO */
OSTREAM
#define OSTREAM
Definition canonicalform.h:16
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::print
void print(OSTREAM &) const
Definition ftmpl_factor.cc:31
Factor::exp
int exp() const
Definition ftmpl_factor.h:31
Factor::factor
T factor() const
Definition ftmpl_factor.h:30
Factor::_factor
T _factor
Definition ftmpl_factor.h:20
Factor::_exp
int _exp
Definition ftmpl_factor.h:21
Factor::Factor
Factor()
Definition ftmpl_factor.h:23
s
const CanonicalForm int s
Definition facAbsFact.cc:51
factor
CanonicalForm factor
Definition facAbsFact.cc:97
operator<<
OSTREAM & operator<<(OSTREAM &os, const Factor< T > &f)
Definition ftmpl_factor.cc:40
operator==
int operator==(const Factor< T > &f1, const Factor< T > &f2)
Definition ftmpl_factor.cc:24
ftmpl_factor.h
OSTREAM
#define OSTREAM
Definition ftmpl_factor.h:9
T
STATIC_VAR jList * T
Definition janet.cc:30
exp
gmp_float exp(const gmp_float &a)
Definition mpr_complex.cc:349