@@ -65,15 +65,15 @@ function MOI.initialize(d::NLPEvaluator, requested_features::Vector{Symbol})
65
65
for k in d. subexpression_order
66
66
# Only load expressions which actually are used
67
67
d. subexpression_forward_values[k] = NaN
68
- nodes = d. data. expressions[k]
69
- adj = Nonlinear. adjacency_matrix (nodes)
68
+ expr = d. data. expressions[k]
69
+ adj = Nonlinear. adjacency_matrix (expr . nodes)
70
70
linearity = if d. want_hess
71
- _classify_linearity (nodes, adj, d. subexpression_linearity)[ 1 ]
71
+ _classify_linearity (expr . nodes, adj, d. subexpression_linearity)
72
72
else
73
- NONLINEAR
73
+ [ NONLINEAR]
74
74
end
75
75
subex = _SubexpressionStorage (
76
- d . data . expressions[k] ,
76
+ expr ,
77
77
adj,
78
78
moi_index_to_consecutive_index,
79
79
Float64[],
@@ -111,16 +111,16 @@ function MOI.initialize(d::NLPEvaluator, requested_features::Vector{Symbol})
111
111
max_chunk = 1
112
112
shared_partials_storage_ϵ = Float64[]
113
113
if d. data. objective != = nothing
114
- nodes = something (d. data. objective)
115
- adj = Nonlinear. adjacency_matrix (nodes)
114
+ expr = something (d. data. objective)
115
+ adj = Nonlinear. adjacency_matrix (expr . nodes)
116
116
linearity = if d. want_hess
117
- _classify_linearity (nodes, adj, d. subexpression_linearity)[ 1 ]
117
+ _classify_linearity (expr . nodes, adj, d. subexpression_linearity)
118
118
else
119
- NONLINEAR
119
+ [ NONLINEAR]
120
120
end
121
121
objective = _FunctionStorage (
122
122
_SubexpressionStorage (
123
- nodes ,
123
+ expr ,
124
124
adj,
125
125
moi_index_to_consecutive_index,
126
126
shared_partials_storage_ϵ,
@@ -135,24 +135,24 @@ function MOI.initialize(d::NLPEvaluator, requested_features::Vector{Symbol})
135
135
subexpression_variables,
136
136
linearity,
137
137
)
138
- max_expr_length = max (max_expr_length, length (objective . nodes))
138
+ max_expr_length = max (max_expr_length, length (expr . nodes))
139
139
max_chunk = max (max_chunk, size (objective. seed_matrix, 2 ))
140
140
d. objective = objective
141
141
end
142
142
for (k, (_, constraint)) in enumerate (d. data. constraints)
143
143
idx = d. data. objective != = nothing ? k + 1 : k
144
- nodes = main_expressions[idx]
145
- adj = Nonlinear. adjacency_matrix (nodes)
144
+ expr = constraint . expression
145
+ adj = Nonlinear. adjacency_matrix (expr . nodes)
146
146
linearity = if d. want_hess
147
- _classify_linearity (nodes, adj, d. subexpression_linearity)[ 1 ]
147
+ _classify_linearity (expr . nodes, adj, d. subexpression_linearity)
148
148
else
149
- NONLINEAR
149
+ [ NONLINEAR]
150
150
end
151
151
push! (
152
152
d. constraints,
153
153
_FunctionStorage (
154
154
_SubexpressionStorage (
155
- nodes ,
155
+ expr ,
156
156
adj,
157
157
moi_index_to_consecutive_index,
158
158
shared_partials_storage_ϵ,
0 commit comments