Skip to content

Commit 997a31c

Browse files
amontoisonklamike
andauthored
Update src/nlp/batch_meta.jl
Co-authored-by: Michael Klamkin <klamike@users.noreply.github.com>
1 parent 7a6e86d commit 997a31c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/nlp/batch_meta.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,14 @@ struct BatchNLPModelMeta{T, S} <: AbstractBatchNLPModelMeta{T, S}
8686
jtprod_available::Bool
8787
hprod_available::Bool
8888
end
89-
89+
for field in fieldnames(BatchNLPModelMeta)
90+
meth = Symbol("get_", field)
91+
@eval begin
92+
$meth(meta::AbstractBatchNLPModelMeta) = getproperty(meta, $(QuoteNode(field)))
93+
end
94+
@eval $meth(bnlp::AbstractBatchNLPModel) = $meth(bnlp.meta)
95+
@eval export $meth
96+
end
9097
function BatchNLPModelMeta{T, S}(
9198
nbatch::Int,
9299
nvar::Int;

0 commit comments

Comments
 (0)