@@ -23,9 +23,6 @@ abstract type AbstractBatchNLPModel{T,S,VI} end
2323
2424"""
2525 bf = batch_obj(bnlp, bx)
26-
27- The input `bx` contains `bnlp.nbatch` points stacked in a full strided (column-wise) layout.
28- The output `bf` stores the objective value for each batch entry.
2926"""
3027function batch_obj(bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector ) where {T, S}
3128 @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx
3633
3734"""
3835 bf = batch_obj!(bnlp, bx, bf)
39-
40- Evaluate ``[ f(x₁) | f(x₂) | ... ]``, the objective function of `bnlp` at `bx = [ x₁ | x₂ | ... ]` in place.
41- Both input `bx` and output `bf` follow a full strided (column-wise) batch layout.
4236"""
4337function batch_obj! end
4438
4539"""
4640 bg = batch_grad(bnlp, bx)
4741
48- Evaluate ``∇f(x)``, the gradient of the objective function at `bx`.
49- The gradients are returned in a full strided (column-wise) layout, with one gradient vector per batch entry.
5042This function is only available if `bnlp.meta.grad_available` is set to `true`.
5143"""
5244function batch_grad(bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector ) where {T, S}
5951"""
6052 bg = batch_grad!(bnlp, bx, bg)
6153
62- Evaluate ``∇f(bx)`` for a batch of points stored in `bx` in place.
63- Both input `bx` and output `bg` use a full strided (column-wise) batch layout.
6454This function is only available if `bbnlp.meta.grad_available` is set to `true`.
6555"""
6656function batch_grad! end
6757
6858"""
6959 bc = batch_cons(bnlp, bx)
70-
71- Evaluate ``c(x)``, the constraints at `x`.
72- The constraints are returned in a full strided (column-wise) layout, with one constraint
73- vector per batch entry.
7460"""
7561function batch_cons(bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector ) where {T, S}
7662 @lencheck (bnlp. meta. nvar * bnlp. meta. nbatch) bx
8167
8268"""
8369 bc = batch_cons!(bnlp, bx, bc)
84-
85- Evaluate ``c(x)``, the constraints at `x` in place.
86- Both input `bx` and output `c` follow a full strided (column-wise) batch layout.
8770"""
8871function batch_cons! end
8972
9073"""
9174 (jrows, jcols) = batch_jac_structure(bnlp)
9275
93- Return the structure of the constraints Jacobian in sparse coordinate format.
9476This function is only available if `bbnlp.meta.jac_available` is set to `true`.
9577"""
9678function batch_jac_structure(bnlp:: AbstractBatchNLPModel{T, S, VI} ) where {T, S, VI}
10385"""
10486 (jrows, jcols) = batch_jac_structure!(bnlp, jrows, jcols)
10587
106- Return the structure of the constraints Jacobian in sparse coordinate format in place.
10788This function is only available if `bbnlp.meta.jac_available` is set to `true`.
10889"""
10990function batch_jac_structure! end
11091
11192"""
11293 bjvals = batch_jac_coord(bnlp, bx)
11394
114- Evaluate ``J(x)``, the constraints Jacobian at `x` in sparse coordinate format.
11595This function is only available if `bbnlp.meta.jac_available` is set to `true`.
11696"""
11797function batch_jac_coord(bnlp:: AbstractBatchNLPModel , bx:: AbstractVector , bjvals:: AbstractVector )
@@ -124,15 +104,13 @@ end
124104"""
125105 bjvals = batch_jac_coord!(bnlp, bx, bjvals)
126106
127- Evaluate ``J(x)``, the constraints Jacobian at `x` in sparse coordinate format, rewriting `vals`.
128107This function is only available if `bbnlp.meta.jac_available` is set to `true`.
129108"""
130109function batch_jac_coord! end
131110
132111"""
133112 bJv = batch_jprod(bnlp, bx, bv)
134113
135- Evaluate ``J(x)v``, the Jacobian-vector product at `x`.
136114This function is only available if `bbnlp.meta.jprod_available` is set to `true`.
137115"""
138116function batch_jprod(bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector , bv:: AbstractVector ) where {T, S}
@@ -145,15 +123,13 @@ end
145123"""
146124 bJv = batch_jprod!(bnlp, bx, bv, bJv)
147125
148- Evaluate ``J(x)v``, the Jacobian-vector product at `x` in place.
149126This function is only available if `bbnlp.meta.jprod_available` is set to `true`.
150127"""
151128function batch_jprod! end
152129
153130"""
154131 bJtv = batch_jtprod(bnlp, bx, bv)
155132
156- Evaluate ``J(x)^Tv``, the transposed-Jacobian-vector product at `x`.
157133This function is only available if `bbnlp.meta.jtprod_available` is set to `true`.
158134"""
159135function batch_jtprod(bnlp:: AbstractBatchNLPModel{T, S} , bx:: AbstractVector , bv:: AbstractVector ) where {T, S}
@@ -167,16 +143,13 @@ end
167143"""
168144 bJtv = batch_jtprod!(bnlp, bx, bv, Jtv)
169145
170- Evaluate ``J(x)^Tv``, the transposed-Jacobian-vector product at `x` in place.
171- If the problem has linear and nonlinear constraints, this function allocates.
172146This function is only available if `bbnlp.meta.jtprod_available` is set to `true`.
173147"""
174148function batch_jtprod! end
175149
176150"""
177151 (hrows, hcols) = batch_hess_structure(bnlp)
178152
179- Return the structure of the Lagrangian Hessian in sparse coordinate format.
180153This function is only available if `bbnlp.meta.hess_available` is set to `true`.
181154"""
182155function batch_hess_structure(bnlp:: AbstractBatchNLPModel{T,S,VI} ) where {T, S, VI}
@@ -189,18 +162,13 @@ end
189162"""
190163 (hrows, hcols) = batch_hess_structure!(bnlp, hrows, hcols)
191164
192- Return the structure of the Lagrangian Hessian in sparse coordinate format in place.
193165This function is only available if `bbnlp.meta.hess_available` is set to `true`.
194166"""
195167function batch_hess_structure! end
196168
197169"""
198170 bhvals = batch_hess_coord(bnlp, bx, by, bobj_weight)
199171
200- Evaluate the Lagrangian Hessian at `(x,y)` in sparse coordinate format,
201- with objective function scaled by `obj_weight`, i.e.,
202- $(LAGRANGIAN_HESSIAN) .
203- Only the lower triangle is returned.
204172This function is only available if `nlp.meta.hess_available` is set to `true`.
205173"""
206174function batch_hess_coord(
@@ -219,20 +187,13 @@ end
219187"""
220188 bhvals = batch_hess_coord!(bnlp, bx, by, bobj_weight, bhvals)
221189
222- Evaluate the Lagrangian Hessian at `(x,y)` in sparse coordinate format,
223- with objective function scaled by `obj_weight`, i.e.,
224- $(LAGRANGIAN_HESSIAN) , overwriting `vals`.
225- Only the lower triangle is returned.
226190This function is only available if `bbnlp.meta.hess_available` is set to `true`.
227191"""
228192function batch_hess_coord! end
229193
230194"""
231195 bHv = batch_hprod(bnlp, bx, by, bv, bobj_weight)
232196
233- Evaluate the product of the objective Hessian at `x` with the vector `v`,
234- with objective function scaled by `obj_weight`, where the objective Hessian is
235- $(OBJECTIVE_HESSIAN) .
236197This function is only available if `bbnlp.meta.hprod_available` is set to `true`.
237198"""
238199function batch_hprod(
252213"""
253214 bHv = batch_hprod!(bnlp, bx, by, bv, bobj_weight, bHv)
254215
255- Evaluate the product of the objective Hessian at `x` with the vector `v` in
256- place, with objective function scaled by `obj_weight`, where the objective Hessian is
257- $(OBJECTIVE_HESSIAN) .
258216This function is only available if `bbnlp.meta.hprod_available` is set to `true`.
259217"""
260218function batch_hprod! end
0 commit comments