Skip to content

Commit 9578b9c

Browse files
authored
Merge pull request #357 from JuliaOpt/rearrange
Rearrange exports; deprecate `lambdamin`, `lambdamax`
2 parents 8bf8b53 + f93e340 commit 9578b9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+80
-170
lines changed

docs/examples_literate/general_examples/basic_usage.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ x.value
8181

8282

8383
y = Semidefinite(2)
84-
p = maximize(lambdamin(y), tr(y)<=6)
84+
p = maximize(eigmin(y), tr(y)<=6)
8585
solve!(p, SCS.Optimizer(verbose=0))
8686
p.optval
8787

docs/examples_literate/mixed_integer/aux_files/antidiag.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
# All expressions and atoms are subtpyes of AbstractExpr.
99
# Please read expressions.jl first.
1010
#############################################################################
11-
1211
import Convex.sign, Convex.monotonicity, Convex.curvature, Convex.evaluate, Convex.conic_form!
13-
export antidiag, sign, monotonicity, curvature, evaluate, conic_form!
12+
export antidiag
1413

1514
### Diagonal
1615
### Represents the kth diagonal of an mxn matrix as a (min(m, n) - k) x 1 vector

docs/src/operations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ solver (including SCS and Mosek).
110110
| ------------------ | --------------------------------- | ------- | ------------- | ------------------------------ |
111111
| `nuclearnorm(x)` | sum of singular values of $x$ | convex | not monotonic | none |
112112
| `operatornorm(x)` | max of singular values of $x$ | convex | not monotonic | none |
113-
| `lambdamax(x)` | max eigenvalue of $x$ | convex | not monotonic | none |
114-
| `lambdamin(x)` | min eigenvalue of $x$ | concave | not monotonic | none |
113+
| `eigmax(x)` | max eigenvalue of $x$ | convex | not monotonic | none |
114+
| `eigmin(x)` | min eigenvalue of $x$ | concave | not monotonic | none |
115115
| `matrixfrac(x, P)` | $x^TP^{-1}x$ | convex | not monotonic | IC: P is positive semidefinite |
116116

117117
Exponential + SDP representable Functions

src/Convex.jl

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,36 @@ module Convex
44
using OrderedCollections: OrderedDict
55
using LinearAlgebra
66
using SparseArrays
7+
using AbstractTrees: AbstractTrees
78

89
using MathOptInterface
910
const MOI = MathOptInterface
1011
const MOIU = MOI.Utilities
1112
const MOIB = MOI.Bridges
1213

13-
global DEFAULT_SOLVER = nothing
14+
# Functions
15+
export conv, dotsort, entropy, exp, geomean, hinge_loss, huber, inner_product, invpos
16+
export log_perspective, logisticloss, logsumexp, matrixfrac, neg, norm2, norm_1, norm_inf, nuclearnorm
17+
export partialtrace, partialtranspose, pos, qol_elementwise, quadform, quadoverlin, rationalnorm
18+
export relative_entropy, scaledgeomean, sigmamax, square, sumlargest, sumlargesteigs, sumsmallest, sumsquares
19+
20+
# rexports from LinearAlgebra
21+
export diag, diagm, Diagonal, dot, eigmax, eigmin, kron, logdet, norm, tr
22+
23+
# Constraints
24+
export isposdef, , # PSD constraints
25+
export socp
26+
27+
# Variables
28+
export Constant, ComplexVariable, HermitianSemidefinite, Semidefinite, Variable
29+
export curvature, evaluate, fix!, free!, monotonicity, sign, vexity
30+
31+
# Signs
32+
export Positive, Negative, ComplexSign, NoSign
33+
34+
# Problems
35+
export add_constraint!, add_constraints!, maximize, minimize, Problem, satisfy, solve!
36+
1437
### modeling framework
1538
include("dcp.jl")
1639
include("expressions.jl")
@@ -71,7 +94,7 @@ include("atoms/second_order_cone/huber.jl")
7194
### SDP atoms
7295
include("atoms/sdp_cone/nuclearnorm.jl")
7396
include("atoms/sdp_cone/operatornorm.jl")
74-
include("atoms/sdp_cone/lambda_min_max.jl")
97+
include("atoms/sdp_cone/eig_min_max.jl")
7598
include("atoms/sdp_cone/matrixfrac.jl")
7699
include("atoms/sdp_cone/sumlargesteigs.jl")
77100

@@ -98,4 +121,7 @@ function clearmemory()
98121
Base.depwarn("Convex.clearmemory() is deprecated, as the memory leak it works around has been closed (in https://github.com/JuliaOpt/Convex.jl/pull/322). This function no longer does anything and will be removed in a future Convex.jl release.", :clearmemory )
99122
end
100123

124+
@deprecate lambdamin eigmin
125+
@deprecate lambdamax eigmax
126+
101127
end

src/atoms/affine/add_subtract.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
# Please read expressions.jl first.
77
#############################################################################
88

9-
export +, -
10-
export sign, curvature, monotonicity, evaluate
11-
129
### Unary Negation
1310

1411
struct NegateAtom <: AbstractExpr

src/atoms/affine/conjugate.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import Base.conj
2-
export conj
3-
export sign, curvature, monotonicity, evaluate, conic_form!
42
struct ConjugateAtom <: AbstractExpr
53
head::Symbol
64
id_hash::UInt64

src/atoms/affine/conv.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Handles convolution between a constant vector and an expression vector.
44
#############################################################################
55

6-
export conv
7-
86
function conv(x::Value, y::AbstractExpr)
97
if (size(x,2) != 1 && length(size(x)) != 1) || size(y,2) != 1
108
error("convolution only supported between two vectors")

src/atoms/affine/diag.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
# k >= min(num_cols, num_rows) || k <= -min(num_rows, num_cols)
99
import LinearAlgebra.diag
10-
export diag
11-
#export sign, curvature, monotonicity, evaluate
1210

1311
### Diagonal
1412
### Represents the kth diagonal of an mxn matrix as a (min(m, n) - k) x 1 vector

src/atoms/affine/diagm.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#############################################################################
77

88
import LinearAlgebra.diagm, LinearAlgebra.Diagonal
9-
export diagm, Diagonal
109

1110
struct DiagMatrixAtom <: AbstractExpr
1211
head::Symbol

src/atoms/affine/dot.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import LinearAlgebra.dot
2-
export dot
32

43
ismatrix(x::AbstractExpr) = (s = size(x); length(s) == 2 && s[1] > 1 && s[2] > 1)
54
ismatrix(::AbstractMatrix) = true

0 commit comments

Comments
 (0)