Projection#
- class Projection(relaxation=1, proximity_flag=True, _use_gpu=False)[source]#
Bases:
ABCAbstract base class for projections used in feasibility algorithms.
- Parameters:
relaxation (float, optional) – Relaxation parameter for the projection, by default 1.
proximity_flag (bool) – Flag to indicate whether to take this object into account when calculating proximity, by default True.
- Attributes:
- relaxationfloat
Relaxation parameter for the projection.
- proximity_flagbool
Flag to indicate whether to take this object into account when calculating proximity.
Methods
project(x)Perform the (possibly relaxed) projection of input array 'x' onto the constraint.
proximity(x, proximity_measures)Calculate proximity measures of point x to the set.
step(x)Perform the (possibly relaxed) projection of input array 'x' onto the constraint.
- project(x)[source]#
Perform the (possibly relaxed) projection of input array ‘x’ onto the constraint.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – The input array to be projected.- Return type:
ndarray- Returns:
The (possibly relaxed) projection of ‘x’ onto the constraint.
- proximity(x, proximity_measures)[source]#
Calculate proximity measures of point x to the set.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – Input array for which the proximity measure is to be calculated.- Return type:
float- Returns:
The proximity measures of the input array x.
- step(x)[source]#
Perform the (possibly relaxed) projection of input array ‘x’ onto the constraint.
- Parameters:
x (
ndarray[tuple[Any,...],dtype[TypeVar(_ScalarT, bound=generic)]]) – The input array to be projected.- Return type:
ndarray- Returns:
The (possibly relaxed) projection of ‘x’ onto the constraint.