Function sequant::canonicalize(ExprPtr&)¶
Defined in File expr_algorithms.cpp
Function Documentation¶
-
ExprPtr &sequant::canonicalize(ExprPtr &expr)¶
Recursively canonicalizes an Expr and replaces it as needed
Note
the canonicalization options are those of the default context
- Parameters:
expr – [inout] expression to be canonicalized; may be replaced (i.e.
&exprmay be mutated by call); a Sum left with at most one summand, or a Product with one factor and a unit scalar, is replaced by that summand or factor (or 0), canonicalized on its own- Returns:
exprto facilitate chaining