Coverage for C:\Users\t590r\Documents\GitHub\suppy\suppy\superiorization\_sup.py: 100%
8 statements
« prev ^ index » next coverage.py v7.6.4, created at 2025-02-05 10:12 +0100
« prev ^ index » next coverage.py v7.6.4, created at 2025-02-05 10:12 +0100
1from abc import ABC, abstractmethod
2from typing import Callable
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 : Callable
14 The underlying feasibility seeking algorithm.
16 Attributes
17 ----------
18 basic : Callable
19 The underlying feasibility seeking algorithm.
20 """
22 def __init__(self, basic: Callable):
23 self.basic = basic
25 @abstractmethod
26 # @ensure_float_array
27 def solve(self, x_0: npt.NDArray):
28 """
29 Solve the perturbed feasibility seeking problem.
31 Parameters
32 ----------
33 x_0 : npt.NDArray
34 Initial guess for the solution.
36 Returns
37 -------
38 None
39 This method should be overridden by subclasses to provide the actual implementation.
40 """