Skip to content

Commit

Permalink
Use public properties domain & codomain in `LinearOperator.__neg_…
Browse files Browse the repository at this point in the history
…_` (#410)

The `__neg__` function in class `LinearOperator` uses the `_domain` and
`_codomain` attributes, which is wrong since these may not be defined.
It should use the exposed (interface) properties `domain` and `codomain`
instead.
  • Loading branch information
campospinto authored Aug 2, 2024
1 parent d3651dd commit 8340176
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion psydac/linalg/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def __neg__(self):
a new object of the class ScaledLinearOperator.
"""
return ScaledLinearOperator(self._domain, self._codomain, -1.0, self)
return ScaledLinearOperator(self.domain, self.codomain, -1.0, self)

def __mul__(self, c):
"""
Expand Down

0 comments on commit 8340176

Please sign in to comment.