Coverage for C:\Users\t590r\Documents\GitHub\suppy\suppy\superiorization\_sup.py: 100%

1 from abc import ABC, abstractmethod

2 from typing import Callable

3 import numpy.typing as npt

4

5

6 class FeasibilityPerturbation(ABC):

7 """

8 Abstract base class for perturbation approaches of feasibility seeking

9 algorithms.

10

11 Parameters

12 ----------

13 basic : Callable

14 The underlying feasibility seeking algorithm.

15

16 Attributes

17 ----------

18 basic : Callable

19 The underlying feasibility seeking algorithm.

20 """

21

22 def __init__(self, basic: Callable):

23 self.basic = basic

24

25 @abstractmethod

26 # @ensure_float_array

27 def solve(self, x_0: npt.NDArray):

28 """

29 Solve the perturbed feasibility seeking problem.

30

31 Parameters

32 ----------

33 x_0 : npt.NDArray

34 Initial guess for the solution.

35

36 Returns

37 -------

38 None

39 This method should be overridden by subclasses to provide the actual implementation.

40 """