ToMAiNGOVisitor
(class from pyomo.contrib.appsi.solvers.maingo_solvermodel)
-
class pyomo.contrib.appsi.solvers.maingo_solvermodel.ToMAiNGOVisitor(variables, idmap)[source]
Bases: ExpressionValueVisitor
-
__init__(variables, idmap)[source]
Methods
__init__(variables, idmap)
|
|
dfs_postorder_stack(node)
|
Perform a depth-first search in postorder using a stack implementation. |
finalize(ans)
|
This method defines the return value for the search methods in this class. |
maingo_acosh(x)
|
|
maingo_asinh(x)
|
|
maingo_atanh(x)
|
|
maingo_log10(x)
|
|
visit(node, values)
|
Visit nodes that have been expanded |
visiting_potential_leaf(node)
|
Visiting a potential leaf. |
Member Documentation
-
dfs_postorder_stack(node)
Perform a depth-first search in postorder using a stack
implementation.
Note
This method has the same functionality as the
PyUtilib ValueVisitor.dfs_postorder_stack
method. The difference is that this method
is tailored to efficiently walk Pyomo expression trees.
- Parameters:
node – The root node of the expression tree
that is searched.
- Returns:
The return value is determined by the finalize() function,
which may be defined by the user.
-
finalize(ans)
This method defines the return value for the search methods
in this class.
The default implementation returns the value of the
initial node (aka the root node), because
this visitor pattern computes and returns value for each
node to enable the computation of this value.
- Parameters:
ans – The final value computed by the search method.
- Returns:
The final value after the search. Defaults to simply
returning ans.
-
visit(node, values)[source]
Visit nodes that have been expanded
-
visiting_potential_leaf(node)[source]
Visiting a potential leaf.
Return True if the node is not expanded.