Skip to content

Commit

Permalink
Incorporate review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinpfoertner committed Jan 28, 2022
1 parent ab5b748 commit 49fc7d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/probnum/linops/_linear_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def _set_property(self, name: str, value: Optional[bool]):
if curr_value is not None:
assert isinstance(curr_value, bool)

raise ValueError(f"Can not change the value of the matrix property {name}")
raise ValueError(f"Can not change the value of the matrix property {name}.")

if not isinstance(value, bool):
raise TypeError(
Expand Down
10 changes: 3 additions & 7 deletions src/probnum/linops/_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,13 @@ def _cholesky(self, lower: bool = True) -> Scaling:
if self._scalar is not None:
if self._scalar <= 0:
raise np.linalg.LinAlgError(
"The linear operator is not positive definite"
"The linear operator is not positive definite."
)

return Scaling(np.sqrt(self._scalar), shape=self.shape)

if np.any(self._factors <= 0):
raise np.linalg.LinAlgError("The linear operator is not positive definite")
raise np.linalg.LinAlgError("The linear operator is not positive definite.")

return Scaling(np.sqrt(self._factors))

Expand Down Expand Up @@ -355,11 +355,7 @@ def __init__(self, shape, dtype=np.float64):
det=det,
trace=trace,
)

# Matrix properties
if self.is_square:
self.is_symmetric = True
self.is_lower_triangular = True
4
self.is_upper_triangular = True

self.is_positive_definite = False

0 comments on commit 49fc7d2

Please sign in to comment.