@@ -106,14 +106,14 @@ function __constraint!(
106106
107107 (:: Nothing , :: Function , :: ctVector , :: ctVector ) => begin
108108 # set the constraint
109- if type ∈ [:boundary , :variable , : path ]
109+ if type ∈ [:boundary , :path ]
110110 ocp_constraints[label] = (type, f, lb, ub)
111111 else
112112 throw (
113113 CTBase. IncorrectArgument (
114114 " the following type of constraint is not valid: " *
115115 String (type) *
116- " . Please choose in [ :boundary, :variable, : path ] or check the arguments of the constraint! method." ,
116+ " . Please choose in [ :boundary, :path ] or check the arguments of the constraint! method." ,
117117 ),
118118 )
119119 end
@@ -172,7 +172,7 @@ constraint(ocp::Model, label::Symbol)::Tuple = ocp.constraints.dict[label]
172172
173173(
174174 path_constraints_nl (
175- ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TV1, TB,TS,TC,TV2 ,ConstraintsDictType}}
175+ ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TB,TS,TC,TV ,ConstraintsDictType}}
176176 ):: TP
177177) where {
178178 T<: TimesModel ,
@@ -182,35 +182,15 @@ constraint(ocp::Model, label::Symbol)::Tuple = ocp.constraints.dict[label]
182182 D<: Function ,
183183 O<: AbstractObjectiveModel ,
184184 TP,
185- TV1,
186185 TB,
187186 TS,
188187 TC,
189- TV2 ,
188+ TV ,
190189} = ocp. constraints. path_nl
191190
192- (
193- variable_constraints_nl (
194- ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TV1,TB,TS,TC,TV2,ConstraintsDictType}}
195- ):: TV1
196- ) where {
197- T<: TimesModel ,
198- S<: AbstractStateModel ,
199- C<: AbstractControlModel ,
200- V<: AbstractVariableModel ,
201- D<: Function ,
202- O<: AbstractObjectiveModel ,
203- TP,
204- TV1,
205- TB,
206- TS,
207- TC,
208- TV2,
209- } = ocp. constraints. variable_nl
210-
211191(
212192 boundary_constraints_nl (
213- ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TV1, TB,TS,TC,TV2 ,ConstraintsDictType}}
193+ ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TB,TS,TC,TV ,ConstraintsDictType}}
214194 ):: TB
215195) where {
216196 T<: TimesModel ,
@@ -220,16 +200,15 @@ constraint(ocp::Model, label::Symbol)::Tuple = ocp.constraints.dict[label]
220200 D<: Function ,
221201 O<: AbstractObjectiveModel ,
222202 TP,
223- TV1,
224203 TB,
225204 TS,
226205 TC,
227- TV2 ,
206+ TV ,
228207} = ocp. constraints. boundary_nl
229208
230209(
231210 state_constraints_box (
232- ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TV1, TB,TS,TC,TV2 ,ConstraintsDictType}}
211+ ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TB,TS,TC,TV ,ConstraintsDictType}}
233212 ):: TS
234213) where {
235214 T<: TimesModel ,
@@ -239,16 +218,15 @@ constraint(ocp::Model, label::Symbol)::Tuple = ocp.constraints.dict[label]
239218 D<: Function ,
240219 O<: AbstractObjectiveModel ,
241220 TP,
242- TV1,
243221 TB,
244222 TS,
245223 TC,
246- TV2 ,
224+ TV ,
247225} = ocp. constraints. state_box
248226
249227(
250228 control_constraints_box (
251- ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TV1, TB,TS,TC,TV2 ,ConstraintsDictType}}
229+ ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TB,TS,TC,TV ,ConstraintsDictType}}
252230 ):: TC
253231) where {
254232 T<: TimesModel ,
@@ -258,17 +236,16 @@ constraint(ocp::Model, label::Symbol)::Tuple = ocp.constraints.dict[label]
258236 D<: Function ,
259237 O<: AbstractObjectiveModel ,
260238 TP,
261- TV1,
262239 TB,
263240 TS,
264241 TC,
265- TV2 ,
242+ TV ,
266243} = ocp. constraints. control_box
267244
268245(
269246 variable_constraints_box (
270- ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TV1, TB,TS,TC,TV2 ,ConstraintsDictType}}
271- ):: TV2
247+ ocp:: Model{T,S,C,V,D,O,ConstraintsModel{TP,TB,TS,TC,TV ,ConstraintsDictType}}
248+ ):: TV
272249) where {
273250 T<: TimesModel ,
274251 S<: AbstractStateModel ,
@@ -277,51 +254,43 @@ constraint(ocp::Model, label::Symbol)::Tuple = ocp.constraints.dict[label]
277254 D<: Function ,
278255 O<: AbstractObjectiveModel ,
279256 TP,
280- TV1,
281257 TB,
282258 TS,
283259 TC,
284- TV2 ,
260+ TV ,
285261} = ocp. constraints. variable_box
286262
287263"""
288264$(TYPEDSIGNATURES)
289265
290266Return the dimension of nonlinear path constraints.
291267"""
292- dim_path_constraints_nl (ocp:: Model ):: Int = length (path_constraints_nl (ocp)[1 ])
268+ dim_path_constraints_nl (ocp:: Model ):: Dimension = length (path_constraints_nl (ocp)[1 ])
293269
294270"""
295271$(TYPEDSIGNATURES)
296272
297273Return the dimension of the boundary constraints.
298274"""
299- dim_boundary_constraints_nl (ocp:: Model ):: Int = length (boundary_constraints_nl (ocp)[1 ])
300-
301- """
302- $(TYPEDSIGNATURES)
303-
304- Return the dimension of nonlinear variable constraints.
305- """
306- dim_variable_constraints_nl (ocp:: Model ):: Int = length (variable_constraints_nl (ocp)[1 ])
275+ dim_boundary_constraints_nl (ocp:: Model ):: Dimension = length (boundary_constraints_nl (ocp)[1 ])
307276
308277"""
309278$(TYPEDSIGNATURES)
310279
311280Return the dimension of box constraints on state.
312281"""
313- dim_state_constraints_box (ocp:: Model ):: Int = length (state_constraints_box (ocp)[1 ])
282+ dim_state_constraints_box (ocp:: Model ):: Dimension = length (state_constraints_box (ocp)[1 ])
314283
315284"""
316285$(TYPEDSIGNATURES)
317286
318287Return the dimension of box constraints on control.
319288"""
320- dim_control_constraints_box (ocp:: Model ):: Int = length (control_constraints_box (ocp)[1 ])
289+ dim_control_constraints_box (ocp:: Model ):: Dimension = length (control_constraints_box (ocp)[1 ])
321290
322291"""
323292$(TYPEDSIGNATURES)
324293
325294Return the dimension of box constraints on variable.
326295"""
327- dim_variable_constraints_box (ocp:: Model ):: Int = length (variable_constraints_box (ocp)[1 ])
296+ dim_variable_constraints_box (ocp:: Model ):: Dimension = length (variable_constraints_box (ocp)[1 ])
0 commit comments