Skip to content

Commit c935ed5

Browse files
committed
add kwarg is_feasible_error to interior_point_Newton
1 parent faf9bc3 commit c935ed5

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### Added
1212

13+
* add keyword argument `is_feasible_error` to `interior_point_Newton` to control how to handle infeasible starting points (#556)
1314
* add keyword argument `at_init` to some debug options to control whether they print already at the initialisation and hence before the first iteration (#552)
1415

1516
## [0.5.29] November 26, 2025

src/plans/interior_point_Newton_plan.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ $(_var(:Keyword, :retraction_method))
9393
* `step_state`: the [`StepsizeState`](@ref) with point and search direction
9494
$(_var(:Keyword, :stepsize; default = "[`ArmijoLinesearch`](@ref)`()`", add = " with the [`InteriorPointCentralityCondition`](@ref) as
9595
additional condition to accept a step"))
96+
* `is_feasible_error=:error`: specify how to handle infeasible starting points, see [`is_feasible`](@ref) for options.
9697
9798
and internally `_step_M` and `_step_p` for the manifold and point in the stepsize.
9899
"""
@@ -126,6 +127,7 @@ mutable struct InteriorPointNewtonState{
126127
stepsize::TStepsize
127128
step_problem::TStepPr
128129
step_state::TStepSt
130+
is_feasible_error::Symbol
129131
function InteriorPointNewtonState(
130132
M::AbstractManifold,
131133
cmo::ConstrainedManifoldObjective,
@@ -161,6 +163,7 @@ mutable struct InteriorPointNewtonState{
161163
initial_stepsize = 1.0,
162164
additional_decrease_condition = centrality_condition,
163165
),
166+
is_feasible_error::Symbol = :error,
164167
kwargs...,
165168
) where {
166169
P,
@@ -194,6 +197,7 @@ mutable struct InteriorPointNewtonState{
194197
ips.stepsize = stepsize
195198
ips.step_problem = step_problem
196199
ips.step_state = step_state
200+
ips.is_feasible_error = is_feasible_error
197201
return ips
198202
end
199203
end

src/solvers/interior_point_Newton.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ $(_var(:Keyword, :sub_state; default = "[`ConjugateResidualState`](@ref)"))
9393
* `Y=zero(μ)`: the initial gradient with respect to `μ`
9494
* `Z=zero(λ)`: the initial gradient with respect to `λ`
9595
* `W=zero(s)`: the initial gradient with respect to `s`
96+
* `is_feasible_error=:error`: specify how to handle infeasible starting points, see [`is_feasible`](@ref) for options.
9697
9798
As well as internal keywords used to set up these given keywords like `_step_M`, `_step_p`, `_sub_M`, `_sub_p`, and `_sub_X`,
9899
that should not be changed.
@@ -234,13 +235,14 @@ function interior_point_Newton!(
234235
sub_kwargs...,
235236
),
236237
sub_problem::Pr = DefaultManoptProblem(TangentSpace(_sub_M, _sub_p), sub_objective),
238+
is_feasible_error = :error,
237239
kwargs...,
238240
) where {
239241
O <: Union{ConstrainedManifoldObjective, AbstractDecoratedManifoldObjective},
240242
St <: AbstractManoptSolverState,
241243
Pr <: Union{F, AbstractManoptProblem} where {F},
242244
}
243-
!is_feasible(M, cmo, p; error = :error)
245+
!is_feasible(M, cmo, p; error = is_feasible_error)
244246
keywords_accepted(interior_point_Newton!; kwargs...)
245247
dcmo = decorate_objective!(M, cmo; kwargs...)
246248
dmp = DefaultManoptProblem(M, dcmo)
@@ -251,6 +253,7 @@ function interior_point_Newton!(
251253
retraction_method = retraction_method,
252254
step_problem = step_problem, step_state = step_state,
253255
stepsize = _produce_type(stepsize, _step_M),
256+
is_feasible_error = is_feasible_error,
254257
kwargs...,
255258
)
256259
ips = decorate_state!(ips; kwargs...)
@@ -262,7 +265,7 @@ calls_with_kwargs(::typeof(interior_point_Newton!)) = (decorate_objective!, deco
262265
function initialize_solver!(amp::AbstractManoptProblem, ips::InteriorPointNewtonState)
263266
M = get_manifold(amp)
264267
cmo = get_objective(amp)
265-
!is_feasible(M, cmo, ips.p; error = :error)
268+
!is_feasible(M, cmo, ips.p; error = ips.is_feasible_error)
266269
return ips
267270
end
268271

0 commit comments

Comments
 (0)