Skip to main content

render_expression

Function render_expression 

Source
pub fn render_expression(e: &Expr, var_names: &[String]) -> String
Expand description

Render an expression as infix text, using var_names for variable labels where available (x[i] otherwise).

The debugger reaches the renderer through the constraint/objective walkers; this is the bare entry point for a caller that holds an Expr directly — notably the Python NlExpr.__repr__ (issue #469), where being able to see the expression you just built is most of the debugging story.

Cse bodies are inlined at every occurrence, so the output of a heavily-shared DAG can be far larger than the DAG itself. Callers rendering user-built expressions should bound the input first.