Skip to content

Commit

Permalink
change name
Browse files Browse the repository at this point in the history
  • Loading branch information
GiggleLiu committed Jan 18, 2025
1 parent 5109464 commit 95a9f56
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/OptimalBranchingCore/src/branch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The resulting value, which may have different type depending on the `result_type
"""
function branch_and_reduce(problem::AbstractProblem, config::BranchingStrategy, reducer::AbstractReducer, result_type; show_progress=false, tag=Tuple{Int,Int}[])
@debug "Branching and reducing problem" problem
is_solved(problem) && return zero(result_type)
has_zero_size(problem) && return zero(result_type)
# reduce the problem
rp, reducedvalue = reduce_problem(result_type, problem, reducer)
rp !== problem && return branch_and_reduce(rp, config, reducer, result_type; tag) * reducedvalue
Expand Down
2 changes: 1 addition & 1 deletion lib/OptimalBranchingCore/src/mockproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ function apply_branch(p::MockProblem, clause::Clause{INT}, variables::Vector{T})
end
return MockProblem(p.optimal[remain_mask]), count(i -> isone(readbit(clause.mask, i)) && (readbit(clause.val, i) == p.optimal[variables[i]]), 1:length(variables))
end
is_solved(p::MockProblem) = measure(p, NumOfVariables()) == 0
has_zero_size(p::MockProblem) = measure(p, NumOfVariables()) == 0
2 changes: 1 addition & 1 deletion lib/OptimalBranchingMIS/src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mutable struct MISProblem <: AbstractProblem
end
Base.copy(p::MISProblem) = MISProblem(copy(p.g))
Base.show(io::IO, p::MISProblem) = print(io, "MISProblem($(nv(p.g)))")
OptimalBranchingCore.is_solved(p::MISProblem) = nv(p.g) == 0
OptimalBranchingCore.has_zero_size(p::MISProblem) = nv(p.g) == 0

"""
TensorNetworkSolver
Expand Down

0 comments on commit 95a9f56

Please sign in to comment.