Skip to content

Commit 6684609

Browse files
Merge branch 'JuliaSmoothOptimizers:master' into update_shiftedcomposite
2 parents 1b5a746 + 2917b8b commit 6684609

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ libblastrampoline_jll = "8e850b90-86db-534c-a0d3-1478176c7d93"
1515
ProximalOperators = "0.15"
1616
QRMumps = "^0.3.0"
1717
Roots = "^1.0.0"
18+
SparseMatricesCOO = "0.2"
1819
julia = "^1.10.0"
1920

2021
[extras]

test/runtests.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ for (op, composite_op, shifted_op) ∈
1313
ShiftedOp = eval(shifted_op)
1414
CompositeOp = eval(composite_op)
1515

16-
function c!(z, x)
16+
function c1!(z, x)
1717
z[1] = 2*x[1] - x[4]
1818
z[2] = x[2] + x[3]
1919
end
20-
function J!(z, x)
20+
function J1!(z, x)
2121
z.vals .= Float64[2.0, 1.0, 1.0, -1.0]
2222
end
2323
λ = 3.62
@@ -27,7 +27,7 @@ for (op, composite_op, shifted_op) ∈
2727
b = zeros(Float64, 2)
2828
A = SparseMatrixCOO(Float64[2 0 0 -1; 0 1 1 0])
2929

30-
ψ = CompositeOp(λ, c!, J!, A, b)
30+
ψ = CompositeOp(λ, c1!, J1!, A, b)
3131

3232
# test non shifted operator
3333
@test ψ(ones(Float64, 4)) == h([1, 2])
@@ -66,17 +66,17 @@ for (op, composite_op, shifted_op) ∈
6666

6767
# test different types
6868
h = Op(Float32(λ))
69-
function c!(z, x)
69+
function c2!(z, x)
7070
z[1] = 2*x[1] - x[4]
7171
z[2] = x[2] + x[3]
7272
end
73-
function J!(z, x)
73+
function J2!(z, x)
7474
z.vals .= Float32[2.0, 1.0, 1.0, -1.0]
7575
end
7676
b = zeros(Float32, 2)
7777
A = SparseMatrixCOO(Float32[2 0 0 -1; 0 1 1 0])
7878

79-
ψ = CompositeOp(Float32(λ), c!, J!, A, b)
79+
ψ = CompositeOp(Float32(λ), c2!, J2!, A, b)
8080

8181
@test typeof(ψ(zeros(Float32, 4))) == Float32
8282

0 commit comments

Comments
 (0)