Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | List of all members
CellMLToNektar.pycml.mathml_minus Class Reference
Inheritance diagram for CellMLToNektar.pycml.mathml_minus:
Inheritance graph
[legend]
Collaboration diagram for CellMLToNektar.pycml.mathml_minus:
Collaboration graph
[legend]

Public Member Functions

def evaluate
 
- Public Member Functions inherited from CellMLToNektar.pycml.mathml_operator
def wrong_number_of_operands
 
- Public Member Functions inherited from CellMLToNektar.pycml.mathml
def __init__
 
def __repr__
 
def __deepcopy__
 
def clone_self
 
def get_original_of_clone
 
def get_component
 
def model
 
def eval
 
- Public Member Functions inherited from CellMLToNektar.pycml.element_base
def __init__
 
def __delattr__
 
def __setattr__
 
def rootNode
 
def cmeta_id
 
def xml_remove_child_at
 
def xml_doc
 
def xml_properties
 

Additional Inherited Members

- Static Public Member Functions inherited from CellMLToNektar.pycml.mathml
def clone
 
- Public Attributes inherited from CellMLToNektar.pycml.element_base
 xml_attributes
 
- Properties inherited from CellMLToNektar.pycml.mathml
 component = property(get_component)
 

Detailed Description

Class representing the MathML <minus> operator.

Definition at line 5569 of file pycml.py.

Member Function Documentation

def CellMLToNektar.pycml.mathml_minus.evaluate (   self)
Evaluate the enclosing <apply> element.

Behaviour depends on the number of operands: we perform
either a unary or binary minus.

Definition at line 5571 of file pycml.py.

References CellMLToNektar.pycml.mathml.eval(), and CellMLToNektar.pycml.mathml_operator.wrong_number_of_operands().

Referenced by CellMLToNektar.pycml.mathml_constructor._eval_self().

5572  def evaluate(self):
5573  """Evaluate the enclosing <apply> element.
5574 
5575  Behaviour depends on the number of operands: we perform
5576  either a unary or binary minus.
5577  """
5578  app = self.xml_parent
5579  ops = list(app.operands())
5580  if len(ops) == 1:
5581  value = -self.eval(ops[0])
5582  elif len(ops) == 2:
5583  value = self.eval(ops[0]) - self.eval(ops[1])
5584  else:
5585  self.wrong_number_of_operands(len(ops), [1, 2])
5586  return value