LinearTemplateRepnVisitor

(class from pyomo.repn.linear_template)

class pyomo.repn.linear_template.LinearTemplateRepnVisitor(subexpression_cache, var_recorder, remove_fixed_vars=False)[source]

Bases: LinearRepnVisitor

__init__(subexpression_cache, var_recorder, remove_fixed_vars=False)[source]

Methods

__init__(subexpression_cache, var_recorder)

beforeChild(node, child, child_idx)

check_constant(ans, obj)

enterNode(node)

exitNode(node, data)

expand_expression(obj, template_info)

finalizeResult(result)

initializeWalker(expr)

walk_expression(expr)

Walk an expression, calling registered callbacks.

walk_expression_nonrecursive(expr)

Nonrecursively walk an expression, calling registered callbacks.

Attributes

before_child_dispatcher

client_methods

exit_node_dispatcher

expand_nonlinear_products

max_exponential_expansion

Member Documentation

walk_expression(expr)

Walk an expression, calling registered callbacks.

This is the standard interface for running the visitor. It defaults to using an efficient recursive implementation of the visitor, falling back on walk_expression_nonrecursive() if the recursion stack gets too deep.

walk_expression_nonrecursive(expr)

Nonrecursively walk an expression, calling registered callbacks.

This routine is safer than the recursive walkers for deep (or unbalanced) trees. It is, however, slightly slower than the recursive implementations.