Function sequant::prune_to_matches¶
Defined in File expr_filter.cpp
Function Documentation¶
-
ExprPtr sequant::prune_to_matches(const Expr &expr, const ExpressionFilter &filter)¶
Recursively rebuilds
expr, keeping only the parts relevant tofilter:for a Sum, keeps (and further prunes) only those summands that (recursively) contain a match, dropping the rest; for a Product, keeps every factor (dropping one would change what the product computes), pruning each factor in turn; leaves are returned unchanged.