Skip to content

Commit 9e6a5e3

Browse files
committed
Add docs
1 parent f9f53bd commit 9e6a5e3

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

src/Bridges/set_map.jl

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
# Use of this source code is governed by an MIT-style license that can be found
55
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
66

7+
"""
8+
struct MapNotInvertible <: Exception end
9+
10+
An error thrown by [`inverse_map_function`](@ref) or
11+
[`inverse_adjoint_map_function`](@ref) indicating that the linear map `A`
12+
defined in [`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref)
13+
is not invertible.
14+
"""
715
struct MapNotInvertible <: Exception end
816

917
"""
@@ -55,7 +63,7 @@ function map_function(::Type{BT}, func, i::IndexInVector) where {BT}
5563
end
5664

5765
"""
58-
inverse_map_function(::Type{BT}, func) where {BT}
66+
inverse_map_function(bridge::MOI.Bridges.AbstractBridge, func)
5967
6068
Return the image of `func` through the inverse of the linear map `A` defined in
6169
[`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref). This is
@@ -64,6 +72,13 @@ used by [`Variable.unbridged_map`](@ref) and for setting the
6472
and for getting the [`MOI.ConstraintFunction`](@ref),
6573
the [`MOI.ConstraintPrimal`](@ref) and the
6674
[`MOI.ConstraintPrimalStart`](@ref) of constraint bridges.
75+
If the linear map `A` is not invertible, the error [`MapNotInvertible`](@ref) is
76+
thrown.
77+
78+
inverse_map_function(::Type{BT}, func) where {BT}
79+
80+
The method can alternatively be defined on the bridge type. This legacy
81+
interface is kept for backward compatibility.
6782
"""
6883
function inverse_map_function end
6984

@@ -72,12 +87,17 @@ function inverse_map_function(bridge::AbstractBridge, func)
7287
end
7388

7489
"""
75-
adjoint_map_function(::Type{BT}, func) where {BT}
90+
adjoint_map_function(bridge::MOI.Bridges.AbstractBridge, func)
7691
7792
Return the image of `func` through the adjoint of the linear map `A` defined in
7893
[`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref). This is
7994
used for getting the [`MOI.ConstraintDual`](@ref) and
8095
[`MOI.ConstraintDualStart`](@ref) of constraint bridges.
96+
97+
adjoint_map_function(::Type{BT}, func) where {BT}
98+
99+
The method can alternatively be defined on the bridge type. This legacy
100+
interface is kept for backward compatibility.
81101
"""
82102
function adjoint_map_function end
83103

@@ -86,13 +106,20 @@ function adjoint_map_function(bridge::AbstractBridge, func)
86106
end
87107

88108
"""
89-
inverse_adjoint_map_function(::Type{BT}, func) where {BT}
109+
inverse_adjoint_map_function(bridge::MOI.Bridges.AbstractBridge, func)
90110
91111
Return the image of `func` through the inverse of the adjoint of the linear map
92112
`A` defined in [`Variable.SetMapBridge`](@ref) and
93113
[`Constraint.SetMapBridge`](@ref). This is used for getting the
94114
[`MOI.ConstraintDual`](@ref) of variable bridges and setting the
95115
[`MOI.ConstraintDualStart`](@ref) of constraint bridges.
116+
If the linear map `A` is not invertible, the error [`MapNotInvertible`](@ref) is
117+
thrown.
118+
119+
inverse_adjoint_map_function(::Type{BT}, func) where {BT}
120+
121+
The method can alternatively be defined on the bridge type. This legacy
122+
interface is kept for backward compatibility.
96123
"""
97124
function inverse_adjoint_map_function end
98125

0 commit comments

Comments
 (0)