Skip to content

Commit

Permalink
add methods to cost dict
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinKa committed Sep 29, 2023
1 parent 1ad9f60 commit 16ae7c7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions egga/geometric_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,36 +78,47 @@ def __init__(

@egraph.class_
class MathExpr(BaseExpr):
@egraph.method(cost=costs.get("equal"))
def equal(self, other: MathExpr) -> MathExpr:
...

@egraph.method(cost=costs.get("not_equal"))
def not_equal(self, other: MathExpr) -> MathExpr:
...

@egraph.method(cost=costs.get("__add__"))
def __add__(self, other: MathExpr) -> MathExpr:
...

@egraph.method(cost=costs.get("__sub__"))
def __sub__(self, other: MathExpr) -> MathExpr:
...

@egraph.method(cost=costs.get("__mul__"))
def __mul__(self, other: MathExpr) -> MathExpr:
...

@egraph.method(cost=costs.get("__neg__"))
def __neg__(self) -> MathExpr:
...

@egraph.method(cost=costs.get("__invert__"))
def __invert__(self) -> MathExpr:
...

@egraph.method(cost=costs.get("__pow__"))
def __pow__(self, other: MathExpr) -> MathExpr:
...

@egraph.method(cost=costs.get("__truediv__"))
def __truediv__(self, other: MathExpr) -> MathExpr:
...

@egraph.method(cost=costs.get("__xor__"))
def __xor__(self, other: MathExpr) -> MathExpr:
...

@egraph.method(cost=costs.get("__or__"))
def __or__(self, other: MathExpr) -> MathExpr:
...

Expand Down

0 comments on commit 16ae7c7

Please sign in to comment.