File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 625
625
626
626
_nan_to_zero (x) = isnan (x) ? 0.0 : x
627
627
628
+ # No docstring because this function is still a WIP.
628
629
function eval_multivariate_hessian (
629
630
registry:: OperatorRegistry ,
630
631
op:: Symbol ,
@@ -657,8 +658,8 @@ function eval_multivariate_hessian(
657
658
# ∇f(x) = x[2]*x[1]^(x[2]-1)
658
659
# x[1]^x[2]*log(x[1])
659
660
#
660
- # ∇²f(x) = x[2]*(x[2]-1)*x[1]^(x[2]-2) x[1]^(x[2]-1)*(x[2]*log(x[1])+1)
661
- # . x[1]^x[2]*log(x[1])^2
661
+ # ∇²f(x) = x[2]*(x[2]-1)*x[1]^(x[2]-2)
662
+ # x[1]^(x[2]-1)*(x[2]*log(x[1])+1) x[1]^x[2]*log(x[1])^2
662
663
ln = x[1 ] > 0 ? log (x[1 ]) : NaN
663
664
if x[2 ] == one (T)
664
665
H[2 , 1 ] = _nan_to_zero (ln + one (T))
@@ -678,8 +679,8 @@ function eval_multivariate_hessian(
678
679
# ∇f(x) = 1/x[2]
679
680
# -x[1]/x[2]^2
680
681
#
681
- # ∇²(x) = 0.0 -1/x[2]^2
682
- # . 2x[1]/x[2]^3
682
+ # ∇²(x) = 0.0
683
+ # -1/x[2]^2 2x[1]/x[2]^3
683
684
d = 1 / x[2 ]^ 2
684
685
H[2 , 1 ] = - d
685
686
H[2 , 2 ] = 2 * x[1 ] * d / x[2 ]
Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ mutable struct NonlinearData <: MOI.AbstractNLPEvaluator
151
151
last_constraint_index:: Int64
152
152
# Fields for initialize
153
153
julia_expressions:: Vector{Any} # Any because expressions may be constants
154
+ # ordered_constraints is needed because `OrderedDict` doesn't support
155
+ # looking up a key by the linear index.
154
156
ordered_constraints:: Vector{ConstraintIndex}
155
157
constraint_dual:: Vector{Float64}
156
158
# Timers
You can’t perform that action at this time.
0 commit comments