Skip to content

Commit 1a00636

Browse files
authored
Merge branch 'main' into linop_array_subclass_compatibility
2 parents a296490 + 0f17ed6 commit 1a00636

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/probnum/linops/_arithmetic.py

+14
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,20 @@ def _sub_anylinop_zero(op: LinearOperator, z: Zero) -> Zero:
373373
return op
374374

375375

376+
def _mul_scalar_zero(scalar: ScalarLike, z: Zero) -> Zero:
377+
# pylint: disable=unused-argument
378+
return z
379+
380+
381+
def _mul_zero_scalar(z: Zero, scalar: ScalarLike) -> Zero:
382+
# pylint: disable=unused-argument
383+
return z
384+
385+
386+
_mul_fns[(Zero, np.number)] = _mul_zero_scalar
387+
_mul_fns[(np.number, Zero)] = _mul_scalar_zero
388+
389+
376390
for op_type in _AnyLinOp:
377391
_matmul_fns[(Zero, op_type)] = _matmul_zero_anylinop
378392
_matmul_fns[(op_type, Zero)] = _matmul_anylinop_zero

0 commit comments

Comments
 (0)