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
36 changes: 18 additions & 18 deletions .breakage/get_jso_users.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import GitHub, PkgDeps # both export users()
length(ARGS) >= 1 || error("specify at least one JSO package as argument")
jso_repos, _ = GitHub.repos("JuliaSmoothOptimizers")
jso_names = [splitext(x.name)[1] for x ∈ jso_repos]
name = splitext(ARGS[1])[1]
name ∈ jso_names || error("argument should be one of ", jso_names)
dependents = String[]
try
global dependents = filter(x -> x ∈ jso_names, PkgDeps.users(name))
catch e
# package not registered; don't insert into dependents
end
println(dependents)
import GitHub, PkgDeps # both export users()

length(ARGS) >= 1 || error("specify at least one JSO package as argument")

jso_repos, _ = GitHub.repos("JuliaSmoothOptimizers")
jso_names = [splitext(x.name)[1] for x ∈ jso_repos]

name = splitext(ARGS[1])[1]
name ∈ jso_names || error("argument should be one of ", jso_names)

dependents = String[]
try
global dependents = filter(x -> x ∈ jso_names, PkgDeps.users(name))
catch e
# package not registered; don't insert into dependents
end

println(dependents)
6 changes: 3 additions & 3 deletions src/P_mat/elemental_em.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function create_id_eem(elt_var::Vector{Int}; T = Float64, convex = false, linear
nie = length(elt_var)
_nie = (!linear) * nie
Bie = zeros(T, _nie, _nie)
[Bie[i, i] = 1 for i = 1:_nie]
[Bie[i, i] in 1 for i = 1:_nie]
counter = Counter_elt_mat()
_Bsr = Vector{T}(undef, _nie)
eem = Elemental_em{T}(nie, elt_var, Symmetric(Bie), counter, convex, linear, _Bsr)
Expand All @@ -83,7 +83,7 @@ function identity_eem(nie::Int; T = Float64, n = nie^2, convex = false, linear =
indices = rand(1:n, nie)
_nie = (!linear) * nie
Bie = zeros(T, _nie, _nie)
[Bie[i, i] = 1 for i = 1:_nie]
[Bie[i, i] in 1 for i = 1:_nie]
counter = Counter_elt_mat()
_Bsr = Vector{T}(undef, _nie)
eem = Elemental_em{T}(nie, indices, Symmetric(Bie), counter, convex, linear, _Bsr)
Expand Down Expand Up @@ -116,7 +116,7 @@ function fixed_ones_eem(i::Int, nie::Int; T = Float64, mul = 5.0, convex = false
indices = [i:(i + nie - 1);]
_nie = (!linear) * nie
Bie = ones(T, _nie, _nie)
[Bie[i, i] = mul for i = 1:_nie]
[Bie[i, i] in mul for i = 1:_nie]
counter = Counter_elt_mat()
_Bsr = Vector{T}(undef, _nie)
eem = Elemental_em{T}(nie, indices, Symmetric(Bie), counter, convex, linear, _Bsr)
Expand Down
6 changes: 3 additions & 3 deletions test/P_vec/ev.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using PartitionedStructures.M_abstract_element_struct
# elemental
ev1 = new_eev(nᵢᴱ)
v1 = rand(nᵢᴱ)
i1 = [1:nᵢᴱ:(nᵢᴱ^2);]
i1 = [1:nᵢᴱ:(nᵢᴱ ^ 2);]
set_vec!(ev1, v1)
set_indices!(ev1, i1)

Expand All @@ -37,7 +37,7 @@ end
@testset "interface SparseVector" begin
n = 20
sx = spzeros(Float64, n)
[sx[i] = i for i = 1:2:7]
[sx[i] in i for i = 1:2:7]

ex = eev_from_sparse_vec(sx)
_sx = sparse_vec_from_eev(ex; n = n)
Expand All @@ -61,7 +61,7 @@ end
v1 = get_vec(eev1)
i1 = get_indices(eev1)
lin_com = spzeros(eltype(v1), nᵢᴱ, nᵢᴱ) # identity matrix Matrix(I,n,n) didn't work
[lin_com[i, i] = 1 for i = 1:nᵢᴱ]
[lin_com[i, i] in 1 for i = 1:nᵢᴱ]
sv = sparsevec(i1, v1)
_tmp = rand(Int, nᵢᴱ)
end
Expand Down