Coverage for suppy\superiorization\_sup.py: 100%
8 statements
« prev ^ index » next coverage.py v7.6.4, created at 2026-05-08 13:56 +0200
« prev ^ index » next coverage.py v7.6.4, created at 2026-05-08 13:56 +0200
1from abc import ABC, abstractmethod
2from suppy.projections import Projection
3import numpy.typing as npt
6class FeasibilityPerturbation(ABC):
7 """
8 Abstract base class for perturbation approaches of feasibility seeking
9 algorithms.
11 Parameters
12 ----------
13 basic : Projection
14 The underlying feasibility seeking algorithm.
16 Attributes
17 ----------
18 basic : Projection
19 The underlying feasibility seeking algorithm.
20 """
22 def __init__(self, basic: Projection):
23 self.basic = basic
25 @abstractmethod
26 def solve(self, x_0: npt.NDArray) -> npt.NDArray:
27 """
28 Solve the perturbed feasibility seeking problem.
30 Parameters
31 ----------
32 x_0 : npt.NDArray
33 Initial guess for the solution.
35 Returns
36 -------
37 npt.NDArray
38 The superiorized solution.
39 """