Skip to content

Commit

Permalink
fixes #171
Browse files Browse the repository at this point in the history
  • Loading branch information
goulart-paul committed Jun 12, 2024
1 parent 8a62df1 commit dd709aa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/chordal/merge_strategy/clique_graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ end
# Find all the cliques connected to `c` which are given by the nonzeros in `(c, 1:c-1)` and `(c+1:n, c)`.

function find_neighbors(edges::SparseMatrixCSC, c::DefaultInt)
neighbors = zeros(Int, 0)
neighbors = zeros(DefaultInt, 0)
_, n = size(edges)
# find all nonzero columns in row c up to column c
if c > 1
Expand Down Expand Up @@ -678,13 +678,13 @@ end
# to floats to allow emperical edge weight functions.

function compute_weights!(
rows::Vector{Int},
cols::Vector{Int},
rows::Vector{DefaultInt},
cols::Vector{DefaultInt},
snode::Vector{VertexSet},
edge_weight::EdgeWeightMethod
)

weights = zeros(Int, length(rows))
weights = zeros(DefaultInt, length(rows))

for k = 1:length(rows)
c_1 = snode[rows[k]]
Expand Down
12 changes: 6 additions & 6 deletions src/chordal/merge_strategy/parent_child.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
mutable struct ParentChildMergeStrategy <: AbstractMergeStrategy
stop::Bool
clique_index::Int
t_fill::Int
t_size::Int
clique_index::DefaultInt
t_fill::DefaultInt
t_size::DefaultInt

# PJG: fill and size need to be settable
function ParentChildMergeStrategy(; t_fill = 8, t_size = 8)
Expand Down Expand Up @@ -32,7 +32,7 @@ end

# Decide whether to merge the two clique candidates.

function evaluate(strategy::ParentChildMergeStrategy, t::SuperNodeTree, cand::Tuple{Int, Int})
function evaluate(strategy::ParentChildMergeStrategy, t::SuperNodeTree, cand::Tuple{DefaultInt, DefaultInt})

strategy.stop && return false

Expand All @@ -52,7 +52,7 @@ end
function merge_two_cliques!(
strategy::ParentChildMergeStrategy,
t::SuperNodeTree,
cand::Tuple{Int, Int}
cand::Tuple{DefaultInt, DefaultInt}
)

# determine which clique is the parent
Expand Down Expand Up @@ -85,7 +85,7 @@ end
function update_strategy!(
strategy::ParentChildMergeStrategy,
t::SuperNodeTree,
cand::Tuple{Int, Int},
cand::Tuple{DefaultInt, DefaultInt},
do_merge::Bool
)
# try to merge last node of order 1, then stop
Expand Down
2 changes: 1 addition & 1 deletion src/chordal/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using DataStructures

abstract type AbstractMergeStrategy end
VertexSet = OrderedSet{Int}
VertexSet = OrderedSet{DefaultInt}

#PJG: make a settable option
@enum EdgeWeightMethod begin
Expand Down
2 changes: 1 addition & 1 deletion src/json.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function parse(dict::AbstractDict, ::Type{Settings{T}}) where T
if key == "GenPowerConeT"
vals = dict[key]
α = convert(Vector{Float64}, vals[1])
dim2 = Int(vals[2])
dim2 = DefaultInt(vals[2])
return coneT(α,dim2)

else
Expand Down
2 changes: 1 addition & 1 deletion src/kktsolvers/kktsolver_directldl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ end

#updates KKT matrix values
function _update_values_KKT!(
KKT::SparseMatrixCSC{T,Int},
KKT::SparseMatrixCSC{T,DefaultInt},
index::AbstractVector{Ti},
values::AbstractVector{T}
) where{T,Ti}
Expand Down

0 comments on commit dd709aa

Please sign in to comment.