obj::calc::Monomial Class Reference

A Monomial is a Product of a numeric Exponented and a literal Item. More...

Inheritance diagram for obj::calc::Monomial:
obj::calc::Product obj::calc::Operation obj::calc::Exponented obj::calc::Calculable obj::Printable

List of all members.

Public Member Functions

def __init__
 Constructor.
def __str__
 Raw display of the Monomial (debugging method).
def is_null
 True if it's the null Monomial.
def is_numeric
 True if Monomial's degree is 0 or lib.ZERO_POLYNOMIAL_DEGREE.
def is_positive
 True if Monomial's coefficient's *sign* is '+'.
def is_negative
 True if Monomial's coefficient's *sign* is '-'.
def get_sign
 Gets the sign of the Monomial.
def get_coeff
 Returns the numeric coefficient of the Monomial.
def get_value
 Gets the value (value_object.value) of a Monomial of degree 0.
def get_degree
 Returns the degree of the Monomial (i.e.
def get_letter
 Returns the letter of the Monomial.
def set_sign
 Set the sign of the object.
def set_letter
 Sets the letter of the Monomial.
def set_degree
 Set the degree of the Monomial.
def set_coeff
 Set the degree of the Monomial.
def plus
 The Sum Monomial + object (returned as a Polynomial if possible).

Detailed Description

A Monomial is a Product of a numeric Exponented and a literal Item.

Definition at line 6718 of file __init__.py.


Member Function Documentation

def obj::calc::Monomial::__init__ (   self,
  arg,
  options 
)

Constructor.

Warning:
Might raise an UncompatibleType exception.
Parameters:
arg __.DEFAULT|Monomial|(sign, coeff, degree)|....... Possible arguments are :

  • __.DEFAULT, which is equivalent to ('+', 1, 0)
  • another Monomial which will be copied
  • (sign, coeff, degree) where coeff is a number and degree an integer
  • (coeff, degree) where coeff's numeric Exponented & degree an integer
  • (__.RANDOMLY, max_coeff, max_degree) where max_* are integers A Monomial will always be by default compact displayed (i.e. 2x and not 2×x). If the argument isn't of the kinds listed above, an exception will be raised.
options any option Options can be :

  • randomly_plus_signs_ratio : will be effective only in the case of (__.RANDOMLY, max_coeff, max_degree) arg. In this case, the random choice of the sign of the Monomial will respect the given ratio
Returns:
A instance of Monomial

Definition at line 6746 of file __init__.py.

def obj::calc::Monomial::__str__ (   self,
  options 
)

Raw display of the Monomial (debugging method).

Parameters:
options No option available so far
Returns:
A string containing " << coeff × X ^ degree>> "

Reimplemented from obj::calc::Operation.

Definition at line 6850 of file __init__.py.

def obj::calc::Monomial::get_coeff (   self  ) 

Returns the numeric coefficient of the Monomial.

Returns:
The numeric coefficient of the Monomial

Definition at line 6937 of file __init__.py.

def obj::calc::Monomial::get_degree (   self  ) 

Returns the degree of the Monomial (i.e.

exponent of factor[1])

Returns:
The degree of the Monomial

Definition at line 6964 of file __init__.py.

def obj::calc::Monomial::get_letter (   self  ) 

Returns the letter of the Monomial.

Returns:
The letter of the Monomial

Reimplemented from obj::calc::Operation.

Definition at line 6978 of file __init__.py.

def obj::calc::Monomial::get_sign (   self  ) 

Gets the sign of the Monomial.

Returns:
The sign of the Monomial

Reimplemented from obj::calc::Operation.

Definition at line 6921 of file __init__.py.

def obj::calc::Monomial::get_value (   self  ) 

Gets the value (value_object.value) of a Monomial of degree 0.

Warning:
Raises an error if asked on non-degree-0 Monomial
Returns:
value_object.value

Definition at line 6951 of file __init__.py.

def obj::calc::Monomial::is_negative (   self  ) 

True if Monomial's coefficient's *sign* is '-'.

Todo:
How to answer to the question if this Monomial is null ?

Definition at line 6910 of file __init__.py.

def obj::calc::Monomial::is_positive (   self  ) 

True if Monomial's coefficient's *sign* is '+'.

Todo:
How to answer to the question if this Monomial is null ?

Definition at line 6898 of file __init__.py.

def obj::calc::Monomial::plus (   self,
  objct 
)

The Sum Monomial + object (returned as a Polynomial if possible).

Parameters:
objct The second object to be added with

Reimplemented from obj::calc::Calculable.

Definition at line 7046 of file __init__.py.


The documentation for this class was generated from the following file:
Generated on Fri Dec 30 19:26:37 2011 for mathmaker by  doxygen 1.6.3