We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82100be commit 818ec7bCopy full SHA for 818ec7b
src/nlp/utils.jl
@@ -141,3 +141,10 @@ macro default_counters(Model, inner)
141
)
142
ex
143
end
144
+
145
+"""
146
+ eltype(nlp::AbstractNLPModel{T, S})
147
148
+Element type of `nlp.meta.x0`.
149
150
+Base.eltype(nlp::AbstractNLPModel{T, S}) where {T, S} = eltype(nlp.meta.x0)
test/nlp/api.jl
@@ -7,6 +7,7 @@
7
H(x, y) = H(x) + y[2] * [-0.5 0; 0 -2.0]
8
9
nlp = SimpleNLPModel()
10
+ @test eltype(nlp) == Float64
11
n = nlp.meta.nvar
12
m = nlp.meta.ncon
13
test/nls/api.jl
@@ -4,6 +4,7 @@
4
HF(x, w) = w[2] * [-20.0 0; 0 0]
5
6
nls = SimpleNLSModel()
+ @test eltype(nls) == Float64
n = nls.meta.nvar
m = nls.meta.ncon
ne = nls_meta(nls).nequ
0 commit comments