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

Public Member Functions

def __init__
 
def match
 
- Public Member Functions inherited from CellMLToNektar.optimize.ExpressionMatcher.Pattern
def match
 

Public Attributes

 operator
 
 operands
 

Detailed Description

An apply expression.

Definition at line 1343 of file optimize.py.

Constructor & Destructor Documentation

def CellMLToNektar.optimize.ExpressionMatcher.A.__init__ (   self,
  operator,
  operands 
)

Definition at line 1345 of file optimize.py.

1346  def __init__(self, operator, operands):
1347  self.operator = operator
1348  self.operands = operands

Member Function Documentation

def CellMLToNektar.optimize.ExpressionMatcher.A.match (   self,
  expr 
)

Definition at line 1349 of file optimize.py.

References CellMLToNektar.optimize.ExpressionMatcher.A.operands, and CellMLToNektar.optimize.ExpressionMatcher.A.operator.

1350  def match(self, expr):
1351  matched = False
1352  if isinstance(expr, mathml_apply):
1353  if expr.operator().localName == self.operator:
1354  expr_operands = list(expr.operands())
1355  if len(expr_operands) == len(self.operands):
1356  matched = reduce(operator.and_,
1357  map(lambda (pat, op): pat.match(op),
1358  zip(self.operands, expr_operands)))
1359  return matched
class V(Pattern):

Member Data Documentation

CellMLToNektar.optimize.ExpressionMatcher.A.operands

Definition at line 1347 of file optimize.py.

Referenced by CellMLToNektar.pycml.mathml_apply._get_binding_time(), CellMLToNektar.pycml.mathml_apply._get_operand_units(), CellMLToNektar.pycml.mathml_apply._reduce(), CellMLToNektar.pycml.mathml_apply.check_assigned_var(), CellMLToNektar.pycml.mathml_apply.classify_variables(), CellMLToNektar.pycml.mathml_apply.get_units(), CellMLToNektar.optimize.ExpressionMatcher.A.match(), and CellMLToNektar.pycml.mathml_apply.tree_complexity().

CellMLToNektar.optimize.ExpressionMatcher.A.operator

Definition at line 1346 of file optimize.py.

Referenced by CellMLToNektar.pycml.mathml_apply._get_binding_time(), CellMLToNektar.pycml.mathml_apply._reduce(), CellMLToNektar.pycml.mathml_apply._set_in_units(), CellMLToNektar.pycml.mathml_apply.check_assigned_var(), CellMLToNektar.pycml.mathml_apply.classify_variables(), CellMLToNektar.pycml.mathml_apply.evaluate(), CellMLToNektar.pycml.mathml_apply.get_units(), CellMLToNektar.optimize.ExpressionMatcher.A.match(), and CellMLToNektar.pycml.mathml_apply.tree_complexity().