File tree Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,25 @@ mutable struct NonlinearData <: MOI.AbstractNLPEvaluator
183
183
end
184
184
end
185
185
186
+ _bound (s:: MOI.LessThan ) = MOI. NLPBoundsPair (- Inf , s. upper)
187
+ _bound (s:: MOI.GreaterThan ) = MOI. NLPBoundsPair (s. lower, Inf )
188
+ _bound (s:: MOI.EqualTo ) = MOI. NLPBoundsPair (s. value, s. value)
189
+ _bound (s:: MOI.Interval ) = MOI. NLPBoundsPair (s. lower, s. upper)
190
+
191
+ """
192
+ MOI.NLPBlockData(data::NonlinearData)
193
+
194
+ Create an [`MOI.NLPBlockData`](@ref) object from a [`NonlinearData`](@ref)
195
+ object.
196
+ """
197
+ function MOI. NLPBlockData (data:: NonlinearData )
198
+ return MOI. NLPBlockData (
199
+ [_bound (c. set) for (_, c) in data. constraints],
200
+ data,
201
+ data. objective != = nothing ,
202
+ )
203
+ end
204
+
186
205
"""
187
206
AbstractAutomaticDifferentiation
188
207
@@ -223,16 +242,3 @@ function set_differentiation_backend(
223
242
return
224
243
end
225
244
226
- """
227
- MOI.NLPBlockData(data::NonlinearData)
228
-
229
- Create an [`MOI.NLPBlockData`](@ref) object from a [`NonlinearData`](@ref)
230
- object.
231
- """
232
- function MOI. NLPBlockData (data:: NonlinearData )
233
- return MOI. NLPBlockData (
234
- [_bound (c. set) for (_, c) in data. constraints],
235
- data,
236
- data. objective != = nothing ,
237
- )
238
- end
You can’t perform that action at this time.
0 commit comments