Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some more oracle tests at the initial point #775

Merged
merged 1 commit into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Cones/epinormspectral.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function update_hess(cone::EpiNormSpectral{T, R}) where {T, R}
Zi = mul!(U1, Urzi, Urzi')
ZiW = mul!(w1, Urzi, mrziVt)
WZiWI = mul!(cone.VVt, mrziVt', mrziVt, T(0.5), false)
for i in 1:d2
@inbounds for i in 1:d2
WZiWI[i, i] += ui
end

Expand Down
9 changes: 6 additions & 3 deletions test/cone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,20 @@ function test_oracles(
@test Cones.get_proxsqr(cone, one(T), true) <= 1 # max proximity
@test Cones.get_proxsqr(cone, one(T), false) <= dim # sum proximity

prod_vec = zero(point)
@test Cones.hess_prod!(prod_vec, point, cone) ≈ dual_point atol=tol rtol=tol

# test centrality of initial point
if isfinite(init_tol)
@test point ≈ dual_point atol=init_tol rtol=init_tol
end
init_only && return

# test at initial point
prod_vec = zero(point)
hess = Cones.hess(cone)
@test hess * point ≈ dual_point atol=tol rtol=tol
@test Cones.hess_prod!(prod_vec, point, cone) ≈ dual_point atol=tol rtol=tol
inv_hess = Cones.inv_hess(cone)
@test inv_hess * dual_point ≈ point atol=tol rtol=tol
@test Cones.inv_hess_prod!(prod_vec, dual_point, cone) ≈ point atol=tol rtol=tol
@test hess * inv_hess ≈ I atol=tol rtol=tol

# perturb and scale the initial point
Expand Down