11"""
2- ConstrainedSetObjective {E, MO, PF, IF} <: AbstractManifoldObjective{E}
2+ ManifoldConstrainedSetObjective {E, MO, PF, IF} <: AbstractManifoldObjective{E}
33
44Model a constrained objective restricted to a set
55
@@ -18,7 +18,7 @@ where ``$(_tex(:Cal,"C")) ⊂ $(_math(:M))`` is a convex closed subset.
1818
1919# Constructor
2020
21- ConstrainedSetObjective (f, grad_f, project!!; kwargs...)
21+ ManifoldConstrainedSetObjective (f, grad_f, project!!; kwargs...)
2222
2323Generate the constrained objective for a given function `f` its gradient `grad_f` and a projection `project!!` ``$(_tex (:proj )) _{$(_tex (:Cal ," C" )) }``.
2424
@@ -28,22 +28,24 @@ $(_var(:Keyword, :evaluation))
2828* `indicator=nothing`: the indicator function ``ι_{$(_tex (:Cal ," C" )) }(p)``. If not provided a test, whether the projection yields the same point is performed.
2929 For the [`InplaceEvaluation`](@ref) this required one allocation.
3030"""
31- struct ConstrainedSetObjective {
31+ struct ManifoldConstrainedSetObjective {
3232 E<: AbstractEvaluationType ,MO<: AbstractManifoldObjective ,PF,IF
3333} <: AbstractManifoldObjective{E}
3434 objective:: MO
3535 project!!:: PF
3636 indicator:: IF
3737end
3838
39- function ConstrainedSetObjective (
39+ function ManifoldConstrainedSetObjective (
4040 f, grad_f, project!!:: PF ; evaluation:: E = AllocatingEvaluation (), indicator= nothing
4141) where {PF,E<: AbstractEvaluationType }
4242 obj = ManifoldGradientObjective (f, grad_f; evaluation= evaluation)
4343 if isnothing (indicator)
4444 if evaluation isa AllocatingEvaluation
4545 ind (M, p) = (distance (M, p, project!! (M, p)) ≈ 0 ? 0 : Inf )
46- return ConstrainedSetObjective {E,typeof(obj),typeof(project!!),typeof(ind)} (
46+ return ManifoldConstrainedSetObjective{
47+ E,typeof (obj),typeof (project!!),typeof (ind)
48+ }(
4749 obj, project!!, ind
4850 )
4951 elseif evaluation isa InplaceEvaluation
@@ -52,39 +54,43 @@ function ConstrainedSetObjective(
5254 project!! (M, q, p)
5355 return distance (M, p, q) ≈ 0 ? 0 : Inf
5456 end
55- return ConstrainedSetObjective {E,typeof(obj),typeof(project!!),typeof(ind)} (
57+ return ManifoldConstrainedSetObjective{
58+ E,typeof (obj),typeof (project!!),typeof (ind)
59+ }(
5660 obj, project!!, ind
5761 )
5862 end
5963 end
60- return ConstrainedSetObjective {E,typeof(obj),typeof(project!!),typeof(indicator)} (
64+ return ManifoldConstrainedSetObjective{
65+ E,typeof (obj),typeof (project!!),typeof (indicator)
66+ }(
6167 obj, project!!, indicator
6268 )
6369end
6470
65- function get_cost (M:: AbstractManifold , cso:: ConstrainedSetObjective , p)
71+ function get_cost (M:: AbstractManifold , cso:: ManifoldConstrainedSetObjective , p)
6672 return get_cost (M, cso. objective, p)
6773end
68- function get_cost_function (cso:: ConstrainedSetObjective , recursive= false )
69- return get_cost_function (cso. objective)
74+ function get_cost_function (cso:: ManifoldConstrainedSetObjective , recursive= false )
75+ return get_cost_function (cso. objective, recursive )
7076end
71- function get_gradient_function (cso:: ConstrainedSetObjective , recursive= false )
72- return get_gradient_function (cso. objective)
77+ function get_gradient_function (cso:: ManifoldConstrainedSetObjective , recursive= false )
78+ return get_gradient_function (cso. objective, recursive )
7379end
74- function get_gradient (M:: AbstractManifold , cso:: ConstrainedSetObjective , p)
80+ function get_gradient (M:: AbstractManifold , cso:: ManifoldConstrainedSetObjective , p)
7581 return get_gradient (M, cso. objective, p)
7682end
77- function get_gradient! (M:: AbstractManifold , X, cso:: ConstrainedSetObjective , p)
83+ function get_gradient! (M:: AbstractManifold , X, cso:: ManifoldConstrainedSetObjective , p)
7884 return get_gradient! (M, X, cso. objective, p)
7985end
8086
8187_doc_get_projected_point = """
8288 get_projected_point(amp::AbstractManoptProblem, p)
8389 get_projected_point!(amp::AbstractManoptProblem, q, p)
84- get_projected_point(M::AbstractManifold, cso::ConstrainedSetObjective , p)
85- get_projected_point!(M::AbstractManifold, q, cso::ConstrainedSetObjective , p)
90+ get_projected_point(M::AbstractManifold, cso::ManifoldConstrainedSetObjective , p)
91+ get_projected_point!(M::AbstractManifold, q, cso::ManifoldConstrainedSetObjective , p)
8692
87- Project `p` with the projection that is stored within the [`ConstrainedSetObjective `](@ref).
93+ Project `p` with the projection that is stored within the [`ManifoldConstrainedSetObjective `](@ref).
8894This can be done in-place of `q`.
8995"""
9096
@@ -98,29 +104,29 @@ function get_projected_point!(amp::AbstractManoptProblem, q, p)
98104end
99105
100106@doc " $(_doc_get_projected_point) "
101- get_projected_point (M:: AbstractManifold , cso:: ConstrainedSetObjective , p)
107+ get_projected_point (M:: AbstractManifold , cso:: ManifoldConstrainedSetObjective , p)
102108function get_projected_point (
103- M:: AbstractManifold , cso:: ConstrainedSetObjective {AllocatingEvaluation} , p
109+ M:: AbstractManifold , cso:: ManifoldConstrainedSetObjective {AllocatingEvaluation} , p
104110)
105111 return cso. project!! (M, p)
106112end
107113function get_projected_point (
108- M:: AbstractManifold , cso:: ConstrainedSetObjective {InplaceEvaluation} , p
114+ M:: AbstractManifold , cso:: ManifoldConstrainedSetObjective {InplaceEvaluation} , p
109115)
110116 q = copy (M, p)
111117 cso. project!! (M, q, p)
112118 return q
113119end
114120@doc " $(_doc_get_projected_point) "
115- get_projected_point! (M:: AbstractManifold , q, cso:: ConstrainedSetObjective , p)
121+ get_projected_point! (M:: AbstractManifold , q, cso:: ManifoldConstrainedSetObjective , p)
116122function get_projected_point! (
117- M:: AbstractManifold , q, cso:: ConstrainedSetObjective {AllocatingEvaluation} , p
123+ M:: AbstractManifold , q, cso:: ManifoldConstrainedSetObjective {AllocatingEvaluation} , p
118124)
119125 copyto! (M, q, cso. project!! (M, p))
120126 return q
121127end
122128function get_projected_point! (
123- M:: AbstractManifold , q, cso:: ConstrainedSetObjective {InplaceEvaluation} , p
129+ M:: AbstractManifold , q, cso:: ManifoldConstrainedSetObjective {InplaceEvaluation} , p
124130)
125131 cso. project!! (M, q, p)
126132 return q
0 commit comments