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

Class Variable

source code

object --+
         |
        Variable
Known Subclasses:

This is the standard object for all the variable linked to expression. the variable 'X' is associte to a prefactor and a constant term. Such that this object can be reprensentet mathematicaly by a * X + b

Nested Classes [hide private]
  mult_class
A list of Variable with multiplication as operator between themselves.
  add_class
A list of Variable/ConstantObject/...
  VariableError
class for error in Variable object
Instance Methods [hide private]
 
__init__(self, prefactor=1, variable='x', power=1)
[prefactor] * Variable ** [power]
source code
 
copy(self)
provide an indenpedant copy of the object
source code
 
simplify(self)
Define How to simplify this object.
source code
 
expand(self)
Return a more basic representation of this variable.
source code
 
factorize(self)
try to factorize this
source code
 
__mul__(self, obj)
How to multiply object together product of Variable -> MultVariable
source code
 
__pow__(self, power)
define power
source code
 
__add__(self, obj)
How to make an addition Addition of Variable -> AddVariable
source code
 
__sub__(self, obj) source code
 
__rsub__(self, obj) source code
 
__div__(self, obj)
define the division
source code
 
__rdiv__(self, obj)
Deal division in a inverse way
source code
 
__radd__(self, obj)
How to make an addition Addition of Variable -> AddVariable
source code
 
__iadd__(self, obj)
How to make an addition Addition of Variable -> AddVariable
source code
 
__rmul__(self, obj)
How to multiply object together product of Variable -> MultVariable
source code
 
__truediv__(self, obj)
define the division
source code
 
__rtruediv__(self, obj)
Deal division in a inverse way
source code
 
__eq__(self, obj)
identical if the variable is the same
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
str(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  vartype = 0
  contract_first = 0
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, prefactor=1, variable='x', power=1)
(Constructor)

source code 

[prefactor] * Variable ** [power]

Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

str(x)

Overrides: object.__repr__
(inherited documentation)