-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extension for ProximalCore/-Operators adapter
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
ext/RegularizedLeastSquaresProximalCore/RegularizedLeastSquaresProximalCore.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module RegularizedLeastSquaresProximalCore | ||
|
||
using RegularizedLeastSquares, ProximalCore | ||
|
||
import RegularizedLeastSquares.prox!, RegularizedLeastSquares.ProximalCoreAdapter | ||
|
||
struct ProximalCoreAdapterImpl{T, F} <: ProximalCoreAdapter{T, F} | ||
λ::T | ||
op::F | ||
end | ||
|
||
RegularizedLeastSquares.ProximalCoreAdapter(λ::T, op::F) where {T, F} = ProximalCoreAdapterImpl(λ, op) | ||
|
||
function prox!(reg::ProximalCoreAdapter, x::AbstractArray{Tc}, λ::T) where {T, Tc <: Union{T, Complex{T}}} | ||
ProximalCore.prox!(x, reg.op, x, λ) | ||
return x | ||
Check warning on line 16 in ext/RegularizedLeastSquaresProximalCore/RegularizedLeastSquaresProximalCore.jl Codecov / codecov/patchext/RegularizedLeastSquaresProximalCore/RegularizedLeastSquaresProximalCore.jl#L14-L16
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters