Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
dufourc1 committed Nov 28, 2023
1 parent e22ccb2 commit fd22db0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/assignment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ mutable struct Assignment{T, M}
end

function Assignment(A::Array{I, 3},
node_labels,
group_size::GroupSize{T}) where {I, T}
node_labels,
group_size::GroupSize{T}) where {I, T}
M = ndims(A)
number_groups = length(group_size)

Expand Down
4 changes: 2 additions & 2 deletions src/config_rules/accept_rule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Return the updated `current` assignment based on the `accept_rule`.
accept_reject_update!

function accept_reject_update!(history::GraphOptimizationHistory, iteration::Int,
proposal::Assignment,
current::Assignment, ::Strict)
proposal::Assignment,
current::Assignment, ::Strict)
if proposal.likelihood > current.likelihood
deepcopy!(current, proposal)
end
Expand Down
14 changes: 7 additions & 7 deletions src/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ julia> loglikelihood = out.likelihood
```
"""
function graphhist(A; h = select_bandwidth(A), maxitr = 10000,
swap_rule::NodeSwapRule = RandomNodeSwap(),
starting_assignment_rule::StartingAssignment = EigenStart(),
accept_rule::AcceptRule = Strict(),
stop_rule::StopRule = PreviousBestValue(100), record_trace = true)
swap_rule::NodeSwapRule = RandomNodeSwap(),
starting_assignment_rule::StartingAssignment = EigenStart(),
accept_rule::AcceptRule = Strict(),
stop_rule::StopRule = PreviousBestValue(100), record_trace = true)
checkadjacency(A)
@assert maxitr > 0
A = drop_disconnected_components(A)
Expand All @@ -101,7 +101,7 @@ end
Internal version of `graphhist` which is type stable.
"""
function _graphhist(A, record_trace = Val{true}(); h, maxitr, swap_rule,
starting_assignment_rule, accept_rule, stop_rule)
starting_assignment_rule, accept_rule, stop_rule)
best, current, proposal, history, A = initialize(A, h, starting_assignment_rule,
record_trace)

Expand Down Expand Up @@ -130,8 +130,8 @@ function graphhist_format_output(best, history::NoTraceHistory)
end

function update_best!(history::GraphOptimizationHistory, iteration::Int,
current::Assignment,
best::Assignment)
current::Assignment,
best::Assignment)
if current.likelihood > best.likelihood
update_best!(history, iteration, current.likelihood)
deepcopy!(best, current)
Expand Down
4 changes: 2 additions & 2 deletions src/proposal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ proposal is stored in the history.
The `proposal` assignment is modified in place to avoid unnecessary memory allocation.
"""
function create_proposal!(history::GraphOptimizationHistory, iteration::Int,
proposal::Assignment,
current::Assignment, A, swap_rule)
proposal::Assignment,
current::Assignment, A, swap_rule)
swap = select_swap(current, A, swap_rule)
make_proposal!(proposal, current, swap, A)
update_proposal!(history, iteration, proposal.likelihood)
Expand Down

0 comments on commit fd22db0

Please sign in to comment.