@@ -77,19 +77,19 @@ def _solve_least_core_linear_program(
7777 "maximum number of iterations in options" ,
7878 RuntimeWarning ,
7979 )
80- least_core_value = e .value .item ()
81- # HACK: sometimes the returned least core value
80+ subsidy = e .value .item ()
81+ # HACK: sometimes the returned least core subsidy
8282 # is negative but very close to 0
8383 # to avoid any problems with the subsequent quadratic program
8484 # we just set it to 0.0
85- if least_core_value < 0 :
85+ if subsidy < 0 :
8686 warnings .warn (
87- f"Least core value ' { least_core_value } ' is negative but close to zero. "
87+ f"Least core subsidy e= { subsidy } is negative but close to zero. "
8888 "It will be set to 0.0" ,
8989 RuntimeWarning ,
9090 )
91- least_core_value = 0.0
92- return x .value , least_core_value
91+ subsidy = 0.0
92+ return x .value , subsidy
9393
9494 if problem .status in cp .settings .INF_OR_UNB :
9595 warnings .warn (
@@ -100,7 +100,7 @@ def _solve_least_core_linear_program(
100100
101101
102102def _solve_egalitarian_least_core_quadratic_program (
103- least_core_value : float ,
103+ subsidy : float ,
104104 A_eq : NDArray [np .float_ ],
105105 b_eq : NDArray [np .float_ ],
106106 A_lb : NDArray [np .float_ ],
@@ -122,7 +122,7 @@ def _solve_egalitarian_least_core_quadratic_program(
122122 :math:`b_{ub}`, :math:`b_{eq}`, :math:`l`, and :math:`u` are vectors; and
123123 :math:`A_{ub}` and :math:`A_{eq}` are matrices.
124124
125- :param least_core_subsidy : Minimal subsidy returned by :func:`_solve_least_core_linear_program`
125+ :param subsidy : Minimal subsidy returned by :func:`_solve_least_core_linear_program`
126126 :param A_eq: The equality constraint matrix. Each row of ``A_eq`` specifies the
127127 coefficients of a linear equality constraint on ``x``.
128128 :param b_eq: The equality constraint vector. Each element of ``A_eq @ x`` must equal
@@ -137,16 +137,16 @@ def _solve_egalitarian_least_core_quadratic_program(
137137 """
138138 logger .debug (f"Solving quadratic program : { A_eq = } , { b_eq = } , { A_lb = } , { b_lb = } " )
139139
140- if least_core_value < 0 :
141- raise ValueError ("Passed least core value should be positive ." )
140+ if subsidy < 0 :
141+ raise ValueError ("The least core subsidy must be non-negative ." )
142142
143143 n_variables = A_eq .shape [1 ]
144144
145145 x = cp .Variable (n_variables )
146146 objective = cp .Minimize (cp .norm2 (x ))
147147 constraints = [
148148 A_eq @ x == b_eq ,
149- A_lb @ x + least_core_value * np .ones (len (A_lb )) >= b_lb ,
149+ A_lb @ x + subsidy * np .ones (len (A_lb )) >= b_lb ,
150150 ]
151151 problem = cp .Problem (objective , constraints )
152152
0 commit comments