@@ -100,58 +100,47 @@ for fun in fieldnames(Counters)
100100 bnlp. counters.$ fun += 1
101101 end
102102end
103-
104-
105- batch_jac_structure(bnlp:: ForEachBatchNLPModel ) =
106- _batch_map(jac_structure, bnlp)
107- batch_jac_lin_structure(bnlp:: ForEachBatchNLPModel ) =
108- _batch_map(jac_lin_structure, bnlp)
109- batch_jac_nln_structure(bnlp:: ForEachBatchNLPModel ) =
110- _batch_map(jac_nln_structure, bnlp)
111- batch_hess_structure(bnlp:: ForEachBatchNLPModel ) =
112- _batch_map(hess_structure, bnlp)
113- batch_obj(bnlp:: ForEachBatchNLPModel , xs) =
114- _batch_map(obj, bnlp, xs)
115- batch_grad(bnlp:: ForEachBatchNLPModel , xs) =
116- _batch_map(grad, bnlp, xs)
117- batch_cons(bnlp:: ForEachBatchNLPModel , xs) =
118- _batch_map(cons, bnlp, xs)
119- batch_cons_lin(bnlp:: ForEachBatchNLPModel , xs) =
120- _batch_map(cons_lin, bnlp, xs)
121- batch_cons_nln(bnlp:: ForEachBatchNLPModel , xs) =
122- _batch_map(cons_nln, bnlp, xs)
123- batch_jac(bnlp:: ForEachBatchNLPModel , xs) =
124- _batch_map(jac, bnlp, xs)
125- batch_jac_lin(bnlp:: ForEachBatchNLPModel , xs) =
126- _batch_map(jac_lin, bnlp, xs)
127- batch_jac_nln(bnlp:: ForEachBatchNLPModel , xs) =
128- _batch_map(jac_nln, bnlp, xs)
129- batch_jac_lin_coord(bnlp:: ForEachBatchNLPModel , xs) =
130- _batch_map(jac_lin_coord, bnlp, xs)
131- batch_jac_coord(bnlp:: ForEachBatchNLPModel , xs) =
132- _batch_map(jac_coord, bnlp, xs)
133- batch_jac_nln_coord(bnlp:: ForEachBatchNLPModel , xs) =
134- _batch_map(jac_nln_coord, bnlp, xs)
135- batch_varscale(bnlp:: ForEachBatchNLPModel ) =
136- _batch_map(varscale, bnlp)
137- batch_lagscale(bnlp:: ForEachBatchNLPModel ) =
138- _batch_map(lagscale, bnlp)
139- batch_conscale(bnlp:: ForEachBatchNLPModel ) =
140- _batch_map(conscale, bnlp)
141- batch_jprod(bnlp:: ForEachBatchNLPModel , xs, vs) =
142- _batch_map(jprod, bnlp, xs, vs)
143- batch_jtprod(bnlp:: ForEachBatchNLPModel , xs, vs) =
144- _batch_map(jtprod, bnlp, xs, vs)
145- batch_jprod_nln(bnlp:: ForEachBatchNLPModel , xs, vs) =
146- _batch_map(jprod_nln, bnlp, xs, vs)
147- batch_jtprod_nln(bnlp:: ForEachBatchNLPModel , xs, vs) =
148- _batch_map(jtprod_nln, bnlp, xs, vs)
149- batch_jprod_lin(bnlp:: ForEachBatchNLPModel , xs, vs) =
150- _batch_map(jprod_lin, bnlp, xs, vs)
151- batch_jtprod_lin(bnlp:: ForEachBatchNLPModel , xs, vs) =
152- _batch_map(jtprod_lin, bnlp, xs, vs)
153- batch_ghjvprod(bnlp:: ForEachBatchNLPModel , xs, gs, vs) =
154- _batch_map(ghjvprod, bnlp, xs, gs, vs)
103+ for (batch_fun, fun) in (
104+ (:batch_jac_structure, :jac_structure),
105+ (:batch_jac_lin_structure, :jac_lin_structure),
106+ (:batch_jac_nln_structure, :jac_nln_structure),
107+ (:batch_hess_structure, :hess_structure),
108+ (:batch_varscale, :varscale),
109+ (:batch_lagscale, :lagscale),
110+ (:batch_conscale, :conscale),
111+ )
112+ @eval $ batch_fun(bnlp:: ForEachBatchNLPModel ) = _batch_map($ fun, bnlp)
113+ end
114+ for (batch_fun, fun) in (
115+ (:batch_obj, :obj),
116+ (:batch_grad, :grad),
117+ (:batch_cons, :cons),
118+ (:batch_cons_lin, :cons_lin),
119+ (:batch_cons_nln, :cons_nln),
120+ (:batch_jac, :jac),
121+ (:batch_jac_lin, :jac_lin),
122+ (:batch_jac_nln, :jac_nln),
123+ (:batch_jac_lin_coord, :jac_lin_coord),
124+ (:batch_jac_coord, :jac_coord),
125+ (:batch_jac_nln_coord, :jac_nln_coord),
126+ )
127+ @eval $ batch_fun(bnlp:: ForEachBatchNLPModel , x) = _batch_map($ fun, bnlp, x)
128+ end
129+ for (batch_fun, fun) in (
130+ (:batch_jprod, :jprod),
131+ (:batch_jtprod, :jtprod),
132+ (:batch_jprod_nln, :jprod_nln),
133+ (:batch_jtprod_nln, :jtprod_nln),
134+ (:batch_jprod_lin, :jprod_lin),
135+ (:batch_jtprod_lin, :jtprod_lin),
136+ )
137+ @eval $ batch_fun(bnlp:: ForEachBatchNLPModel , x, y) = _batch_map($ fun, bnlp, x, y)
138+ end
139+ for (batch_fun, fun) in (
140+ (:batch_ghjvprod, :ghjvprod),
141+ )
142+ @eval $ batch_fun(bnlp:: ForEachBatchNLPModel , x, y, z) = _batch_map($ fun, bnlp, x, y, z)
143+ end
155144
156145batch_jac_structure!(bnlp:: ForEachBatchNLPModel , rowss, colss) =
157146 _batch_map!(jac_structure!, bnlp, rowss, colss)
0 commit comments