11export AbstractBatchNLPModel
2+ export obj!
23
34"""
45 AbstractBatchNLPModel
@@ -11,211 +12,199 @@ and the sparsity patterns of the Jacobian and the Hessian of the Lagrangian are
1112abstract type AbstractBatchNLPModel{T, S} end
1213
1314"""
14- bf = obj(bnlp, bx)
15+ bf = obj(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix )
1516"""
16- function obj (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector ) where {T, S}
17- @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx
18- bf = S (undef, bnlp. meta. nbatch)
17+ function obj (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractMatrix ) where {T, S}
18+ bf = S (undef, 1 , bnlp. meta. nbatch) |> vec
1919 obj! (bnlp, bx, bf)
2020 return bf
2121end
2222
2323"""
24- bf = obj!(bnlp, bx, bf)
24+ bf = obj!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bf::AbstractVector )
2525"""
2626function obj! end
2727
2828"""
29- bg = grad(bnlp, bx)
29+ bg = grad(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix )
3030
3131This function is only available if `bnlp.meta.grad_available` is set to `true`.
3232"""
33- function grad (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector ) where {T, S}
34- @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx
35- bg = S (undef, bnlp. meta. nvar * bnlp. meta. nbatch)
33+ function grad (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractMatrix ) where {T, S}
34+ bg = S (undef, bnlp. meta. nvar, bnlp. meta. nbatch)
3635 grad! (bnlp, bx, bg)
3736 return bg
3837end
3938
4039"""
41- bg = grad!(bnlp, bx, bg)
40+ bg = grad!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bg::AbstractMatrix )
4241
4342This function is only available if `bnlp.meta.grad_available` is set to `true`.
4443"""
4544# function grad! end
4645
4746"""
48- bc = cons(bnlp, bx)
47+ bc = cons(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix )
4948"""
50- function cons (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector ) where {T, S}
51- @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx
52- bc = S (undef, bnlp. meta. ncon * bnlp. meta. nbatch)
49+ function cons (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractMatrix ) where {T, S}
50+ bc = S (undef, bnlp. meta. ncon, bnlp. meta. nbatch)
5351 cons! (bnlp, bx, bc)
5452 return bc
5553end
5654
5755"""
58- bc = cons!(bnlp, bx, bc)
56+ bc = cons!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bc::AbstractMatrix )
5957"""
6058# function cons! end
6159
6260"""
63- (jrows, jcols) = jac_structure(bnlp)
61+ (jrows, jcols) = jac_structure(bnlp::AbstractBatchNLPModel )
6462
6563This function is only available if `bnlp.meta.jac_available` is set to `true`.
6664"""
67- function jac_structure (bnlp:: AbstractBatchNLPModel{T, S} ) where {T, S}
65+ function jac_structure (bnlp:: AbstractBatchNLPModel )
6866 jrows = Vector {Int} (undef, bnlp. meta. nnzj)
6967 jcols = Vector {Int} (undef, bnlp. meta. nnzj)
7068 jac_structure! (bnlp, jrows, jcols)
7169 return (jrows, jcols)
7270end
7371
7472"""
75- (jrows, jcols) = jac_structure!(bnlp, jrows, jcols)
73+ (jrows, jcols) = jac_structure!(bnlp::AbstractBatchNLPModel , jrows::AbstractVector , jcols::AbstractVector )
7674
7775This function is only available if `bnlp.meta.jac_available` is set to `true`.
7876"""
7977# function jac_structure! end
8078
8179"""
82- bjvals = jac_coord(bnlp, bx)
80+ bjvals = jac_coord(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix )
8381
8482This function is only available if `bnlp.meta.jac_available` is set to `true`.
8583"""
86- function jac_coord (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector ) where {T, S}
87- @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx
88- bjvals = S (undef, bnlp. meta. nnzj * bnlp. meta. nbatch)
84+ function jac_coord (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractMatrix ) where {T, S}
85+ bjvals = S (undef, bnlp. meta. nnzj, bnlp. meta. nbatch)
8986 jac_coord! (bnlp, bx, bjvals)
9087 return bjvals
9188end
9289
9390"""
94- bjvals = jac_coord!(bnlp, bx, bjvals)
91+ bjvals = jac_coord!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bjvals::AbstractMatrix )
9592
9693This function is only available if `bnlp.meta.jac_available` is set to `true`.
9794"""
9895# function jac_coord! end
9996
10097"""
101- bJx = jac_dense!(bnlp, bx, bJx)
98+ bJx = jac_dense!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bJx::AbstractArray )
10299
103100This function is only available if `bnlp.meta.jac_available` is set to `true`.
104101"""
105102# function jac_dense! end
106103
107104"""
108- bJv = jprod(bnlp, bx, bv)
105+ bJv = jprod(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bv::AbstractMatrix )
109106
110107This function is only available if `bnlp.meta.jprod_available` is set to `true`.
111108"""
112- function jprod (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector , bv:: AbstractVector ) where {T, S}
113- @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx bv
114- bJv = S (undef, bnlp. meta. ncon * bnlp. meta. nbatch)
109+ function jprod (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractMatrix , bv:: AbstractMatrix ) where {T, S}
110+ bJv = S (undef, bnlp. meta. ncon, bnlp. meta. nbatch)
115111 jprod! (bnlp, bx, bv, bJv)
116112 return bJv
117113end
118114
119115"""
120- bJv = jprod!(bnlp, bx, bv, bJv)
116+ bJv = jprod!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bv::AbstractMatrix , bJv::AbstractMatrix )
121117
122118This function is only available if `bnlp.meta.jprod_available` is set to `true`.
123119"""
124120# function jprod! end
125121
126122"""
127- bJtv = jtprod(bnlp, bx, bv)
123+ bJtv = jtprod(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bv::AbstractMatrix )
128124
129125This function is only available if `bnlp.meta.jtprod_available` is set to `true`.
130126"""
131- function jtprod (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector , bv:: AbstractVector ) where {T, S}
132- @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx
133- @lencheck (bnlp. meta. ncon * bnlp. meta. nbatch) bv
134- bJtv = S (undef, bnlp. meta. nvar * bnlp. meta. nbatch)
127+ function jtprod (bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractMatrix , bv:: AbstractMatrix ) where {T, S}
128+ bJtv = S (undef, bnlp. meta. nvar, bnlp. meta. nbatch)
135129 jtprod! (bnlp, bx, bv, bJtv)
136130 return bJtv
137131end
138132
139133"""
140- bJtv = jtprod!(bnlp, bx, bv, bJtv)
134+ bJtv = jtprod!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , bv::AbstractMatrix , bJtv::AbstractMatrix )
141135
142136This function is only available if `bnlp.meta.jtprod_available` is set to `true`.
143137"""
144138# function jtprod! end
145139
146140"""
147- (hrows, hcols) = hess_structure(bnlp)
141+ (hrows, hcols) = hess_structure(bnlp::AbstractBatchNLPModel )
148142
149143This function is only available if `bnlp.meta.hess_available` is set to `true`.
150144"""
151- function hess_structure (bnlp:: AbstractBatchNLPModel{T,S} ) where {T, S}
145+ function hess_structure (bnlp:: AbstractBatchNLPModel )
152146 hrows = Vector {Int} (undef, bnlp. meta. nnzh)
153147 hcols = Vector {Int} (undef, bnlp. meta. nnzh)
154148 hess_structure! (bnlp, hrows, hcols)
155149 return hrows, hcols
156150end
157151
158152"""
159- (hrows, hcols) = hess_structure!(bnlp, hrows, hcols)
153+ (hrows, hcols) = hess_structure!(bnlp::AbstractBatchNLPModel , hrows::AbstractVector , hcols::AbstractVector )
160154
161155This function is only available if `bnlp.meta.hess_available` is set to `true`.
162156"""
163157# function hess_structure! end
164158
165159"""
166- bhvals = hess_coord(bnlp, bx, by, bobj_weight)
160+ bhvals = hess_coord(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , by::AbstractMatrix , bobj_weight::AbstractVector )
167161
168162This function is only available if `bnlp.meta.hess_available` is set to `true`.
169163"""
170164function hess_coord (
171165 bnlp:: AbstractBatchNLPModel{T, S} ,
172- bx:: AbstractVector ,
173- by:: AbstractVector ,
166+ bx:: AbstractMatrix ,
167+ by:: AbstractMatrix ,
174168 bobj_weight:: AbstractVector ,
175169) where {T, S}
176- @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx
177- @lencheck (bnlp. meta. ncon * bnlp. meta. nbatch) by
178- @lencheck bnlp. meta. nbatch bobj_weight
179- bhvals = S (undef, bnlp. meta. nnzh * bnlp. meta. nbatch)
180- return hess_coord! (bnlp, bx, by, bobj_weight, bhvals)
170+ bhvals = S (undef, bnlp. meta. nnzh, bnlp. meta. nbatch)
171+ hess_coord! (bnlp, bx, by, bobj_weight, bhvals)
172+ return bhvals
181173end
182174
183175"""
184- bhvals = hess_coord!(bnlp, bx, by, bobj_weight, bhvals)
176+ bhvals = hess_coord!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , by::AbstractMatrix , bobj_weight::AbstractVector , bhvals::AbstractMatrix )
185177
186178This function is only available if `bnlp.meta.hess_available` is set to `true`.
187179"""
188180# function hess_coord! end
189181
190182"""
191- bHx = hess_dense!(bnlp, bx, by, bHx, bobj_weight )
183+ bHx = hess_dense!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , by::AbstractMatrix, bobj_weight::AbstractVector, bHx::AbstractArray )
192184
193185This function is only available when `bnlp.meta.hess_available` is set to `true`.
194186"""
195187# function hess_dense! end
196188
197189"""
198- bHv = hprod(bnlp, bx, by, bv, bobj_weight)
190+ bHv = hprod(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , by::AbstractMatrix , bv::AbstractMatrix , bobj_weight::AbstractVector )
199191
200192This function is only available if `bnlp.meta.hprod_available` is set to `true`.
201193"""
202194function hprod (
203195 bnlp:: AbstractBatchNLPModel{T, S} ,
204- bx:: AbstractVector ,
205- by:: AbstractVector ,
206- bv:: AbstractVector ,
196+ bx:: AbstractMatrix ,
197+ by:: AbstractMatrix ,
198+ bv:: AbstractMatrix ,
207199 bobj_weight:: AbstractVector ,
208200) where {T, S}
209- @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx bv
210- @lencheck (bnlp. meta. ncon * bnlp. meta. nbatch) by
211- @lencheck bnlp. meta. nbatch bobj_weight
212- bHv = S (undef, bnlp. meta. nvar * bnlp. meta. nbatch)
201+ bHv = S (undef, bnlp. meta. nvar, bnlp. meta. nbatch)
213202 hprod! (bnlp, bx, by, bv, bobj_weight, bHv)
214203 return bHv
215204end
216205
217206"""
218- bHv = hprod!(bnlp, bx, by, bv, bobj_weight, bHv)
207+ bHv = hprod!(bnlp::AbstractBatchNLPModel , bx::AbstractMatrix , by::AbstractMatrix , bv::AbstractMatrix , bobj_weight::AbstractVector , bHv::AbstractMatrix )
219208
220209This function is only available if `bnlp.meta.hprod_available` is set to `true`.
221210"""
0 commit comments