From 87b134b1c99545a2069bee07f4d1df3e87e66fa8 Mon Sep 17 00:00:00 2001 From: Lea Kapelevich Date: Tue, 6 Oct 2020 17:30:36 -0400 Subject: [PATCH] minor tweaks, add missing inbounds --- src/Cones/epinormspectral.jl | 8 ++++---- src/Cones/power.jl | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Cones/epinormspectral.jl b/src/Cones/epinormspectral.jl index a7b077c69..f9232a486 100644 --- a/src/Cones/epinormspectral.jl +++ b/src/Cones/epinormspectral.jl @@ -1,12 +1,12 @@ #= epigraph of matrix spectral norm (operator norm associated with standard Euclidean norm; i.e. maximum singular value) -(u in R, W in R^{n,m}) : u >= opnorm(W) -note n <= m is enforced WLOG since opnorm(W) = opnorm(W') +(u in R, W in R^{d1,d2}) : u >= opnorm(W) +note d1 <= d2 is enforced WLOG since opnorm(W) = opnorm(W') W is vectorized column-by-column (i.e. vec(W) in Julia) barrier from "Interior-Point Polynomial Algorithms in Convex Programming" by Nesterov & Nemirovskii 1994 --logdet(u*I_n - W*W'/u) - log(u) -= -logdet(u^2*I_n - W*W') + (n - 1) log(u) +-logdet(u*I_d1 - W*W'/u) - log(u) += -logdet(u^2*I_d1 - W*W') + (d1 - 1) log(u) =# mutable struct EpiNormSpectral{T <: Real, R <: RealOrComplex{T}} <: Cone{T} diff --git a/src/Cones/power.jl b/src/Cones/power.jl index b30856b2b..ef855d09f 100644 --- a/src/Cones/power.jl +++ b/src/Cones/power.jl @@ -162,7 +162,7 @@ function update_hess(cone::Power) end offset = 2 / cone.produw - for j in m .+ (1:cone.n) + @inbounds for j in m .+ (1:cone.n) gj = g[j] @inbounds for i in 1:m H[i, j] = auiproduuw[i] * gj