Class HashingAccumulator¶
Defined in File sum.hpp
Class Documentation¶
-
class HashingAccumulator¶
utility for eagerly accumulating summands in a hash table Intended to accumulate summands that are already in canonical form and produces canonical Sum
Public Functions
-
HashingAccumulator &append(ExprPtr summand, bool flatten = true)¶
summandexpr to append to the sumflattenif true, andsummandis a Sum, will flatten the sum
-
ExprPtr make_expr(bool canonicalize = true)¶
Note
use sort_expr() to sort in an order that does not depend on the hashing algorithm
- Parameters:
canonicalize – if true, will sort the summands to canonical order defined by their hash values (and Expr::operator<)
- Returns:
summands as a Sum (if have more than 1 summand), Constant (if have zero summands), or the lone summand itself
-
bool empty() const¶
-
HashingAccumulator &append(ExprPtr summand, bool flatten = true)¶