Package esys :: Package escript :: Module util :: Class Quotient_Symbol
[hide private]
[frames] | no frames]

Class Quotient_Symbol

 object --+        
          |        
     Symbol --+    
              |    
DependendSymbol --+
                  |
                 Quotient_Symbol

Symbol representing the quotient of two arguments.

Instance Methods [hide private]
 
__init__(self, arg0, arg1)
Initialization of Symbol representing the quotient of two arguments.
typically Symbol but other types such as float, escript.Data, numpy.ndarray are possible
diff(self, arg)
Differential of this object.
str
getMyCode(self, argstrs, format='escript')
Returns program code that can be used to evaluate the symbol.
escript.Symbol, float, escript.Data, numpy.ndarray depending on the degree of substitution
substitute(self, argvals)
Assigns new values to symbols in the definition of the symbol.

Inherited from DependendSymbol: __eq__, __ne__

Inherited from Symbol: __abs__, __add__, __div__, __getitem__, __mul__, __neg__, __pos__, __pow__, __radd__, __rdiv__, __rmul__, __rpow__, __rsub__, __str__, __sub__, getArgument, getDifferentiatedArguments, getDim, getRank, getShape, getSubstitutedArguments, isAppropriateValue

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, arg0, arg1)
(Constructor)

 

Initialization of Symbol representing the quotient of two arguments.

Parameters:
Raises:
  • ValueError - if both arguments do not have the same shape
Overrides: object.__init__

Note: if both arguments have a spatial dimension, they must be equal.

diff(self, arg)

 

Differential of this object.

Parameters:
  • arg (escript.Symbol) - the derivative is calculated with respect to arg
Returns: typically Symbol but other types such as float, escript.Data, numpy.ndarray are possible
derivative with respect to arg
Overrides: Symbol.diff

getMyCode(self, argstrs, format='escript')

 

Returns program code that can be used to evaluate the symbol.

Parameters:
  • argstrs (str or a list of length 2 of str) - a string for each argument representing the argument for the evaluation
  • format (str) - specifies the format to be used. At the moment only "escript", "str" and "text" are supported.
Returns: str
a piece of program code which can be used to evaluate the expression assuming the values for the arguments are available
Raises:
  • NotImplementedError - if no implementation for the given format is available
Overrides: Symbol.getMyCode

substitute(self, argvals)

 

Assigns new values to symbols in the definition of the symbol. The method replaces the Symbol u by argvals[u] in the expression defining this object.

Parameters:
  • argvals (dict with keywords of type Symbol) - new values assigned to symbols
Returns: escript.Symbol, float, escript.Data, numpy.ndarray depending on the degree of substitution
result of the substitution process. Operations are executed as much as possible.
Raises:
  • TypeError - if a value for a Symbol cannot be substituted
Overrides: Symbol.substitute