Skip to content

Commit 03540f4

Browse files
Use ProductManifold instead of × (#541)
* use ProductManifold instead of × * format * fix docstring of ConstrainedManifoldObjective * fix docstring of ConstrainedManoptProblem * fix math in docstring of ConstrainedManifoldObjective * fix missing backticks
1 parent 44e2bfc commit 03540f4

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

src/plans/constrained_plan.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ get_parameter(acsf::AbstractConstrainedSlackFunctor, ::Val{:β}) = acsf.β
5555
5656
Describes the constrained objective
5757
```math
58-
\begin{aligned}
58+
\\begin{aligned}
5959
$(_tex(:argmin))_{p ∈ } & f(p)\\
6060
$(_tex(:text, "subject to")) & g_i(p) ≤ 0 $(_tex(:quad)) $(_tex(:text, "for all ")) i=1,…,m,\\
6161
$(_tex(:quad)) &h_j(p)=0 $(_tex(:quad)) $(_tex(:text, "for all ")) j=1,…,n.
62-
\end{aligned}
62+
\\end{aligned}
6363
```
6464
6565
# Fields
@@ -72,7 +72,7 @@ Describes the constrained objective
7272
``h: $(_math(:M)) → ℝ^n`` also possibly containing its gradient and/or Hessian
7373
7474
# Constructors
75-
ConstrainedManifoldObjective(M::AbstractManifold, f, grad_f;
75+
ConstrainedManifoldObjective(f, grad_f;
7676
g=nothing,
7777
grad_g=nothing,
7878
h=nothing,
@@ -94,7 +94,7 @@ of the ranges of `h` and `g`, respectively.
9494
You can also provide a manifold `M` and a point `p` to use one evaluation of the constraints
9595
to automatically try to determine these sizes.
9696
97-
ConstrainedManifoldObjective(M::AbstractManifold, mho::AbstractManifoldObjective;
97+
ConstrainedManifoldObjective(mho::AbstractManifoldObjective;
9898
equality_constraints = nothing,
9999
inequality_constraints = nothing
100100
)
@@ -305,7 +305,7 @@ function ConstrainedManifoldObjective(
305305
end
306306

307307
@doc """
308-
ConstrainedProblem{
308+
ConstrainedManoptProblem{
309309
TM <: AbstractManifold,
310310
O <: AbstractManifoldObjective
311311
HR<:Union{AbstractPowerRepresentation,Nothing},

src/plans/constrained_set_plan.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ where ``$(_tex(:Cal, "C")) ⊂ $(_math(:M))`` is a convex closed subset.
1414
* `objective::AbstractManifoldObjective` the (unconstrained) objective, which
1515
contains ``f`` and for example ist gradient ``$(_tex(:grad)) f``.
1616
* `project!!::PF` a projection function ``$(_tex(:proj))_{$(_tex(:Cal, "C"))}: $(_math(:M))$(_tex(:Cal, "C"))`` that projects onto the set ``$(_tex(:Cal, "C"))``.
17-
* `indicator::IF` the indicator function ``ι_{$(_tex(:Cal, "C"))}(p) = $(_tex(:cases, "0 &" * _tex(:text, " for ") * "p∈" * _tex(:Cal, "C"), "∞ &" * _tex(:text, " else.")))
17+
* `indicator::IF` the indicator function ``ι_{$(_tex(:Cal, "C"))}(p) = $(_tex(:cases, "0 &" * _tex(:text, " for ") * "p∈" * _tex(:Cal, "C"), "∞ &" * _tex(:text, " else.")))``
1818
1919
# Constructor
2020

src/plans/interior_point_Newton_plan.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,12 @@ function calculate_σ(
10121012
λ,
10131013
s;
10141014
vector_space = Rn,
1015-
N = M × vector_space(length(μ)) × vector_space(length(λ)) × vector_space(length(s)),
1015+
N = ProductManifold(
1016+
M,
1017+
vector_space(length(μ)),
1018+
vector_space(length(λ)),
1019+
vector_space(length(s)),
1020+
),
10161021
q = allocate_result(N, rand),
10171022
)
10181023
q1, q2, q3, q4 = submanifold_components(N, q)

src/solvers/interior_point_Newton.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,12 @@ function interior_point_Newton!(
187187
step_objective = ManifoldGradientObjective(
188188
KKTVectorFieldNormSq(cmo), KKTVectorFieldNormSqGradient(cmo); evaluation = evaluation
189189
),
190-
_step_M::AbstractManifold = M × vector_space(length(μ)) × vector_space(length(λ)) ×
190+
_step_M::AbstractManifold = ProductManifold(
191+
M,
192+
vector_space(length(μ)),
193+
vector_space(length(λ)),
191194
vector_space(length(s)),
195+
),
192196
step_problem = DefaultManoptProblem(_step_M, step_objective),
193197
_step_p = rand(_step_M),
194198
step_state = StepsizeState(_step_p, zero_vector(_step_M, _step_p)),
@@ -204,7 +208,7 @@ function interior_point_Newton!(
204208
),
205209
stopping_criterion::StoppingCriterion = StopAfterIteration(800) |
206210
StopWhenKKTResidualLess(1.0e-8),
207-
_sub_M = M × vector_space(length(λ)),
211+
_sub_M = ProductManifold(M, vector_space(length))),
208212
_sub_p = rand(_sub_M),
209213
_sub_X = rand(_sub_M; vector_at = _sub_p),
210214
sub_objective = decorate_objective!(

0 commit comments

Comments
 (0)