Package aloha :: Module aloha_lib :: Class AddVariable
[hide private]
[frames] | no frames]

Class AddVariable

source code

object --+    
         |    
      list --+
             |
            AddVariable

A list of Variable/ConstantObject/... This object represent the operation between those object.

Instance Methods [hide private]
new empty list
__init__(self, old_data=[], prefactor=1)
initialization of the object with default value
source code
 
simplify(self)
apply rule of simplification
source code
 
split(self, variables_id)
return a dict with the key being the power associated to each variables and the value being the object remaining after the suppression of all the variable
source code
 
contains(self, variables)
returns true if one of the variables is in the expression
source code
 
get_all_var_names(self) source code
 
replace(self, id, expression)
replace one object (identify by his id) by a given expression.
source code
 
expand(self, veto=[])
Pass from High level object to low level object
source code
 
__mul__(self, obj)
define the multiplication of
source code
 
__imul__(self, obj)
define the multiplication of
source code
 
__neg__(self) source code
 
__add__(self, obj)
Define all the different addition.
source code
 
__iadd__(self, obj)
Define all the different addition.
source code
 
__sub__(self, obj) source code
 
__rsub__(self, obj) source code
 
__radd__(self, obj)
Define all the different addition.
source code
 
__rmul__(self, obj)
define the multiplication of
source code
 
__div__(self, obj) source code
 
__truediv__(self, obj) source code
 
__rdiv__(self, obj) source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code
 
count_term(self) source code
 
factorize(self)
try to factorize as much as possible the expression
source code

Inherited from list: __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __reversed__, __setitem__, __setslice__, __sizeof__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]
  vartype = 1

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, old_data=[], prefactor=1)
(Constructor)

source code 

initialization of the object with default value

Returns: new empty list
Overrides: object.__init__

replace(self, id, expression)

source code 

replace one object (identify by his id) by a given expression. Note that expression cann't be zero. Note that this should be canonical form (this should contains ONLY MULTVARIABLE) --so this should be called before a factorize.

__mul__(self, obj)

source code 

define the multiplication of

  • a AddVariable with a number
  • a AddVariable with an AddVariable

other type of multiplication are define via the symmetric operation base on the obj class.

Overrides: list.__mul__

__imul__(self, obj)

source code 

define the multiplication of

  • a AddVariable with a number
  • a AddVariable with an AddVariable

other type of multiplication are define via the symmetric operation base on the obj class.

Overrides: list.__imul__

__add__(self, obj)
(Addition operator)

source code 

Define all the different addition.

Overrides: list.__add__

__iadd__(self, obj)

source code 

Define all the different addition.

Overrides: list.__iadd__

__rmul__(self, obj)

source code 

define the multiplication of

  • a AddVariable with a number
  • a AddVariable with an AddVariable

other type of multiplication are define via the symmetric operation base on the obj class.

Overrides: list.__rmul__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)