Arageli::monom< F, I > Class Template Reference

Monom template definition. More...

#include <sparse_polynom.hpp>

List of all members.

Public Types

typedef F coef_type
 Coefficient type.
typedef I degree_type
 Degree type.

Public Member Functions

 monom ()
 Zero monom.
 monom (const F &c)
 Monom with zero degree (i.e. a constant of type F).
 monom (const F &c, const I &d)
 Creates monom of common form.
template<typename F1, typename I1>
 monom (const monom< F1, I1 > &x)
 Initialization with conversion from monom with any other actual template arguments.
 monom (const char *s)
 Initialization from a string representation of monom.
template<typename F1, typename I1>
monomoperator= (const monom< F1, I1 > &x)
monomoperator= (const char *s)
bool is_const () const
 Determines if monom is constant.
bool is_null () const
 Determines if monom is zero monom.
bool is_unit () const
 Determines if monom is unit.
bool is_opposite_unit () const
 Determines if monom is minus unit.
bool is_x () const
 Returns true if monom is "x".
const coef_typecoef () const
 Access to the coefficient. Read only.
coef_typecoef ()
 Access to the coefficient.
const degree_typedegree () const
 Access to the degree. Read only.
degree_typedegree ()
 Access to the degree.
template<typename F1, typename I1>
bool can_add (const monom< F1, I1 > &x) const
 Determines if monoms are correct for addition.
monomopposite ()
 Inverts the coefficient to opposite value.
monom operator- () const
 Returns a monom with opposite coefficient.
const monomoperator+ () const
 Returns a reference on this monom. For symmetry with operator- only.
monomoperator++ ()
monom operator++ (int)
monomoperator-- ()
monom operator-- (int)
template<typename F1>
monomoperator+= (const F1 &x)
 Adds constant to this monom.
template<typename F1>
monomoperator-= (const F1 &x)
 Subtracts constant to this monom.
template<typename F1>
monomoperator *= (const F1 &x)
 Multilies this monom by constant.
template<typename F1>
monomoperator/= (const F1 &x)
 Divides this monom by constant.
template<typename F1>
monomoperator%= (const F1 &x)
 Computes remainder from division this monom by constant.
template<typename F1, typename I1>
monomoperator+= (const monom< F1, I1 > &x)
 Adds two monoms.
template<typename F1, typename I1>
monomoperator-= (const monom< F1, I1 > &x)
 Subtracts two monoms.
template<typename F1, typename I1>
monomoperator *= (const monom< F1, I1 > &x)
 Multilies two monoms.
template<typename F1, typename I1>
monomoperator/= (const monom< F1, I1 > &x)
 Divides two monoms.
template<typename F1, typename I1>
monomoperator%= (const monom< F1, I1 > &x)
 Computes remainder from division this monom by another monom.
template<typename F1, typename I1>
void swap (monom< F1, I1 > &x)
 Swaps two monom values.


Detailed Description

template<typename F, typename I>
class Arageli::monom< F, I >

Monom template definition.

A monom is a pair of coefficient and degree.

Parameters:
F type of a coefficient
I type of a degree

Definition at line 70 of file sparse_polynom.hpp.


Member Typedef Documentation

template<typename F, typename I>
typedef F Arageli::monom< F, I >::coef_type

Coefficient type.

Definition at line 77 of file sparse_polynom.hpp.

template<typename F, typename I>
typedef I Arageli::monom< F, I >::degree_type

Degree type.

Definition at line 78 of file sparse_polynom.hpp.


Constructor & Destructor Documentation

template<typename F, typename I>
Arageli::monom< F, I >::monom (  )  [inline]

Zero monom.

Creates monom with zero coefficient and zero degree.

Definition at line 82 of file sparse_polynom.hpp.

template<typename F, typename I>
Arageli::monom< F, I >::monom ( const F &  c  )  [inline]

Monom with zero degree (i.e. a constant of type F).

Creates monom with zero degree and given coefficient.

Parameters:
c the coefficient.

Definition at line 87 of file sparse_polynom.hpp.

template<typename F, typename I>
Arageli::monom< F, I >::monom ( const F &  c,
const I &  d 
) [inline]

Creates monom of common form.

Parameters:
c the coefficient
d degree

Definition at line 92 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1, typename I1>
Arageli::monom< F, I >::monom ( const monom< F1, I1 > &  x  )  [inline]

Initialization with conversion from monom with any other actual template arguments.

Definition at line 96 of file sparse_polynom.hpp.

template<typename F, typename I>
Arageli::monom< F, I >::monom ( const char *  s  ) 

Initialization from a string representation of monom.

Rule for the argument string is the same as for operator>>.


Member Function Documentation

template<typename F, typename I>
template<typename F1, typename I1>
bool Arageli::monom< F, I >::can_add ( const monom< F1, I1 > &  x  )  const [inline]

Determines if monoms are correct for addition.

Returns true if this monom can add with the argument, i.e. if they have the same degrees.

Definition at line 159 of file sparse_polynom.hpp.

template<typename F, typename I>
coef_type& Arageli::monom< F, I >::coef (  )  [inline]

Access to the coefficient.

Definition at line 147 of file sparse_polynom.hpp.

template<typename F, typename I>
const coef_type& Arageli::monom< F, I >::coef (  )  const [inline]

Access to the coefficient. Read only.

Definition at line 144 of file sparse_polynom.hpp.

template<typename F, typename I>
degree_type& Arageli::monom< F, I >::degree (  )  [inline]

Access to the degree.

Definition at line 153 of file sparse_polynom.hpp.

template<typename F, typename I>
const degree_type& Arageli::monom< F, I >::degree (  )  const [inline]

Access to the degree. Read only.

