@@ -34,16 +34,25 @@ used for getting the [`MOI.ConstraintSet`](@ref).
34
34
function inverse_map_set end
35
35
36
36
"""
37
+ map_function(bridge::MOI.Bridges.AbstractBridge, func)
37
38
map_function(::Type{BT}, func) where {BT}
38
39
39
40
Return the image of `func` through the linear map `A` defined in
40
- [`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref). This is
41
- used for getting the [`MOI.ConstraintPrimal`](@ref) of variable
41
+ [`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref).
42
+
43
+ This function is used for getting the [`MOI.ConstraintPrimal`](@ref) of variable
42
44
bridges. For constraint bridges, this is used for bridging the constraint,
43
- setting the [`MOI.ConstraintFunction`](@ref) and
44
- [`MOI.ConstraintPrimalStart`](@ref) and
45
- modifying the function with [`MOI.modify`](@ref).
45
+ setting the [`MOI.ConstraintFunction`](@ref) and [`MOI.ConstraintPrimalStart`](@ref)
46
+ and modifying the function with [`MOI.modify`](@ref).
47
+
48
+ The method can alternatively be defined on the bridge type. This legacy
49
+ interface is kept for backward compatibility.
50
+ """
51
+ function map_function (bridge:: AbstractBridge , func)
52
+ return map_function (typeof (bridge), func)
53
+ end
46
54
55
+ """
47
56
map_function(::Type{BT}, func, i::IndexInVector) where {BT}
48
57
49
58
Return the scalar function at the `i`th index of the vector function that
@@ -52,77 +61,65 @@ would be returned by `map_function(BT, func)` except that it may compute the
52
61
the [`MOI.VariablePrimal`](@ref) and
53
62
[`MOI.VariablePrimalStart`](@ref) of variable bridges.
54
63
"""
55
- function map_function end
56
-
57
- function map_function (bridge:: AbstractBridge , func)
58
- return map_function (typeof (bridge), func)
59
- end
60
-
61
64
function map_function (:: Type{BT} , func, i:: IndexInVector ) where {BT}
62
65
return MOI. Utilities. eachscalar (map_function (BT, func))[i. value]
63
66
end
64
67
65
68
"""
66
69
inverse_map_function(bridge::MOI.Bridges.AbstractBridge, func)
70
+ inverse_map_function(::Type{BT}, func) where {BT}
67
71
68
72
Return the image of `func` through the inverse of the linear map `A` defined in
69
- [`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref). This is
70
- used by [`Variable.unbridged_map`](@ref) and for setting the
71
- [`MOI.VariablePrimalStart `](@ref) of variable bridges
72
- and for getting the [`MOI.ConstraintFunction `](@ref),
73
- the [`MOI.ConstraintPrimal`](@ref) and the
73
+ [`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref).
74
+
75
+ This function is used by [`Variable.unbridged_map `](@ref) and for setting the
76
+ [`MOI.VariablePrimalStart `](@ref) of variable bridges and for getting the
77
+ [`MOI.ConstraintFunction`](@ref), the [`MOI.ConstraintPrimal`](@ref) and the
74
78
[`MOI.ConstraintPrimalStart`](@ref) of constraint bridges.
79
+
75
80
If the linear map `A` is not invertible, the error [`MapNotInvertible`](@ref) is
76
81
thrown.
77
82
78
- inverse_map_function(::Type{BT}, func) where {BT}
79
-
80
83
The method can alternatively be defined on the bridge type. This legacy
81
84
interface is kept for backward compatibility.
82
85
"""
83
- function inverse_map_function end
84
-
85
86
function inverse_map_function (bridge:: AbstractBridge , func)
86
87
return inverse_map_function (typeof (bridge), func)
87
88
end
88
89
89
90
"""
90
91
adjoint_map_function(bridge::MOI.Bridges.AbstractBridge, func)
92
+ adjoint_map_function(::Type{BT}, func) where {BT}
91
93
92
94
Return the image of `func` through the adjoint of the linear map `A` defined in
93
- [`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref). This is
94
- used for getting the [`MOI.ConstraintDual`](@ref) and
95
- [`MOI.ConstraintDualStart`](@ref) of constraint bridges.
95
+ [`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref).
96
96
97
- adjoint_map_function(::Type{BT}, func) where {BT}
97
+ This function is used for getting the [`MOI.ConstraintDual`](@ref) and
98
+ [`MOI.ConstraintDualStart`](@ref) of constraint bridges.
98
99
99
100
The method can alternatively be defined on the bridge type. This legacy
100
101
interface is kept for backward compatibility.
101
102
"""
102
- function adjoint_map_function end
103
-
104
103
function adjoint_map_function (bridge:: AbstractBridge , func)
105
104
return adjoint_map_function (typeof (bridge), func)
106
105
end
107
106
108
107
"""
109
108
inverse_adjoint_map_function(bridge::MOI.Bridges.AbstractBridge, func)
109
+ inverse_adjoint_map_function(::Type{BT}, func) where {BT}
110
110
111
111
Return the image of `func` through the inverse of the adjoint of the linear map
112
- `A` defined in [`Variable.SetMapBridge`](@ref) and
113
- [`Constraint.SetMapBridge`](@ref). This is used for getting the
114
- [`MOI.ConstraintDual`](@ref) of variable bridges and setting the
115
- [`MOI.ConstraintDualStart`](@ref) of constraint bridges.
112
+ `A` defined in [`Variable.SetMapBridge`](@ref) and [`Constraint.SetMapBridge`](@ref).
113
+
114
+ This function is used for getting the [`MOI.ConstraintDual`](@ref) of variable
115
+ bridges and setting the [`MOI.ConstraintDualStart`](@ref) of constraint bridges.
116
+
116
117
If the linear map `A` is not invertible, the error [`MapNotInvertible`](@ref) is
117
118
thrown.
118
119
119
- inverse_adjoint_map_function(::Type{BT}, func) where {BT}
120
-
121
120
The method can alternatively be defined on the bridge type. This legacy
122
121
interface is kept for backward compatibility.
123
122
"""
124
- function inverse_adjoint_map_function end
125
-
126
123
function inverse_adjoint_map_function (bridge:: AbstractBridge , func)
127
124
return inverse_adjoint_map_function (typeof (bridge), func)
128
125
end
0 commit comments