Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Private Member Functions | List of all members
CellMLToNektar.pycml.mathml_or Class Reference
Inheritance diagram for CellMLToNektar.pycml.mathml_or:
Inheritance graph
[legend]
Collaboration diagram for CellMLToNektar.pycml.mathml_or:
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
 

Private Member Functions

def _get_binding_time
 

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 <or> operator.

Definition at line 5841 of file pycml.py.

Member Function Documentation

def CellMLToNektar.pycml.mathml_or._get_binding_time (   self)
private
Return the binding time of the enclosing <apply> element.

Short-circuit if a static True operand occurs before any dynamic
operands, returning static.  Otherwise return the least upper bound
of operand binding times, as usual.

Definition at line 5857 of file pycml.py.

References CellMLToNektar.pycml.mathml.eval().

5858  def _get_binding_time(self):
5859  """Return the binding time of the enclosing <apply> element.
5860 
5861  Short-circuit if a static True operand occurs before any dynamic
5862  operands, returning static. Otherwise return the least upper bound
5863  of operand binding times, as usual.
5864  """
5865  app = self.xml_parent
5866  bts = [BINDING_TIMES.static]
5867  for operand in app.operands():
5868  bt = app._get_element_binding_time(operand)
5869  if bt is BINDING_TIMES.static:
5870  value = self.eval(operand)
5871  if value and len(bts) == 1:
5872  # Short-circuit
5873  break
5874  else:
5875  bts.append(bt)
5876  # Take least upper bound
5877  return max(bts)
def CellMLToNektar.pycml.mathml_or.evaluate (   self)
Return the logical disjunction of the operands.

Evaluates operands in the order given in the file, and will
short-circuit at the first which evaluates to True.

Definition at line 5843 of file pycml.py.

References CellMLToNektar.pycml.mathml.eval().

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

5844  def evaluate(self):
5845  """Return the logical disjunction of the operands.
5846 
5847  Evaluates operands in the order given in the file, and will
5848  short-circuit at the first which evaluates to True.
5849  """
5850  app = self.xml_parent
5851  ops = app.operands()
5852  value = False
5853  for operand in ops:
5854  value = value or self.eval(operand)
5855  if value: break
5856  return value