Definition at line 150 of file sparse_polynom.hpp.

template<typename F, typename I>
bool Arageli::monom< F, I >::is_const (  )  const [inline]

Determines if monom is constant.

Returns true if the degree is zero value.

Definition at line 115 of file sparse_polynom.hpp.

template<typename F, typename I>
bool Arageli::monom< F, I >::is_null (  )  const [inline]

Determines if monom is zero monom.

Returns true if the coefficient is zero value. The result does not depend on the degree value.

Definition at line 120 of file sparse_polynom.hpp.

template<typename F, typename I>
bool Arageli::monom< F, I >::is_opposite_unit (  )  const [inline]

Determines if monom is minus unit.

Returns true if the coefficient is minus unit and the degree is zero value

Definition at line 131 of file sparse_polynom.hpp.

template<typename F, typename I>
bool Arageli::monom< F, I >::is_unit (  )  const [inline]

Determines if monom is unit.

Returns ture if the coefficient is unit and the degree is zero value.

Definition at line 125 of file sparse_polynom.hpp.

template<typename F, typename I>
bool Arageli::monom< F, I >::is_x (  )  const [inline]

Returns true if monom is "x".

Returns true if degree = 1 and coefficient = 1.

Definition at line 140 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1, typename I1>
monom& Arageli::monom< F, I >::operator *= ( const monom< F1, I1 > &  x  )  [inline]

Multilies two monoms.

Multilies this monom by the argument x. Returns reference to this monom.

Definition at line 278 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1>
monom& Arageli::monom< F, I >::operator *= ( const F1 &  x  )  [inline]

Multilies this monom by constant.

Multilies this monom by the argument x. Returns reference to this monom.

Definition at line 221 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1, typename I1>
monom& Arageli::monom< F, I >::operator%= ( const monom< F1, I1 > &  x  )  [inline]

Computes remainder from division this monom by another monom.

Divides this monom by the argument x and assign the result to this monom object. Returns reference to this monom. Requirement: x is not zero.

Definition at line 312 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1>
monom& Arageli::monom< F, I >::operator%= ( const F1 &  x  )  [inline]

Computes remainder from division this monom by constant.

Divides this monom by the argument x and assign the result to this monom object. Returns reference to this monom. Requirement: x is not zero.

Definition at line 244 of file sparse_polynom.hpp.

template<typename F, typename I>
const monom& Arageli::monom< F, I >::operator+ (  )  const [inline]

Returns a reference on this monom. For symmetry with operator- only.

Definition at line 174 of file sparse_polynom.hpp.

template<typename F, typename I>
monom Arageli::monom< F, I >::operator++ ( int   )  [inline]

Definition at line 183 of file sparse_polynom.hpp.

template<typename F, typename I>
monom& Arageli::monom< F, I >::operator++ (  )  [inline]

Definition at line 176 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1, typename I1>
monom& Arageli::monom< F, I >::operator+= ( const monom< F1, I1 > &  x  )  [inline]

Adds two monoms.

Adds the argument x to this monom. Returns reference to this monom. Requirement: this->can_add(x).

Definition at line 255 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1>
monom& Arageli::monom< F, I >::operator+= ( const F1 &  x  )  [inline]

Adds constant to this monom.

Adds the argument x to this monom. Returns reference to this monom. Requirement: this->is_const().

Definition at line 198 of file sparse_polynom.hpp.

template<typename F, typename I>
monom Arageli::monom< F, I >::operator- (  )  const [inline]

Returns a monom with opposite coefficient.

Definition at line 170 of file sparse_polynom.hpp.

template<typename F, typename I>
monom Arageli::monom< F, I >::operator-- ( int   )  [inline]

Definition at line 192 of file sparse_polynom.hpp.

template<typename F, typename I>
monom& Arageli::monom< F, I >::operator-- (  )  [inline]

Definition at line 185 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1, typename I1>
monom& Arageli::monom< F, I >::operator-= ( const monom< F1, I1 > &  x  )  [inline]

Subtracts two monoms.

Subtracts the argument x to this monom. Returns reference to this monom. Requirement: this->can_add(x).

Definition at line 267 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1>
monom& Arageli::monom< F, I >::operator-= ( const F1 &  x  )  [inline]

Subtracts constant to this monom.

Subtracts the argument x to this monom. Returns reference to this monom. Requirement: this->is_const().

Definition at line 210 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1, typename I1>
monom& Arageli::monom< F, I >::operator/= ( const monom< F1, I1 > &  x  )  [inline]

Divides two monoms.

Divides this monom by the argument x. Returns reference to this monom.

Definition at line 289 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1>
monom& Arageli::monom< F, I >::operator/= ( const F1 &  x  )  [inline]

Divides this monom by constant.

Divides this monom by the argument x. Returns reference to this monom. Requirement: x is not zero.

Definition at line 232 of file sparse_polynom.hpp.

template<typename F, typename I>
monom& Arageli::monom< F, I >::operator= ( const char *  s  )  [inline]

Definition at line 110 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1, typename I1>
monom& Arageli::monom< F, I >::operator= ( const monom< F1, I1 > &  x  )  [inline]

Definition at line 104 of file sparse_polynom.hpp.

template<typename F, typename I>
monom& Arageli::monom< F, I >::opposite (  )  [inline]

Inverts the coefficient to opposite value.

Definition at line 163 of file sparse_polynom.hpp.

template<typename F, typename I>
template<typename F1, typename I1>
void Arageli::monom< F, I >::swap ( monom< F1, I1 > &  x  )  [inline]

Swaps two monom values.

Definition at line 321 of file sparse_polynom.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Aug 31 17:38:27 2006 for Arageli by  doxygen 1.4.7