Skip to content

Commit

Permalink
Add __neg__ method to Integral (#89)
Browse files Browse the repository at this point in the history
* Allow taking the negative value of an Integral object: the minus sign is applied to the integrand expression;
* Update version.
  • Loading branch information
yguclu authored Jan 25, 2021
1 parent ab0cc8c commit 2560c1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sympde/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def expr(self):
def domain(self):
return self._args[1]

def __neg__(self):
return Integral(-self.expr, self.domain)

def __mul__(self, o):
return Integral(self.expr*o, self.domain)

Expand Down
2 changes: 1 addition & 1 deletion sympde/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.6"
__version__ = "0.10.7"

0 comments on commit 2560c1a

Please sign in to comment.