nmn::Polynomius Class Reference

Useful class for algebric polynomius calculus and its evaluation. More...

#include <polynomius.h>

List of all members.

Public Member Functions

 Polynomius ()
 Constructor.
 Polynomius (const Polynomius &polynomius)
 Copy constructor.
 Polynomius (const Float &constant_value)
 Constructor.
 ~Polynomius ()
 Destructor.
Float evaluate (const Float &variable_value) const
 Evaluates the polynomius.
Polynomius derive () const
 Derives the polynomius.
const UnsignedInt getDegree () const
 Returns the polynomius degree.
const std::vector< Float > & getCoefficients () const
 Returns the vector of coefficients.
void setCoefficients (const std::vector< Float > &coeffcients)
 Sets the vector of coefficients.

Protected Attributes

std::vector< Float_coefficients

Friends

Polynomius operator+ (const Polynomius &first_polynomius_addendum, const Polynomius &second_polynomius_addendum)
 Returns the sum of two polynomius.
Polynomius operator * (const Polynomius &polynomius, const Float &scalar_value)
 Returns the product of a polynomius by a scalar value.
Polynomius promote (const Polynomius &polynomius)
 Returns the polynomius polynomius with degree incremented by 1.


Detailed Description

Useful class for algebric polynomius calculus and its evaluation.

A polynomius could be considered as a vector of coefficients, where the first element is the coefficent of the polynomius' variable having bigger exponent and the last element is the coeffcient of the polynomius variable having the exponent equal to 0. Note that the degree of the polynomius is the vector of coefficients size minus 1.


Constructor & Destructor Documentation

nmn::Polynomius::Polynomius (  ) 

Constructor.

Pushes back into the vector of coefficients the value 0, that is the polynomius correspond to the value 0. Let's this polynomius p(x) then this constructor sets p(x)=0.

nmn::Polynomius::Polynomius ( const Polynomius polynomius  ) 

Copy constructor.

Parameters:
polynomius polynomius to be copied. Does a hard copy of the polynomius vector of coefficients.

nmn::Polynomius::Polynomius ( const Float constant_value  ) 

Constructor.

Parameters:
constant_value constant value for polynomius initialization.
Initializes the polynomius to a constant value value. Let's this polynomius p(x) then this constructor sets p(x)=constant_value.

nmn::Polynomius::~Polynomius (  ) 

Destructor.


Member Function Documentation

Polynomius nmn::Polynomius::derive (  )  const

Derives the polynomius.

Evaluates the derivative of the polynomius by setting the vector of coefficients properly.

Float nmn::Polynomius::evaluate ( const Float variable_value  )  const

Evaluates the polynomius.

Evaluates the polynomius for a fixed value of the polynomius' variable. Let's this polynomius p(x) then this method returns p(variable_value).

const std::vector< Float > & nmn::Polynomius::getCoefficients (  )  const

Returns the vector of coefficients.

const UnsignedInt nmn::Polynomius::getDegree (  )  const

Returns the polynomius degree.

Returns the polynomius' degree that is the size of the vector of coefficients minus 1.

void nmn::Polynomius::setCoefficients ( const std::vector< Float > &  coeffcients  ) 

Sets the vector of coefficients.


Friends And Related Function Documentation

Polynomius operator * ( const Polynomius polynomius,
const Float scalar_value 
) [friend]

Returns the product of a polynomius by a scalar value.

Parameters:
polynomius polynomius to be multiplied
scalar_value scalar value's going to multiply
Let's polynomius = p(x) then this method returns r(x) = p(x)*scalar_value.

Polynomius operator+ ( const Polynomius first_polynomius_addendum,
const Polynomius second_polynomius_addendum 
) [friend]

Returns the sum of two polynomius.

Parameters:
first_polynomius_addendum first polynomius addendum
second_polynomius_addendum second polynomius addendum
Returns the sum of the two polynomius passed as arguments. Let's first_polynomius_addendum = p(x) and second_polynomius_addendum = q(x) then this method returns r(x) = p(x)+q(x).

Polynomius promote ( const Polynomius polynomius  )  [friend]

Returns the polynomius polynomius with degree incremented by 1.

Parameters:
polynomius polynomius to promote at higher degree
Returns the polynomius polynomius with its degree incremented by 1, as the same if a multiplication by incognite variable was performed. Let's polynomius = p(x) then this method returns r(x) = p(x)*x.


Member Data Documentation

std::vector< Float > nmn::Polynomius::_coefficients [protected]


The documentation for this class was generated from the following files:
Generated on Sun Nov 18 21:29:41 2007 for nmnurbs by  doxygen 1.4.7