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_and Class Reference
Inheritance diagram for CellMLToNektar.pycml.mathml_and:
Inheritance graph
[legend]
Collaboration diagram for CellMLToNektar.pycml.mathml_and:
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 <and> operator.

Definition at line 5802 of file pycml.py.

Member Function Documentation

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

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

Definition at line 5818 of file pycml.py.

References CellMLToNektar.pycml.mathml.eval().

5819  def _get_binding_time(self):
5820  """Return the binding time of the enclosing <apply> element.
5821 
5822  Short-circuit if a static False operand occurs before any dynamic
5823  operands, returning static. Otherwise return the least upper bound
5824  of operand binding times, as usual.
5825  """
5826  app = self.xml_parent
5827  bts = [BINDING_TIMES.static]
5828  for operand in app.operands():
5829  bt = app._get_element_binding_time(operand)
5830  if bt is BINDING_TIMES.static:
5831  value = self.eval(operand)
5832  if not value and len(bts) == 1:
5833  # Short-circuit
5834  break
5835  else:
5836  bts.append(bt)
5837  # Take least upper bound
5838  return max(bts)
def CellMLToNektar.pycml.mathml_and.evaluate (   self)
Return the logical conjunction of the operands.

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

Definition at line 5804 of file pycml.py.

References CellMLToNektar.pycml.mathml.eval().

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

5805  def evaluate(self):
5806  """Return the logical conjunction of the operands.
5807 
5808  Evaluates operands in the order given in the file, and will
5809  short-circuit at the first which evaluates to False.
5810  """
5811  app = self.xml_parent
5812  ops = app.operands()
5813  value = True
5814  for operand in ops:
5815  value = value and self.eval(operand)
5816  if not value: break
5817  return value