mathmaker  0.6(alpha)
Public Member Functions | Public Attributes
core.base_calculus.Expandable Class Reference

Mother class of all expandable objects. More...

Inheritance diagram for core.base_calculus.Expandable:
core.base_calculus.Product core.base_calculus.CommutativeOperation core.base_calculus.Operation core.root_calculus.Exponented core.root_calculus.Signed core.root_calculus.Calculable core.root_calculus.Evaluable core.base.Printable core.base.NamedObject core.base.Clonable core.base_calculus.BinomialIdentity

List of all members.

Public Member Functions

def __init__
 Constructor.
def expand
 The expanded object, like 2×(x+3) would return 2×x + 2×3.
def expand_and_reduce_
 The expanded & reduced object, like 2×(x+3) would return 2x + 6 Take care that the resulting Sum might not be reduced itself.
def expand_and_reduce_next_step
 Returns the expanded object as a Sum.
def is_expandable
 True.

Public Attributes

 str_openmark
 str_closemark

Detailed Description

Mother class of all expandable objects.

Definition at line 8215 of file base_calculus.py.


Constructor & Destructor Documentation

def core.base_calculus.Expandable.__init__ (   self,
  arg,
  options 
)

Constructor.

Parameters:
arg(Exponented, Exponented)|(RANDOMLY, <type>) (randomly) types details :
  • monom0_polyn1 will create this kind of objects : 5(3x-2)
  • monom1_polyn1 will create this kind of objects : -5x(2-3x)
  • polyn1_polyn1 will create this kind of objects : (5x+1)(3x-2)
  • minus_polyn1_polyn1 will create -<polyn1_polyn1>
  • sign_exp will create ±(±ax²±bx±c) | ±(±bx±c) | ±(±ax²±c) | ±(±ax²±bx)
optionsreversed|randomly_reversed=<nb> Options details :
  • reversed will change the sums' order. This is useless if the sums are the same kind of objects (like (2x+3)(3x-7))
  • randomly_reversed=0.3 will change the sums' order in a ratio of 0.3
Warning:
Might raise an UncompatibleType exception.

Reimplemented in core.base_calculus.BinomialIdentity.

Definition at line 8237 of file base_calculus.py.

References core.base_calculus.CommutativeOperation._compact_display, core.base_calculus.Product._compact_display, core.base_calculus.Sum._compact_display, core.base_calculus.Monomial._compact_display, core.base_calculus.Expandable._compact_display, core.base_calculus.CommutativeOperation._info, core.base_calculus.Monomial._info, core.base_calculus.Expandable._info, core.base_calculus.Operation._neutral, core.base_calculus.Product._neutral, core.base_calculus.Sum._neutral, core.base_calculus.Monomial._neutral, core.base_calculus.Polynomial._neutral, core.base_calculus.Expandable._neutral, core.base_calculus.Operation._symbol, core.base_calculus.Quotient._symbol, core.base_calculus.Fraction._symbol, core.base_calculus.Product._symbol, core.base_calculus.Sum._symbol, core.base_calculus.Expandable._symbol, core.base.Clonable.clone(), core.base_calculus.Product.factor, core.base_calculus.Product.is_displ_as_a_single_1(), core.base_calculus.Operation.reset_element(), core.base_calculus.CommutativeOperation.str_closemark, core.base_calculus.Product.str_closemark, core.base_calculus.Sum.str_closemark, core.base_calculus.Expandable.str_closemark, core.base_calculus.CommutativeOperation.str_openmark, core.base_calculus.Product.str_openmark, core.base_calculus.Sum.str_openmark, and core.base_calculus.Expandable.str_openmark.

Referenced by core.calculus.Equation.__init__(), and core.root_calculus.Value.substitute().


Member Function Documentation

The expanded & reduced object, like 2×(x+3) would return 2x + 6 Take care that the resulting Sum might not be reduced itself.

For instance, (3 + x)(2x - 5) would return 6x - 15 + 2x² - 5x The rest of the calculation has to be done with the Sum's reduction method ?

Definition at line 8411 of file base_calculus.py.

References core.base_calculus.Expandable.expand().

True.

Returns:
True

Reimplemented from core.base_calculus.Operation.

Definition at line 8467 of file base_calculus.py.


The documentation for this class was generated from the following file: