@@ -194,10 +194,11 @@ end
194194Return a `Bool` indicating whether `attr.name` is a valid option name
195195for `Manopt`.
196196"""
197- function MOI. supports (:: ManoptOptimizer , :: MOI.RawOptimizerAttribute )
197+ function MOI. supports (:: ManoptOptimizer , attr :: MOI.RawOptimizerAttribute )
198198 # FIXME Ideally, this should only return `true` if it is a valid keyword argument for
199199 # one of the `...DescentState()` constructors. Is there an easy way to check this ?
200200 # Does it depend on the different solvers ?
201+ @info attr. name
201202 return true
202203end
203204
@@ -503,6 +504,10 @@ function MOI.optimize!(model::ManoptOptimizer)
503504 return nothing
504505end
505506
507+ #
508+ #
509+ # A wrapper for points that are just array shaped
510+
506511@doc """
507512 ManifoldPointArrayShape{N} <: JuMP.AbstractShape
508513
@@ -588,29 +593,65 @@ At the moment, we only support manifolds for which the shape is a `Array`.
588593function _shape (m:: ManifoldsBase.AbstractManifold )
589594 return ManifoldPointArrayShape (ManifoldsBase. representation_size (m))
590595end
591-
592- _in (mime:: MIME"text/plain" ) = " in"
593- _in (mime:: MIME"text/latex" ) = " \\ in"
594-
595- function JuMP. in_set_string (mime, set:: ManifoldsBase.AbstractManifold )
596- return _in (mime) * " " * string (set)
596+ function _shape (m:: ManifoldsBase.AbstractManifold , :: Nothing )
597+ return _shape (m)
598+ end
599+ function _shape (m:: ManifoldsBase.AbstractManifold , :: P ) where {P}
600+ error (" TODO" )
597601end
598602
599603"""
600- JuMP.build_variable(::Function, func, m::ManifoldsBase.AbstractManifold)
604+ JuMP.build_variable(::Function, func, m::ManifoldsBase.AbstractManifold, ::Type{P}=Nothing )
601605
602606Build a `JuMP.VariablesConstrainedOnCreation` object containing variables
603607and the [`ManifoldSet`](@ref) in which they should belong as well as the
604608`shape` that can be used to go from the vectorized MOI representation to the
605609shape of the manifold, that is, [`ManifoldPointArrayShape`](@ref).
610+
611+ The optional parameter `P` can be used to indicate that the point is different from an integer
606612"""
607- function JuMP. build_variable (:: Function , func, m:: ManifoldsBase.AbstractManifold )
613+ function JuMP. build_variable (:: Function , point, m:: ManifoldsBase.AbstractManifold )
614+ @info point
608615 shape = _shape (m)
609616 return JuMP. VariablesConstrainedOnCreation (
610- JuMP. vectorize (func , shape), ManifoldSet (m), shape
617+ JuMP. vectorize (point , shape), ManifoldSet (m), shape
611618 )
612619end
613620
621+ #
622+ #
623+ # Non-Array points, either general structs or those that require wrappers
624+ # Test examples:
625+ # * HyperboloidPoint (the same as array on Hyperbolic, so basically an array)
626+ # * SVDMPoint on FixedRank, which actualy has 3 fields
627+
628+ @doc """
629+ ManifoldPointArrayShape{M, P} <: JuMP.AbstractShape
630+
631+ A wrapper for points on a manifold of type `M` of type `P`
632+
633+ # Fields
634+
635+ * manifold::M
636+ """
637+ struct ManifoldPointShape{M <: AbstractManifold , P} <: JuMP.AbstractShape
638+ manifold:: M
639+ end
640+
641+ # Functions we need
642+
643+
644+ #
645+ #
646+ # Generic further functions
647+
648+ _in (mime:: MIME"text/plain" ) = " in"
649+ _in (mime:: MIME"text/latex" ) = " \\ in"
650+
651+ function JuMP. in_set_string (mime, set:: ManifoldsBase.AbstractManifold )
652+ return _in (mime) * " " * string (set)
653+ end
654+
614655"""
615656 MOI.get(model::ManoptOptimizer, ::MOI.ResultCount)
616657
0 commit comments