Has Exponented factors & an exponent. More...
Public Member Functions | |
def | __init__ |
Constructor. | |
def | is_null |
True if any of the factors is null. | |
def | set_exponent |
Sets the exponent of the Product. | |
def | get_elements |
Allow the subclasses to access to their elements. | |
def | get_info |
Allow the subclasses to access this field. | |
def | operator |
Defines the performed Operation as a Product. | |
def | __cmp__ |
Compares two Products Returns 0 if all factors are the same in the same order and if the exponents are also the same /!\ a × b will be different from b × a It's not a mathematical comparison, but a "displayable"'s one. | |
def | is_equivalent_to_a_single_1 |
True if the Product contains only single 1s. | |
def | is_equivalent_to_a_single_minus_1 |
True if the Product can be displayed as a single -1 For instance, the Product 1×1×(-1)×1. | |
def | is_equivalent_to_a_single_0 |
True if the object can be displayed as a single 0 For instance, the Product 0×0×0×0 (but not 0×1). | |
def | is_reducible |
True if the Product is reducible This is based on the result of the get_factors_list method. | |
def | multiply_symbol_is_required |
True if the usual writing rules require a × between two factors. | |
def | requires_brackets |
True if (one)self requires brackets inside of a Product. | |
def | requires_inner_brackets |
True if the argument requires inner brackets The reason for requiring them is having an exponent different from 1 and several terms or factors (in the case of Products & Sums). | |
def | get_factors_list_except |
Returns the factors' list of the Product except the given one. | |
def | get_first_factor |
Returns the first Sum/Item factor of the Product. | |
def | get_minus_signs_nb |
Returns the number of - signs (negative factors) in the Product. | |
def | get_factors_list |
Returns the factors' list of a given kind (numeric, literal. | |
def | set_factor |
def | calculate_next_step |
Returns the next calculated step of a numeric Product. | |
def | order |
Returns the Product once put in order. | |
def | reduce_ |
Return a reduced Product (if possible) For instance, giving this Product : 2x × (-4x²) × (x + 3)³ × 5 × (x²)³ × (-1)² × (2×3)², reduce_() would return : -1440 * x^9 * (x + 3)³. | |
def | expand_and_reduce_next_step |
Returns the next step of reduction of the Product It won't check if it is expandable. | |
def | make_string |
Creates a string of the given object in the given ML. |
Has Exponented factors & an exponent.
Iterable. Two display modes.
Definition at line 2786 of file __init__.py.
def obj::calc::Product::__cmp__ | ( | self, | ||
objct | ||||
) |
Compares two Products Returns 0 if all factors are the same in the same order and if the exponents are also the same /!\ a × b will be different from b × a It's not a mathematical comparison, but a "displayable"'s one.
Definition at line 2966 of file __init__.py.
def obj::calc::Product::__init__ | ( | self, | ||
arg | ||||
) |
Constructor.
arg | None|Product|Number|Exponented|[Numbers|Exponenteds] In the case of the list, the Products having an exponant equal to 1 won't be treated so that their factors are inserted in the current Product instead of inserting a factor as a Product. If it would, then the compact and non compact display properties might be lost. (For instance, multiplying two Monomials and setting the compact display field of the resulting Product to False would result in displaying all the Monomials Items which isn't always wished) If the argument isn't of the kinds listed above, an exception will be raised. Giving None or an empty list is equivalent to giving 1. |
Definition at line 2808 of file __init__.py.
def obj::calc::Product::calculate_next_step | ( | self, | ||
options | ||||
) |
Returns the next calculated step of a numeric Product.
This method is only very partially implemented (see source code)
The way the exponents are handled is still to be decided
the inner '-' signs (±(-2)) are not handled by this method so far
Reimplemented from obj::calc::Exponented.
Definition at line 3583 of file __init__.py.
def obj::calc::Product::expand_and_reduce_next_step | ( | self, | ||
options | ||||
) |
Returns the next step of reduction of the Product It won't check if it is expandable.
Either it IS and the object is not just a Product but an Expandable or it isn't.
Reimplemented from obj::calc::Exponented.
Reimplemented in obj::calc::Expandable, and obj::calc::BinomialIdentity.
Definition at line 3872 of file __init__.py.
def obj::calc::Product::get_factors_list | ( | self, | ||
given_kind | ||||
) |
Returns the factors' list of a given kind (numeric, literal.
..) For instance, for the product : 2x × (-4x²) × (x + 3)³ × 5 × (x²)³ × (-1)² × (2×3)², this method would return :
given_kind | : __.NUMERIC | __.LITERALS | __.OTHERS |
Definition at line 3456 of file __init__.py.
def obj::calc::Product::get_first_factor | ( | self | ) |
Returns the first Sum/Item factor of the Product.
Definition at line 3395 of file __init__.py.
def obj::calc::Product::is_equivalent_to_a_single_1 | ( | self | ) |
True if the Product contains only single 1s.
For instance, 1×1×1
Reimplemented from obj::calc::Calculable.
Definition at line 2989 of file __init__.py.
def obj::calc::Product::is_reducible | ( | self | ) |
True if the Product is reducible This is based on the result of the get_factors_list method.
Definition at line 3057 of file __init__.py.
def obj::calc::Product::make_string | ( | self, | ||
markup, | ||||
options | ||||
) |
Creates a string of the given object in the given ML.
markup | The markup dictionary to use | |
options | Any options |
Reimplemented from obj::Printable.
Reimplemented in obj::calc::BinomialIdentity.
Definition at line 3981 of file __init__.py.
def obj::calc::Product::multiply_symbol_is_required | ( | self, | ||
objct, | ||||
position | ||||
) |
True if the usual writing rules require a × between two factors.
objct | The other one | |
position | The position (integer) of self in the Product |
Reimplemented from obj::calc::Exponented.
Definition at line 3238 of file __init__.py.
def obj::calc::Product::requires_brackets | ( | self, | ||
position | ||||
) |
True if (one)self requires brackets inside of a Product.
For instance, a Sum with several terms or a negative Item would.
position | The position of the object in the Product |
Reimplemented from obj::calc::Exponented.
Definition at line 3275 of file __init__.py.
def obj::calc::Product::requires_inner_brackets | ( | self | ) |
True if the argument requires inner brackets The reason for requiring them is having an exponent different from 1 and several terms or factors (in the case of Products & Sums).
Reimplemented from obj::calc::Exponented.
Definition at line 3314 of file __init__.py.
def obj::calc::Product::set_factor | ( | self, | ||
n, | ||||
arg | ||||
) |
n | : number of the factor to set | |
arg | : the object to put as n-th factor |
Definition at line 3571 of file __init__.py.