class documentation

class Expr:

View In Hierarchy

Represents a Fortran expression as a op-data pair.

Expr instances are hashable and sortable.

Static Method parse Parse a Fortran expression to a Expr.
Method __add__ Undocumented
Method __call__ Undocumented
Method __eq__ Undocumented
Method __floordiv__ Undocumented
Method __ge__ Undocumented
Method __getitem__ Undocumented
Method __gt__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method __le__ Undocumented
Method __lt__ Undocumented
Method __mul__ Undocumented
Method __neg__ Undocumented
Method __pos__ Undocumented
Method __pow__ Undocumented
Method __radd__ Undocumented
Method __repr__ Undocumented
Method __rfloordiv__ Undocumented
Method __rmul__ Undocumented
Method __rsub__ Undocumented
Method __rtruediv__ Undocumented
Method __str__ Undocumented
Method __sub__ Undocumented
Method __truediv__ Undocumented
Method contains Check if self contains other.
Method linear​_solve Return a, b such that a * symbol + b == self.
Method polynomial​_atoms Return a set of expressions used as atoms in polynomial self.
Method substitute Recursively substitute symbols with values in symbols map.
Method symbols Return a set of symbols contained in self.
Method tostring Return a string representation of Expr.
Method traverse Traverse expression tree with visit function.
Instance Variable data Undocumented
Instance Variable op Undocumented
@staticmethod
def parse(s, language=Language.C):
Parse a Fortran expression to a Expr.
def __add__(self, other):

Undocumented

def __call__(self, *args, **kwargs):

Undocumented

def __eq__(self, other):

Undocumented

def __floordiv__(self, other):

Undocumented

def __ge__(self, other):

Undocumented

def __getitem__(self, index):

Undocumented

def __gt__(self, other):

Undocumented

def __hash__(self):

Undocumented

def __init__(self, op, data):

Undocumented

def __le__(self, other):

Undocumented

def __lt__(self, other):

Undocumented

def __mul__(self, other):

Undocumented

def __neg__(self):

Undocumented

def __pos__(self):

Undocumented

def __pow__(self, other):

Undocumented

def __radd__(self, other):

Undocumented

def __repr__(self):

Undocumented

def __rfloordiv__(self, other):

Undocumented

def __rmul__(self, other):

Undocumented

def __rsub__(self, other):

Undocumented

def __rtruediv__(self, other):

Undocumented

def __str__(self):

Undocumented

def __sub__(self, other):

Undocumented

def __truediv__(self, other):

Undocumented

def contains(self, other):
Check if self contains other.
def linear_solve(self, symbol):

Return a, b such that a * symbol + b == self.

If self is not linear with respect to symbol, raise RuntimeError.

def polynomial_atoms(self):
Return a set of expressions used as atoms in polynomial self.
def substitute(self, symbols_map):

Recursively substitute symbols with values in symbols map.

Symbols map is a dictionary of symbol-expression pairs.

def symbols(self):
Return a set of symbols contained in self.
def tostring(self, parent_precedence=Precedence.NONE, language=Language.Fortran):
Return a string representation of Expr.
def traverse(self, visit, *args, **kwargs):

Traverse expression tree with visit function.

The visit function is applied to an expression with given args and kwargs.

Traverse call returns an expression returned by visit when not None, otherwise return a new normalized expression with traverse-visit sub-expressions.

data =

Undocumented

op =

Undocumented