Class ExpressionComparer
- Namespace
- Utils.Mathematics.Expressions
- Assembly
- Utils.dll
Provides a custom equality comparer for Expression objects. The comparison involves simplifying each expression via an ExpressionSimplifier before checking for structural and semantic equivalence.
public class ExpressionComparer : IEqualityComparer<Expression>
- Inheritance
-
ExpressionComparer
- Implements
- Inherited Members
- Extension Methods
Properties
Default
Gets the default ExpressionComparer instance for global usage.
public static ExpressionComparer Default { get; }
Property Value
Methods
Equals(Expression?, Expression?)
Determines whether two Expression objects are equal by simplifying and comparing them structurally.
public bool Equals(Expression? x, Expression? y)
Parameters
xExpressionThe first expression to compare.
yExpressionThe second expression to compare.
Returns
GetHashCode(Expression)
Returns a hash code for the specified Expression by simplifying it and taking the hash code of its string representation.
public int GetHashCode(Expression obj)
Parameters
objExpressionThe Expression for which to get a hash code.
Returns
- int
An integer hash code based on the simplified expression's string representation.