Commit 9344cb42 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'eliminate-usage-of-equation-collection' into 'master'

Eliminate usages of old name 'equation collection' for `AssignmentCollection`

See merge request pycodegen/pystencils!60
parents c81684b2 a88cfc54
...@@ -16,12 +16,12 @@ class AssignmentCollection: ...@@ -16,12 +16,12 @@ class AssignmentCollection:
These simplification methods can change the subexpressions, but the number and These simplification methods can change the subexpressions, but the number and
left hand side of the main equations themselves is not altered. left hand side of the main equations themselves is not altered.
Additionally a dictionary of simplification hints is stored, which are set by the functions that create Additionally a dictionary of simplification hints is stored, which are set by the functions that create
equation collections to transport information to the simplification system. assignment collections to transport information to the simplification system.
Attributes: Attributes:
main_assignments: list of assignments main_assignments: list of assignments
subexpressions: list of assignments defining subexpressions used in main equations subexpressions: list of assignments defining subexpressions used in main equations
simplification_hints: dict that is used to annotate the equation collection with hints that are simplification_hints: dict that is used to annotate the assignment collection with hints that are
used by the simplification system. See documentation of the simplification rules for used by the simplification system. See documentation of the simplification rules for
potentially required hints and their meaning. potentially required hints and their meaning.
subexpression_symbol_generator: generator for new symbols that are used when new subexpressions are added subexpression_symbol_generator: generator for new symbols that are used when new subexpressions are added
...@@ -344,7 +344,7 @@ class AssignmentCollection: ...@@ -344,7 +344,7 @@ class AssignmentCollection:
return result return result
def __repr__(self): def __repr__(self):
return "Equation Collection for " + ",".join([str(eq.lhs) for eq in self.main_assignments]) return "Assignment Collection for " + ",".join([str(eq.lhs) for eq in self.main_assignments])
def __str__(self): def __str__(self):
result = "Subexpressions:\n" result = "Subexpressions:\n"
......
...@@ -30,10 +30,10 @@ def sort_assignments_topologically(assignments: Sequence[Union[Assignment, Node] ...@@ -30,10 +30,10 @@ def sort_assignments_topologically(assignments: Sequence[Union[Assignment, Node]
def sympy_cse(ac): def sympy_cse(ac):
"""Searches for common subexpressions inside the equation collection. """Searches for common subexpressions inside the assignment collection.
Searches is done in both the existing subexpressions as well as the assignments themselves. Searches is done in both the existing subexpressions as well as the assignments themselves.
It uses the sympy subexpression detection to do this. Return a new equation collection It uses the sympy subexpression detection to do this. Return a new assignment collection
with the additional subexpressions found with the additional subexpressions found
""" """
symbol_gen = ac.subexpression_symbol_generator symbol_gen = ac.subexpression_symbol_generator
......
...@@ -9,8 +9,8 @@ from pystencils.simp.assignment_collection import AssignmentCollection ...@@ -9,8 +9,8 @@ from pystencils.simp.assignment_collection import AssignmentCollection
class SimplificationStrategy: class SimplificationStrategy:
"""A simplification strategy is an ordered collection of simplification rules. """A simplification strategy is an ordered collection of simplification rules.
Each simplification is a function taking an equation collection, and returning a new simplified Each simplification is a function taking an assignment collection, and returning a new simplified
equation collection. The strategy can nicely print intermediate simplification stages and results assignment collection. The strategy can nicely print intermediate simplification stages and results
to Jupyter notebooks. to Jupyter notebooks.
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment