Skip to content
Open
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
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name = "ProximalOperators"
uuid = "a725b495-10eb-56fe-b38b-717eba820537"
version = "0.16.1"

[workspace]
projects = ["docs", "test", "benchmark"]

[deps]
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -15,7 +18,7 @@ TSVD = "9449cd9e-2762-5aa3-a617-5413e99d722e"
IterativeSolvers = "0.8 - 0.9"
LinearAlgebra = "1.4"
OSQP = "0.3 - 0.8"
ProximalCore = "0.1"
ProximalCore = "0.2.0"
SparseArrays = "1.4"
SuiteSparse = "1.4"
TSVD = "0.3 - 0.4"
Expand Down
29 changes: 20 additions & 9 deletions src/ProximalOperators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@ module ProximalOperators

using LinearAlgebra
import ProximalCore: prox, prox!, gradient, gradient!
import ProximalCore: is_convex, is_generalized_quadratic
import ProximalCore:
is_convex,
is_strongly_convex,
is_generalized_quadratic,
is_proximable,
is_separable,
is_singleton_indicator,
is_cone_indicator,
is_affine_indicator,
is_set_indicator,
is_smooth,
is_locally_smooth,
is_support

const RealOrComplex{R <: Real} = Union{R, Complex{R}}
const HermOrSym{T, S} = Union{Hermitian{T, S}, Symmetric{T, S}}
const RealBasedArray{R} = AbstractArray{C, N} where {C <: RealOrComplex{R}, N}
const TupleOfArrays{R} = Tuple{RealBasedArray{R}, Vararg{RealBasedArray{R}}}
const ArrayOrTuple{R} = Union{RealBasedArray{R}, TupleOfArrays{R}}
const TransposeOrAdjoint{M} = Union{Transpose{C,M} where C, Adjoint{C,M} where C}
const Maybe{T} = Union{T, Nothing}
const RealOrComplex{R<:Real} = Union{R,Complex{R}}
const HermOrSym{T,S} = Union{Hermitian{T,S},Symmetric{T,S}}
const RealBasedArray{R} = AbstractArray{C,N} where {C<:RealOrComplex{R},N}
const TupleOfArrays{R} = Tuple{RealBasedArray{R},Vararg{RealBasedArray{R}}}
const ArrayOrTuple{R} = Union{RealBasedArray{R},TupleOfArrays{R}}
const TransposeOrAdjoint{M} = Union{Transpose{C,M} where C,Adjoint{C,M} where C}
const Maybe{T} = Union{T,Nothing}

export prox, prox!, gradient, gradient!

Expand All @@ -23,7 +35,6 @@ include("utilities/linops.jl")
include("utilities/symmetricpacked.jl")
include("utilities/uniformarrays.jl")
include("utilities/normdiff.jl")
include("utilities/traits.jl")

# Basic functions

Expand Down
12 changes: 6 additions & 6 deletions src/calculus/conjugate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ struct Conjugate{T}
end
end

is_prox_accurate(::Type{Conjugate{T}}) where T = is_prox_accurate(T)
is_proximable(::Type{Conjugate{T}}) where T = is_proximable(T)
is_convex(::Type{Conjugate{T}}) where T = true
is_cone(::Type{Conjugate{T}}) where T = is_cone(T) && is_convex(T)
is_cone_indicator(::Type{Conjugate{T}}) where T = is_cone_indicator(T) && is_convex(T)
is_smooth(::Type{Conjugate{T}}) where T = is_strongly_convex(T)
is_strongly_convex(::Type{Conjugate{T}}) where T = is_smooth(T)
is_generalized_quadratic(::Type{Conjugate{T}}) where T = is_generalized_quadratic(T)
is_set(::Type{Conjugate{T}}) where T = is_convex(T) && is_support(T)
is_positively_homogeneous(::Type{Conjugate{T}}) where T = is_convex(T) && is_set(T)
is_set_indicator(::Type{Conjugate{T}}) where T = is_convex(T) && is_support(T)
is_positively_homogeneous(::Type{Conjugate{T}}) where T = is_convex(T) && is_set_indicator(T)

Conjugate(f::T) where T = Conjugate{T}(f)

Expand All @@ -37,7 +37,7 @@ Conjugate(f::T) where T = Conjugate{T}(f)
function prox!(y, g::Conjugate, x, gamma)
# Moreau identity
v = prox!(y, g.f, x/gamma, 1/gamma)
if is_set(g)
if is_set_indicator(g)
v = real(eltype(x))(0)
else
v = real(dot(x, y)) - gamma * real(dot(y, y)) - v
Expand All @@ -50,7 +50,7 @@ end

function prox_naive(g::Conjugate, x, gamma)
y, v = prox_naive(g.f, x/gamma, 1/gamma)
return x - gamma * y, if is_set(g) real(eltype(x))(0) else real(dot(x, y)) - gamma * real(dot(y, y)) - v end
return x - gamma * y, if is_set_indicator(g) real(eltype(x))(0) else real(dot(x, y)) - gamma * real(dot(y, y)) - v end
end

# TODO: hard-code conjugation rules? E.g. precompose/epicompose
4 changes: 2 additions & 2 deletions src/calculus/distL2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct DistL2{R, T}
ind::T
lambda::R
function DistL2{R, T}(ind::T, lambda::R) where {R, T}
if !is_set(ind)
if !is_set_indicator(ind)
error("`ind` must be a convex set")
end
if lambda <= 0
Expand All @@ -25,7 +25,7 @@ struct DistL2{R, T}
end
end

is_prox_accurate(::Type{DistL2{R, T}}) where {R, T} = is_prox_accurate(T)
is_proximable(::Type{DistL2{R, T}}) where {R, T} = is_proximable(T)
is_convex(::Type{DistL2{R, T}}) where {R, T} = is_convex(T)

DistL2(ind::T, lambda::R=1) where {R, T} = DistL2{R, T}(ind, lambda)
Expand Down
4 changes: 2 additions & 2 deletions src/calculus/pointwiseMinimum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ PointwiseMinimum(fs...) = PointwiseMinimum{typeof(fs)}(fs)

component_types(::Type{PointwiseMinimum{T}}) where T = fieldtypes(T)

@generated is_set(::Type{T}) where T <: PointwiseMinimum = return all(is_set, component_types(T)) ? :(true) : :(false)
@generated is_cone(::Type{T}) where T <: PointwiseMinimum = return all(is_cone, component_types(T)) ? :(true) : :(false)
@generated is_set_indicator(::Type{T}) where T <: PointwiseMinimum = return all(is_set_indicator, component_types(T)) ? :(true) : :(false)
@generated is_cone_indicator(::Type{T}) where T <: PointwiseMinimum = return all(is_cone_indicator, component_types(T)) ? :(true) : :(false)

function (g::PointwiseMinimum{T})(x) where T
return minimum(f(x) for f in g.fs)
Expand Down
11 changes: 6 additions & 5 deletions src/calculus/postcompose.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ struct Postcompose{T, R, S}
end
end

is_prox_accurate(::Type{<:Postcompose{T}}) where T = is_prox_accurate(T)
is_proximable(::Type{<:Postcompose{T}}) where T = is_proximable(T)
is_separable(::Type{<:Postcompose{T}}) where T = is_separable(T)
is_convex(::Type{<:Postcompose{T}}) where T = is_convex(T)
is_set(::Type{<:Postcompose{T}}) where T = is_set(T)
is_singleton(::Type{<:Postcompose{T}}) where T = is_singleton(T)
is_cone(::Type{<:Postcompose{T}}) where T = is_cone(T)
is_affine(::Type{<:Postcompose{T}}) where T = is_affine(T)
is_set_indicator(::Type{<:Postcompose{T}}) where T = is_set_indicator(T)
is_singleton_indicator(::Type{<:Postcompose{T}}) where T = is_singleton_indicator(T)
is_cone_indicator(::Type{<:Postcompose{T}}) where T = is_cone_indicator(T)
is_affine_indicator(::Type{<:Postcompose{T}}) where T = is_affine_indicator(T)
is_smooth(::Type{<:Postcompose{T}}) where T = is_smooth(T)
is_locally_smooth(::Type{<:Postcompose{T}}) where T = is_locally_smooth(T)
is_generalized_quadratic(::Type{<:Postcompose{T}}) where T = is_generalized_quadratic(T)
is_strongly_convex(::Type{<:Postcompose{T}}) where T = is_strongly_convex(T)

Expand Down
11 changes: 6 additions & 5 deletions src/calculus/precompose.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ struct Precompose{T, M, U, V}
end
end

is_prox_accurate(::Type{<:Precompose{T}}) where T = is_prox_accurate(T)
is_proximable(::Type{<:Precompose{T}}) where T = is_proximable(T)
is_convex(::Type{<:Precompose{T}}) where T = is_convex(T)
is_set(::Type{<:Precompose{T}}) where T = is_set(T)
is_singleton(::Type{<:Precompose{T}}) where T = is_singleton(T)
is_cone(::Type{<:Precompose{T}}) where T = is_cone(T)
is_affine(::Type{<:Precompose{T}}) where T = is_affine(T)
is_set_indicator(::Type{<:Precompose{T}}) where T = is_set_indicator(T)
is_singleton_indicator(::Type{<:Precompose{T}}) where T = is_singleton_indicator(T)
is_cone_indicator(::Type{<:Precompose{T}}) where T = is_cone_indicator(T)
is_affine_indicator(::Type{<:Precompose{T}}) where T = is_affine_indicator(T)
is_smooth(::Type{<:Precompose{T}}) where T = is_smooth(T)
is_locally_smooth(::Type{<:Precompose{T}}) where T = is_locally_smooth(T)
is_generalized_quadratic(::Type{<:Precompose{T}}) where T = is_generalized_quadratic(T)
is_strongly_convex(::Type{<:Precompose{T}}) where T = is_strongly_convex(T)

Expand Down
11 changes: 6 additions & 5 deletions src/calculus/precomposeDiagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ struct PrecomposeDiagonal{T, R, S}
end

is_separable(::Type{<:PrecomposeDiagonal{T}}) where T = is_separable(T)
is_prox_accurate(::Type{<:PrecomposeDiagonal{T}}) where T = is_prox_accurate(T)
is_proximable(::Type{<:PrecomposeDiagonal{T}}) where T = is_proximable(T)
is_convex(::Type{<:PrecomposeDiagonal{T}}) where T = is_convex(T)
is_set(::Type{<:PrecomposeDiagonal{T}}) where T = is_set(T)
is_singleton(::Type{<:PrecomposeDiagonal{T}}) where T = is_singleton(T)
is_cone(::Type{<:PrecomposeDiagonal{T}}) where T = is_cone(T)
is_affine(::Type{<:PrecomposeDiagonal{T}}) where T = is_affine(T)
is_set_indicator(::Type{<:PrecomposeDiagonal{T}}) where T = is_set_indicator(T)
is_singleton_indicator(::Type{<:PrecomposeDiagonal{T}}) where T = is_singleton_indicator(T)
is_cone_indicator(::Type{<:PrecomposeDiagonal{T}}) where T = is_cone_indicator(T)
is_affine_indicator(::Type{<:PrecomposeDiagonal{T}}) where T = is_affine_indicator(T)
is_smooth(::Type{<:PrecomposeDiagonal{T}}) where T = is_smooth(T)
is_locally_smooth(::Type{<:PrecomposeDiagonal{T}}) where T = is_locally_smooth(T)
is_generalized_quadratic(::Type{<:PrecomposeDiagonal{T}}) where T = is_generalized_quadratic(T)
is_strongly_convex(::Type{<:PrecomposeDiagonal{T}}) where T = is_strongly_convex(T)

Expand Down
3 changes: 2 additions & 1 deletion src/calculus/regularize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ struct Regularize{T, S, A}
end

is_separable(::Type{<:Regularize{T}}) where T = is_separable(T)
is_prox_accurate(::Type{<:Regularize{T}}) where T = is_prox_accurate(T)
is_proximable(::Type{<:Regularize{T}}) where T = is_proximable(T)
is_convex(::Type{<:Regularize{T}}) where T = is_convex(T)
is_smooth(::Type{<:Regularize{T}}) where T = is_smooth(T)
is_locally_smooth(::Type{<:Regularize{T}}) where T = is_locally_smooth(T)
is_generalized_quadratic(::Type{<:Regularize{T}}) where T = is_generalized_quadratic(T)
is_strongly_convex(::Type{<:Regularize}) = true

Expand Down
19 changes: 10 additions & 9 deletions src/calculus/separableSum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ SeparableSum(fs::Vararg) = SeparableSum((fs...,))

component_types(::Type{SeparableSum{T}}) where T = fieldtypes(T)

@generated is_prox_accurate(::Type{T}) where T <: SeparableSum = return all(is_prox_accurate, component_types(T)) ? :(true) : :(false)
@generated is_convex(::Type{T}) where T <: SeparableSum = return all(is_convex, component_types(T)) ? :(true) : :(false)
@generated is_set(::Type{T}) where T <: SeparableSum = return all(is_set, component_types(T)) ? :(true) : :(false)
@generated is_singleton(::Type{T}) where T <: SeparableSum = return all(is_singleton, component_types(T)) ? :(true) : :(false)
@generated is_cone(::Type{T}) where T <: SeparableSum = return all(is_cone, component_types(T)) ? :(true) : :(false)
@generated is_affine(::Type{T}) where T <: SeparableSum = return all(is_affine, component_types(T)) ? :(true) : :(false)
@generated is_smooth(::Type{T}) where T <: SeparableSum = return all(is_smooth, component_types(T)) ? :(true) : :(false)
@generated is_generalized_quadratic(::Type{T}) where T <: SeparableSum = return all(is_generalized_quadratic, component_types(T)) ? :(true) : :(false)
@generated is_strongly_convex(::Type{T}) where T <: SeparableSum = return all(is_strongly_convex, component_types(T)) ? :(true) : :(false)
@generated is_proximable(::Type{T}) where T <: SeparableSum = return all(is_proximable, component_types(T)) ? true : false
@generated is_convex(::Type{T}) where T <: SeparableSum = return all(is_convex, component_types(T)) ? true : false
@generated is_set_indicator(::Type{T}) where T <: SeparableSum = return all(is_set_indicator, component_types(T)) ? true : false
@generated is_singleton_indicator(::Type{T}) where T <: SeparableSum = return all(is_singleton_indicator, component_types(T)) ? true : false
@generated is_cone_indicator(::Type{T}) where T <: SeparableSum = return all(is_cone_indicator, component_types(T)) ? true : false
@generated is_affine_indicator(::Type{T}) where T <: SeparableSum = return all(is_affine_indicator, component_types(T)) ? true : false
@generated is_smooth(::Type{T}) where T <: SeparableSum = return all(is_smooth, component_types(T)) ? true : false
@generated is_locally_smooth(::Type{T}) where T <: SeparableSum = return all(is_locally_smooth, component_types(T)) ? true : false
@generated is_generalized_quadratic(::Type{T}) where T <: SeparableSum = return all(is_generalized_quadratic, component_types(T)) ? true : false
@generated is_strongly_convex(::Type{T}) where T <: SeparableSum = return all(is_strongly_convex, component_types(T)) ? true : false

(g::SeparableSum)(xs::Tuple) = sum(f(x) for (f, x) in zip(g.fs, xs))

Expand Down
11 changes: 6 additions & 5 deletions src/calculus/slicedSeparableSum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ end

component_types(::Type{SlicedSeparableSum{S, T, N}}) where {S, T, N} = Tuple(A.parameters[1] for A in fieldtypes(S))

@generated is_prox_accurate(::Type{T}) where T <: SlicedSeparableSum = return all(is_prox_accurate, component_types(T)) ? :(true) : :(false)
@generated is_proximable(::Type{T}) where T <: SlicedSeparableSum = return all(is_proximable, component_types(T)) ? :(true) : :(false)
@generated is_convex(::Type{T}) where T <: SlicedSeparableSum = return all(is_convex, component_types(T)) ? :(true) : :(false)
@generated is_set(::Type{T}) where T <: SlicedSeparableSum = return all(is_set, component_types(T)) ? :(true) : :(false)
@generated is_singleton(::Type{T}) where T <: SlicedSeparableSum = return all(is_singleton, component_types(T)) ? :(true) : :(false)
@generated is_cone(::Type{T}) where T <: SlicedSeparableSum = return all(is_cone, component_types(T)) ? :(true) : :(false)
@generated is_affine(::Type{T}) where T <: SlicedSeparableSum = return all(is_affine, component_types(T)) ? :(true) : :(false)
@generated is_set_indicator(::Type{T}) where T <: SlicedSeparableSum = return all(is_set_indicator, component_types(T)) ? :(true) : :(false)
@generated is_singleton_indicator(::Type{T}) where T <: SlicedSeparableSum = return all(is_singleton_indicator, component_types(T)) ? :(true) : :(false)
@generated is_cone_indicator(::Type{T}) where T <: SlicedSeparableSum = return all(is_cone_indicator, component_types(T)) ? :(true) : :(false)
@generated is_affine_indicator(::Type{T}) where T <: SlicedSeparableSum = return all(is_affine_indicator, component_types(T)) ? :(true) : :(false)
@generated is_smooth(::Type{T}) where T <: SlicedSeparableSum = return all(is_smooth, component_types(T)) ? :(true) : :(false)
@generated is_locally_smooth(::Type{T}) where T <: SlicedSeparableSum = return all(is_locally_smooth, component_types(T)) ? :(true) : :(false)
@generated is_generalized_quadratic(::Type{T}) where T <: SlicedSeparableSum = return all(is_generalized_quadratic, component_types(T)) ? :(true) : :(false)
@generated is_strongly_convex(::Type{T}) where T <: SlicedSeparableSum = return all(is_strongly_convex, component_types(T)) ? :(true) : :(false)

Expand Down
21 changes: 11 additions & 10 deletions src/calculus/sum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ Sum(fs::Vararg) = Sum((fs...,))

component_types(::Type{Sum{T}}) where T = fieldtypes(T)

# note: is_prox_accurate false because prox in general doesn't exist?
is_prox_accurate(::Type{<:Sum}) = false
@generated is_convex(::Type{T}) where T <: Sum = return all(is_convex, component_types(T)) ? :(true) : :(false)
@generated is_set(::Type{T}) where T <: Sum = return all(is_set, component_types(T)) ? :(true) : :(false)
@generated is_singleton(::Type{T}) where T <: Sum = return all(is_singleton, component_types(T)) ? :(true) : :(false)
@generated is_cone(::Type{T}) where T <: Sum = return all(is_cone, component_types(T)) ? :(true) : :(false)
@generated is_affine(::Type{T}) where T <: Sum = return all(is_affine, component_types(T)) ? :(true) : :(false)
@generated is_smooth(::Type{T}) where T <: Sum = return all(is_smooth, component_types(T)) ? :(true) : :(false)
@generated is_generalized_quadratic(::Type{T}) where T <: Sum = return all(is_generalized_quadratic, component_types(T)) ? :(true) : :(false)
@generated is_strongly_convex(::Type{T}) where T <: Sum = return (all(is_convex, component_types(T)) && any(is_strongly_convex, component_types(T))) ? :(true) : :(false)
# note: is_proximable false because prox in general doesn't exist?
is_proximable(::Type{<:Sum}) = false
@generated is_convex(::Type{T}) where T <: Sum = return all(is_convex, component_types(T)) ? true : false
@generated is_set_indicator(::Type{T}) where T <: Sum = return all(is_set_indicator, component_types(T)) ? true : false
@generated is_singleton_indicator(::Type{T}) where T <: Sum = return all(is_singleton_indicator, component_types(T)) ? true : false
@generated is_cone_indicator(::Type{T}) where T <: Sum = return all(is_cone_indicator, component_types(T)) ? true : false
@generated is_affine_indicator(::Type{T}) where T <: Sum = return all(is_affine_indicator, component_types(T)) ? true : false
@generated is_smooth(::Type{T}) where T <: Sum = return all(is_smooth, component_types(T)) ? true : false
@generated is_locally_smooth(::Type{T}) where T <: Sum = return all(is_locally_smooth, component_types(T)) ? true : false
@generated is_generalized_quadratic(::Type{T}) where T <: Sum = return all(is_generalized_quadratic, component_types(T)) ? true : false
@generated is_strongly_convex(::Type{T}) where T <: Sum = return (all(is_convex, component_types(T)) && any(is_strongly_convex, component_types(T))) ? true : false

function (sumobj::Sum)(x)
sum = real(eltype(x))(0)
Expand Down
5 changes: 3 additions & 2 deletions src/calculus/tilt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ struct Tilt{T, S, R}
end

is_separable(::Type{<:Tilt{T}}) where T = is_separable(T)
is_prox_accurate(::Type{<:Tilt{T}}) where T = is_prox_accurate(T)
is_proximable(::Type{<:Tilt{T}}) where T = is_proximable(T)
is_convex(::Type{<:Tilt{T}}) where T = is_convex(T)
is_singleton(::Type{<:Tilt{T}}) where T = is_singleton(T)
is_singleton_indicator(::Type{<:Tilt{T}}) where T = is_singleton_indicator(T)
is_smooth(::Type{<:Tilt{T}}) where T = is_smooth(T)
is_locally_smooth(::Type{<:Tilt{T}}) where T = is_locally_smooth(T)
is_generalized_quadratic(::Type{<:Tilt{T}}) where T = is_generalized_quadratic(T)
is_strongly_convex(::Type{<:Tilt{T}}) where T = is_strongly_convex(T)

Expand Down
11 changes: 6 additions & 5 deletions src/calculus/translate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ struct Translate{T, V}
end

is_separable(::Type{<:Translate{T}}) where T = is_separable(T)
is_prox_accurate(::Type{<:Translate{T}}) where T = is_prox_accurate(T)
is_proximable(::Type{<:Translate{T}}) where T = is_proximable(T)
is_convex(::Type{<:Translate{T}}) where T = is_convex(T)
is_set(::Type{<:Translate{T}}) where T = is_set(T)
is_singleton(::Type{<:Translate{T}}) where T = is_singleton(T)
is_cone(::Type{<:Translate{T}}) where T = is_cone(T)
is_affine(::Type{<:Translate{T}}) where T = is_affine(T)
is_set_indicator(::Type{<:Translate{T}}) where T = is_set_indicator(T)
is_singleton_indicator(::Type{<:Translate{T}}) where T = is_singleton_indicator(T)
is_cone_indicator(::Type{<:Translate{T}}) where T = is_cone_indicator(T)
is_affine_indicator(::Type{<:Translate{T}}) where T = is_affine_indicator(T)
is_smooth(::Type{<:Translate{T}}) where T = is_smooth(T)
is_locally_smooth(::Type{<:Translate{T}}) where T = is_locally_smooth(T)
is_generalized_quadratic(::Type{<:Translate{T}}) where T = is_generalized_quadratic(T)
is_strongly_convex(::Type{<:Translate{T}}) where T = is_strongly_convex(T)

Expand Down
2 changes: 1 addition & 1 deletion src/functions/elasticNet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct ElasticNet{R, S}
end

is_separable(f::Type{<:ElasticNet}) = true
is_prox_accurate(f::Type{<:ElasticNet}) = true
is_proximable(f::Type{<:ElasticNet}) = true
is_convex(f::Type{<:ElasticNet}) = true

ElasticNet(mu::R=1, lambda::S=1) where {R, S} = ElasticNet{R, S}(mu, lambda)
Expand Down
2 changes: 1 addition & 1 deletion src/functions/indAffine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export IndAffine

abstract type IndAffine end

is_affine(f::Type{<:IndAffine}) = true
is_affine_indicator(f::Type{<:IndAffine}) = true
is_generalized_quadratic(f::Type{<:IndAffine}) = true

fun_name(f::IndAffine) = "Indicator of an affine subspace"
Expand Down
2 changes: 1 addition & 1 deletion src/functions/indAffineIterative.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct IndAffineIterative{M, V} <: IndAffine
end
end

is_prox_accurate(f::Type{<:IndAffineIterative}) = false
is_proximable(f::Type{<:IndAffineIterative}) = false

IndAffineIterative(A::M, b::V) where {M, V} = IndAffineIterative{M, V}(A, b)

Expand Down
2 changes: 1 addition & 1 deletion src/functions/indBallL0.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct IndBallL0{I}
end
end

is_set(f::Type{<:IndBallL0}) = true
is_set_indicator(f::Type{<:IndBallL0}) = true

IndBallL0(r::I) where {I} = IndBallL0{I}(r)

Expand Down
4 changes: 2 additions & 2 deletions src/functions/indBallL1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ struct IndBallL1{R}
end

is_convex(f::Type{<:IndBallL1}) = true
is_set(f::Type{<:IndBallL1}) = true
is_prox_accurate(f::Type{<:IndBallL1}) = false
is_set_indicator(f::Type{<:IndBallL1}) = true
is_proximable(f::Type{<:IndBallL1}) = false

IndBallL1(r::R=1.0) where R = IndBallL1{R}(r)

Expand Down
2 changes: 1 addition & 1 deletion src/functions/indBallL2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct IndBallL2{R}
end

is_convex(f::Type{<:IndBallL2}) = true
is_set(f::Type{<:IndBallL2}) = true
is_set_indicator(f::Type{<:IndBallL2}) = true

IndBallL2(r::R=1) where R = IndBallL2{R}(r)

Expand Down
Loading