From 314b544ac6a2d9c41e0b8bad7aaa2bc4920e0c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 17 Aug 2026 09:06:15 +0200 Subject: [PATCH] Rename List -> Permutation --- src/MOI/list.jl | 8 ++++---- src/MOI/sum_distances_objective.jl | 2 +- src/MOI/wrapper.jl | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/MOI/list.jl b/src/MOI/list.jl index d3798f5..2dd8313 100644 --- a/src/MOI/list.jl +++ b/src/MOI/list.jl @@ -32,22 +32,22 @@ function _add_list_variables!(m::Optimizer, hx_list::HxExpression, n::Int) return indices end -# ── MathOptVRP.List ───────────────────────────────────────────────── +# ── MathOptVRP.Permutation ────────────────────────────────────────── function MOI.supports_add_constrained_variables( ::Optimizer, - ::Type{MathOptVRP.List}, + ::Type{MathOptVRP.Permutation}, ) return true end -function MOI.add_constrained_variables(m::Optimizer, set::MathOptVRP.List) +function MOI.add_constrained_variables(m::Optimizer, set::MathOptVRP.Permutation) n = set.dimension hx_list = list!(m.model, n) # Pin the list's count so the solver can't pick a shorter list. _add_hexaly_constraint!(m, eq(m.model, count_(m.model, hx_list), n)) indices = _add_list_variables!(m, hx_list, n) - cindex = MOI.ConstraintIndex{MOI.VectorOfVariables,MathOptVRP.List}( + cindex = MOI.ConstraintIndex{MOI.VectorOfVariables,MathOptVRP.Permutation}( length(m.constraint_info) + 1, ) m.constraint_info[cindex] = diff --git a/src/MOI/sum_distances_objective.jl b/src/MOI/sum_distances_objective.jl index 747c98e..5032b58 100644 --- a/src/MOI/sum_distances_objective.jl +++ b/src/MOI/sum_distances_objective.jl @@ -118,7 +118,7 @@ function _vector_affine_to_items(f::MOI.VectorAffineFunction) end # `MathOptVRP` node values are 1-based, while Hexaly lists and arrays are -# 0-based. List variables retain their identity here because the specialized +# 0-based. Permutation variables retain their identity here because the specialized # lowering paths below access their raw parent list; constants are shifted for # Hexaly array indexing. function _shift_to_zero_based!(items, from::Int = 1) diff --git a/src/MOI/wrapper.jl b/src/MOI/wrapper.jl index b0403a0..e3bfb38 100644 --- a/src/MOI/wrapper.jl +++ b/src/MOI/wrapper.jl @@ -13,7 +13,7 @@ mutable struct VariableInfo index::MOI.VariableIndex variable::HxExpression # When the variable is an element of a Hexaly `list` decision variable - # (e.g., via `MathOptVRP.List` or `MathOptVRP.Partition`), `parent_list` is that + # (e.g., via `MathOptVRP.Permutation` or `MathOptVRP.Partition`), `parent_list` is that # list expression. `_build_sum_distances_expression` uses it to access # the underlying list's variable count and elements. parent_list::Union{Nothing,HxExpression}